Checking for active connection on nrf5340_audio project

Hi,

We're about to make a bunch more of our custom boards based on the nrf5340_audio_dk platform (modified with a stereo codec and some other stuff) with a modified version of the nrf5340_audio project firmware.

We're getting reports that sometimes the prototypes disconnect from the Auracast stream and don't reconnect. To troubleshoot this I'd like to set an LED when we're connected and clock synced with an active I2S stream where we would expect audio to be flowing.

What's the best way to check for this condition? If audio isn't flowing when we expect it to, is there a way to try to reconnect, or is it smarter to just reboot the board periodically?

We're currently using SDK 2.9.1.  

Thanks,

Glen

Parents
  • Hi

    So in the nRF5340 Audio Auracast (BIS) mode there isn’t a single connected state, instead the sink synchronizes to a broadcast and then starts streaming. Basically the audio is expected to flow when synchronization and the audio pipeline are active, so in your case the possible way to get the indication you describe is to reuse the LED states already mentioned in nRF5340 Audio application:

    • LED1 blinking blue on the broadcast sink means the device has started streaming audio.
    • LED2 solid green means both drift and presentation compensation are in the LOCKED state (the audio clock is locked and presentation timing is synchronized).

    On your custom board you can drive a dedicated LED from the same internal flags that control LED1 and LED2. That can give you a reliable “broadcast stream active & sync locked” indication without touching the I2S layer. If you want an extra safeguard, you can also add your own watchdog that tracks when audio frames were last received and clears the LED if there’s no activity for a timeout.

    And regarding recovery if the stream is lost (or your watchdog times out), you may tear down the current broadcast sync and try to resynchronize first and keep a full reboot as a last option if resynchronization fails. I hope it helps.

    Kind Regards,
    Syed Maysum

Reply
  • Hi

    So in the nRF5340 Audio Auracast (BIS) mode there isn’t a single connected state, instead the sink synchronizes to a broadcast and then starts streaming. Basically the audio is expected to flow when synchronization and the audio pipeline are active, so in your case the possible way to get the indication you describe is to reuse the LED states already mentioned in nRF5340 Audio application:

    • LED1 blinking blue on the broadcast sink means the device has started streaming audio.
    • LED2 solid green means both drift and presentation compensation are in the LOCKED state (the audio clock is locked and presentation timing is synchronized).

    On your custom board you can drive a dedicated LED from the same internal flags that control LED1 and LED2. That can give you a reliable “broadcast stream active & sync locked” indication without touching the I2S layer. If you want an extra safeguard, you can also add your own watchdog that tracks when audio frames were last received and clears the LED if there’s no activity for a timeout.

    And regarding recovery if the stream is lost (or your watchdog times out), you may tear down the current broadcast sync and try to resynchronize first and keep a full reboot as a last option if resynchronization fails. I hope it helps.

    Kind Regards,
    Syed Maysum

Children
No Data
Related