ESP32, A2DP source, AVRC target

g3gg0.de
Posts: 6
Joined: Wed Oct 04, 2023 10:47 am

ESP32, A2DP source, AVRC target

Postby g3gg0.de » Wed Oct 04, 2023 11:29 am

Hello,

I tried to implement a "media player" device that acts like a mobile phone would in modern car MMIs.
To my understanding this means, it provides an A2DP source and is controllable via AVRC.
There are examples in the ESP-ADF which implement part of it, but this scenario seems not supported out of the box.

So I had to change the pipeline_bt_source and change stuff so the ESP
- is discoverable
- does not discover other parties
- starts AVRC in target mode
- starts A2DP in source mode
- activate SSP

So the ESP was finally discoverable and bindable with the CAR's MMI.
However the MMI showed that the device "does not report status" and thus doesn't show any track etc of course.
Also volume and track controls do not raise any AVCRP callbacks.

Before i get too deep into the rabbit hole...

Is this something that is doable with the ESP32's bluetooth stack in general?
Is it maybe just me not using the a2d/avrc API properly?

OR

Is this impossible for a normal developer because the bluetooth stack would need an update?

BR,
g3gg0

g3gg0.de
Posts: 6
Joined: Wed Oct 04, 2023 10:47 am

Re: ESP32, A2DP source, AVRC target

Postby g3gg0.de » Thu Oct 05, 2023 6:33 pm

Meanwhile I spent a day, going down that rabbit hole.

One thing I missed, was enabling commands via

Code: Select all

esp_avrc_tg_set_psth_cmd_filter(ESP_AVRC_PSTH_FILTER_SUPPORTED_CMD, &cmd_set)
however this only enables forwarding the command messages from the bluedriod stack to the application.

For the reporting back, nothing seems to do the trick.

Code: Select all

                rn_param.playback = ESP_AVRC_PLAYBACK_PLAYING;
                esp_avrc_tg_send_rn_rsp(ESP_AVRC_RN_PLAY_STATUS_CHANGE, ESP_AVRC_RN_RSP_CHANGED, &rn_param);

                rn_param.elm_id[0] = 'a';
                rn_param.elm_id[1] = 0;
                esp_avrc_tg_send_rn_rsp(ESP_AVRC_RN_TRACK_CHANGE, ESP_AVRC_RN_RSP_CHANGED, &rn_param);

                rn_param.play_pos = 32000;
                esp_avrc_tg_send_rn_rsp(ESP_AVRC_RN_PLAY_POS_CHANGED, ESP_AVRC_RN_RSP_CHANGED, &rn_param);
none of these seem to get any attention by the MMI, although i registered all possible events using

Code: Select all

esp_avrc_tg_set_rn_evt_cap()

Who is online

Users browsing this forum: No registered users and 6 guests