Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open the sd card file while transmitting audio data to connected device through bluetooth a2dp (AUD-5602) #1245

Open
MSalman9133 opened this issue Aug 8, 2024 · 18 comments

Comments

@MSalman9133
Copy link

error_Pic sd_pic through using example code (D:\ESP_ADF\esp-adf\examples\player\pipeline_a2dp_source_stream)
@github-actions github-actions bot changed the title Unable to open the sd card file while transmitting audio data to connected device through bluetooth a2dp Unable to open the sd card file while transmitting audio data to connected device through bluetooth a2dp (AUD-5602) Aug 8, 2024
@MSalman9133
Copy link
Author

audio_element_set_uri(fatfs_stream_reader, "/sdcard/test.mp3"); // i had set the same path still no luck

  1. discovery and connection is absolutely fine when comes to transmission itself open the file is an error

@MSalman9133
Copy link
Author

image
even mounted uri path also correct,read operation is also correct,when commes to open the sdcard file return -1.

@MSalman9133
Copy link
Author

@hbler99
Copy link

hbler99 commented Aug 9, 2024

Have you set menuconfig > Component config > FAT Filesystem support > Long filename support ?

@MSalman9133
Copy link
Author

Have you set menuconfig > Component config > FAT Filesystem support > Long filename support ?

Tqs for u reply hbler99 but still the same no luck
image

image

@hbler99
Copy link

hbler99 commented Aug 9, 2024

You can try set Max long filename length > 512

@hbler99
Copy link

hbler99 commented Aug 9, 2024

menuconfig > Component config > FAT Filesystem support > Max long filename length > 512

@MSalman9133
Copy link
Author

image
if place 512 save and build the project after that also again reverting back to 255

@MSalman9133
Copy link
Author

even i had tried smaller name (renamed test.mp3 to t.mp3) i tried with that still the same

@hbler99
Copy link

hbler99 commented Aug 9, 2024

The SD card might be damaged. I recommend formatting the SD card and then trying again.

@MSalman9133
Copy link
Author

image
looking fyn ryt

@MSalman9133
Copy link
Author

The SD card might be damaged. I recommend formatting the SD card and then trying again.

But i have tried this example iam using esp32_lyrat_mini_v1.2 board
D:\ESP_ADF\esp-adf\examples\player\pipeline_sdcard_mp3_control--->this example is working on the same memory card on same board through audio codac iam getting the mp3 songs this is working fyn when comes trying to sending through blutooth iam facing this file read issue

@MSalman9133
Copy link
Author

@hbler99

@hbler99
Copy link

hbler99 commented Aug 13, 2024

My configuration is as folllows, which doesn't encounter problems.
2024-08-13_10-39
image
Additionally, the board used is Esp32-LyraT-V4.3

@MSalman9133
Copy link
Author

MSalman9133 commented Aug 13, 2024

button_press.txt
able to run the code now as if now hardcoded path able to stream my requirement is till play gpio button press it should not start streaming may i know what is the issue in above code

@MSalman9133
Copy link
Author

MSalman9133 commented Aug 13, 2024

All button should be work previous button and next button and volume up and volume down bluttooth stream should be controlled by gpio buttons

@MSalman9133
Copy link
Author

MSalman9133 commented Aug 13, 2024

@hbler99...? can u please share the refrenece if u have

@hbler99
Copy link

hbler99 commented Aug 15, 2024

What's your development board? In my way, the button flag is set by input key service

ESP_LOGI(TAG, "[ 3 ] Create and start input key service");
    input_key_service_info_t input_key_info[] = INPUT_KEY_DEFAULT_INFO();
    input_key_service_cfg_t input_cfg = INPUT_KEY_SERVICE_DEFAULT_CONFIG();
    input_cfg.handle = set;
    periph_service_handle_t input_ser = input_key_service_create(&input_cfg);
    input_key_service_add_key(input_ser, input_key_info, INPUT_KEY_NUM);
    periph_service_set_callback(input_ser, input_key_service_cb, (void *)board_handle);

static esp_err_t input_key_service_cb(periph_service_handle_t handle, periph_service_event_t *evt, void *ctx)
{
    /* Handle touch pad events
           to start, pause, resume, finish current song and adjust volume
        */
    audio_board_handle_t board_handle = (audio_board_handle_t) ctx;
    int player_volume;
    audio_hal_get_volume(board_handle->audio_hal, &player_volume);
    if (evt->type == INPUT_KEY_SERVICE_ACTION_CLICK_RELEASE) {
        ESP_LOGI(TAG, "[ * ] input key id is %d", (int)evt->data);
        switch ((int)evt->data) {
            case INPUT_KEY_USER_ID_PLAY:
                ESP_LOGI(TAG, "[ * ] [Play] input key event");
                send_flag = true;
                ESP_LOGE(TAG, "START recording");
                break;
            case INPUT_KEY_USER_ID_SET:
                ESP_LOGI(TAG, "[ * ] [Set] input key event");
                send_flag = false;
                rb_reset(recv_rb);
                ESP_LOGI(TAG, "STOP recording");
                break;
            case INPUT_KEY_USER_ID_VOLUP:
                ESP_LOGI(TAG, "[ * ] [Vol+] input key event");
                player_volume += 10;
                if (player_volume > 100) {
                    player_volume = 100;
                }
                audio_hal_set_volume(board_handle->audio_hal, player_volume);
                ESP_LOGI(TAG, "[ * ] Volume set to %d %%", player_volume);
                break;
            case INPUT_KEY_USER_ID_VOLDOWN:
                ESP_LOGI(TAG, "[ * ] [Vol-] input key event");
                player_volume -= 10;
                if (player_volume < 0) {
                    player_volume = 0;
                }
                audio_hal_set_volume(board_handle->audio_hal, player_volume);
                ESP_LOGI(TAG, "[ * ] Volume set to %d %%", player_volume);
                break;
        }
    }

    return ESP_OK;
}

It's referenced in pipeline_a2dp_sink_stream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants