LE Audio timeout behaviour (0x08) interfacing with third party devices.

Hi, I'm currently developing a device that acts as an LE Audio client. Everything works as expected when interfacing with an LE Audio server counterpart on a 5340 Audio DK, also using the Zephyr BLE Audio API.

However I recently attempted to interface my client with a third party pair of LE Audio headphones, specifically the Earfun Air Pro 3s, and upon enabling the streams (bt_audio_stream_enable) the device receives no response callback and supposedly hits the supervisory timeout (disconnect reason 0x08.) At first I suspected this may be an issue with the headphones, and I haven't ruled out this possibility.

But then I decided to test the nrF5340 audio application (unmodified) with the Android LE Audio framework in the developer settings, which seems to work decently well with the Earfun Air Pro 3s. I found that the 5340 headset application was successfully receiving and playing back the stream for 4s, but then receives a timeout event and immediately stops playing. 

There's a chance these are unrelated issues but seeing as they both involve supervision timeouts, there's the possibility something is not being handled correctly on the 5340? Can something about the LE Audio framework cause it to stop sending packets to the peer device? Has the audio application been tested with any third party devices?

I have tried changing the clock source with:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y
As I heard this has been related to other timeout issues, but that doesn't seem to be the cause here as it has no effect.

Log from headset:

HL [00:01:04.268,341] <inf> cis_headset: Connected: 0C:C4:13:2F:AD:44 (public)
HL [00:01:09.610,137] <inf> ble_audio_services: Volume = 10, mute state = 0
HL [00:08:10.497,955] <dbg> bt_audio_stream: bt_audio_stream_attach: conn 0x20002db8 stream 0x2000a728 ep 0x2000ba34 codec 0x2000ba44
HL [00:08:10.587,951] <dbg> bt_audio_stream: bt_audio_stream_iso_listen: stream 0x2000a728 conn 0x20002db8
HL [00:08:10.683,288] <wrn> audio_datapath: I2S RX continuing stream
HL [00:08:10.691,284] <wrn> audio_datapath: I2S RX overrun. Single msg
HL [00:08:10.704,315] <inf> audio_datapath: Drft comp state: INIT
HL [00:08:11.243,072] <dbg> bt_audio_stream: bt_audio_stream_iso_accept: acl 0x20002db8
HL [00:08:11.243,072] <dbg> bt_audio_stream: bt_audio_stream_iso_accept: iso_chan 0x2000bb20
HL [00:08:11.440,124] <inf> audio_datapath: Drft comp state: CALIB
HL [00:08:11.441,101] <wrn> audio_datapath: Data received, total underruns: 755
HL [00:08:11.492,218] <wrn> audio_datapath: Data received, total underruns: 756
HL [00:08:11.540,344] <inf> audio_datapath: Drft comp state: OFFSET
HL [00:08:12.021,820] <inf> audio_datapath: Drft comp state: LOCKED
HL [00:08:12.029,510] <inf> audio_datapath: Pres comp state: MEAS
HL [00:08:12.139,495] <inf> audio_datapath: Pres comp state: WAIT
HL [00:08:12.239,501] <inf> audio_datapath: Pres comp state: INIT
HL [00:08:12.249,511] <inf> audio_datapath: Pres comp state: MEAS
HL [00:08:12.359,497] <inf> audio_datapath: Pres comp state: LOCKED
HL [00:08:16.800,872] <inf> cis_headset: Stream stopped
HL [00:08:16.800,903] <dbg> bt_audio_stream: bt_audio_stream_iso_listen: stream 0x2000a728 conn 0x20002db8
HL [00:08:16.801,727] <inf> cis_headset: Disconnected: 0C:C4:13:2F:AD:44 (public) (reason 0x08)
HL [00:08:16.802,673] <inf> cis_headset: Direct advertising to 0C:C4:13:2F:AD:44 (public) started

  • Hello,

    After discussion internally I learned that the gateway at the moment is not very flexible, so you would likely need to match the sample rate, bitrate and presentation delay of the Earfun Air Pro 3. An application log from the nRF5340 gatway may help to see how gateway negotiates with Earfun Air Pro 3.

    The team is currently working on making the gateway more dynamic, so moving forward you can expect that the gateway will automatically apply whatever the headset is supporting (in other words avoid this manual configuration described above).

    Best regards,
    Kenneth

  • Hi Kenneth, 

    Thanks for your response. I believe I am currently matching the audio parameters supported by the Earfun Air Pro 3. 

    The only change needed from the default configuration of the gateway demo to match the PACs of these headphones is increasing the presentation delay to 25000 from 10000 us. Everything else can remain the same and matches the Earfun Air Pro 3, although I have also tried with other supported audio parameters.

    My problem isn't an error response with the LE Audio interface, it's a generic BLE timeout when issuing the 'enable' command for a stream, after successfully configuring it.

    So I think the issue has to either be a general Bluetooth connectivity problem, such as the one that caused the timeouts with Android in a previous SDK version (when the device was acting as a headset,) or an assert within these headphones, although as mentioned the Earfuns do work with Android.

    If I knew that the 5340 acting as an audio gateway was able to successfully enable a stream to another off-the-shelf peripheral, that would narrow down the problem to these headphones and I could just purchase that off-the-shelf product if it's out.

    I understand that testing and building compatibility takes time but is there a possibility of receiving info on test results with available off-the-shelf products in the near future? Especially as more become publically available for testing outside UPF.

    Thanks

    Kieran

  • Hello, I received feedback from one in the gruop working with audio, adding it here:

    1. The user tests our headset with Pixel 7 and found the Pixel 7 disconnected after stream start couple seconds later.

    This is a known issue, probably because the Pixel 7 sends a connection parameter request for using 40ms ACL interval, which audio controller is not happy and out of response. From my side I can see that Pixel will try to reconnect the headset again in the latest AOSP Android, and then stream can recover, since Pixel will try to use different connection parameters.

    There might be a quick workaround is that we add connection parameter request callback, return false if interval_min/max is 0x40. But this is something we will check with the audio controller developers.

    It seems during the handshaking, headset will expose the minimal/maximum presentation delay, Pixel chooses the minimal one, but it cannot handle it properly, so glitch happens. We have a PR in the later for telling the Phone uses a higher number.

    2. For the case when nRF5340 gateway connects with Earfun, I would assume Earfun refuse the QoS setting from our gateway. I will check if we can low down the log level to see more details. It is hard to figure out where is the issue (central or peripheral). A sniffer log from Ellisys would provide great help.

    Kenneth

  • One question that may help the developers with the debugging: Can you connect to the earbuds with the nRFConnect phone app and see whether there are any LE Audio services there?

    Thanks,
    Kenneth

  • Hi Kenneth, 

    Thanks for your response,

    I have noticed the connection interval seems very critical to LE Audio connections with the 5340, but I haven't found any documentation on what exactly is the appropriate value based on the parameters involved. Why does the audio controller not like 40ms for example? 

    I have connected to the headphones via the nRF Connect app and they have Published Audio Capability Service (PACS,) Audio Stream Control Service (ASCS,) Volume Control Service (VCS). I had decoded the PACs on the device (see attached) to check that the parameters I was configuring the stream with were valid.

    06-00-00-00-00 | 13 | 03-01-80-00 | 02-02-13 | 02-03-01 | 05-04-4B-00-64-00 | 02-05-02 | 04 | 03-01-08-00
    
    LC3 Codec
    Data (len 0x13):
    	-Supported Frequencies: 48000
    	-Frame Duration: Supported 7.5 & 10, Preferred 7.5
    	-Channel Count: 1
    	-Octets per codec frame: Min = 75, Max = 100
    	-Max frames per SDU: 2
    
    Meta (len 0x04):
    	-Preferred Audio Contexts: Game
    -------------------------------------------------------------------------------------------------------------
    06-00-00-00-00 | 13 | 03-01-34-00 | 02-02-23 | 02-03-01 | 05-04-28-00-50-00 | 02-05-02 | 04 | 03-01-42-00
    
    LC3 Codec
    Data (len 0x13):
    	-Supported Frequencies: 16000, 24000, 32000
    	-Frame Duration: Supported 7.5 & 10, Preferred 10
    	-Channel Count: 1
    	-Octets per codec frame: Min = 40, Max = 80
    	-Max frames per SDU: 2
    
    Meta (len 0x04):
    	-Preferred Audio Contexts: Conversational, Live
    -------------------------------------------------------------------------------------------------------------
    06-00-00-00-00 | 13 | 03-01-B4-00 | 02-02-23 | 02-03-01 | 05-04-1E-00-9B-00 | 02-05-02 | 04 | 03-01-04-00
    LC3 Codec
    Data (len 0x13):
    	-Supported Frequencies: 16000, 24000, 32000, 48000
    	-Frame Duration: Supported 7.5 & 10, Preferred 10
    	-Channel Count: 1
    	-Octets per codec frame: Min = 30, Max = 155
    	-Max frames per SDU: 2
    
    Meta (len 0x04):
    	-Preferred Audio Contexts: Media
    --------------------------------------------------------------------------------------------------------------
    
    
    

    For QoS the only change I made was to increase the presentation delay to 30000us as the headphones were giving response notifications via the LE Audio service when providing the lower default values. With these changes the configure QoS command appears to give a successful completion callback with no warnings.

    I will look into getting a sniffer log. The way the headphones are behaving during the error looks like it's the headphone that is asserting. It clearly seems to hard-reset before the 5340 detects a timeout. It's just unusual because they work with Android so there must be something different about the connection with the 5340 that it doesn't like.

Related