LE Audio device as central and peripheral simultaneously

My question is related to LE Audio, i guess, since i have no previous experience from it. Is it possible to have a device as a peripheral for mobile phone sending data to some characteristics and same time as a central to another nRF5340 streaming LE Audio (CIS)?

Device A and B are nRF5340. Device A generating and streaming audio to device B. Audio stream could be e.g. a mic(s) or line(s) in. There is no audio stream from device A to mobile phone. Also device A is generating and sending data to a mobile phone. Data could be e.g. temp, status, voltage etc.

I'm just wondering for example how much resources this LE Audio (CIS) takes.

Parents
  • Hello,

    i guess, since i have no previous experience from it.

    Thank you for clarifying, this is very helpful for us to know when answering the remaining questions! :) 

    Is it possible to have a device as a peripheral for mobile phone sending data to some characteristics and same time as a central to another nRF5340 streaming LE Audio (CIS)?

    Yes, that is indeed possible - the 'ACL' which runs alongside the CIS to control the stream is actually nothing more than a regular BLE connection as you already know it.
    There is currently a limitation of concurrently supporting 2 ISO + 2 ACLs, but so long as you are within this you should be fine. Essentially, you may indeed act as a gateway to another nRF5340 Headset device, and concurrently work as a peripheral to a connected smartphone (regular BLE connection).

    I'm just wondering for example how much resources this LE Audio (CIS) takes.

    The largest swath of resources are used for the LC3 encoding, and the rule of thumb there is that it will consume roughly ~30% CPU to encode a 96 kbps stream, and ~16% to decode the same stream.

    Please do not hesitate to ask if you should have any follow-up questions to this! :) 

    Best regards,
    Karl

  • How would one go on about creating this kind of firmware?

    I am planning on buying few nRF5340 Audio DK's to first play around with the Connect SDK's LE Audio examples. I know there is in the Connect SDK a Central and Peripheral HRS -example and a nRF5340 Audio Application. Could this functionality be achieved by the help of these examples or is there some compatibility issues?

    Thank you!

  • Hello,

    This approach that you detail is the best one - first familiarizing with the nRF5340 LE Audio reference application, and then merging in the 'regular BLE' functionality that you require.
    Please keep in mind that you in the stereo CIS case already have 2x ISO and 2x ACLs implemented, and so you would just need to add the BLE functionality that you need to the existing ACLs.

    You can see an example of how quickly/easily additional services can be added to the nRF5340 Audio reference application here.

    Please do not hesitate at all to ask additional questions once you start looking into this yourself in the case that you should run into any issues or questions! :) 

    Best regards,
    Karl

Reply Children
  • [I am goijng to piggy-back a question onto this thread, as we are looking to do something similar]

    If I were to modify the audio example to allow the gateway to act as a peripheral BLE device, would I need to remove one of the existing ACL's (e.g., remove the L or R channel) so that the ACL could be used for my peripheral connection, or is there a way to use one of the existing ACL's to work for BOTH the audio/gateway connection AND the peripheral connection?

    Thanks

  • Hello,

    You are correct that you will have to remove one of the existing ACLs if you wish to use it for another connection, in order to stay within the LE Audio controllers limits for concurrent connections (2 ACL + 2 ISO), since 1 CIS uses both an ACL and an ISO.

    If you have questions about roadmaps or future releases I must ask that you contact your Regional Sales Manager about these, since we do not discuss roadmaps and future releases here on DevZone.

    Best regards,
    Karl

  • Ok, I tried modifying the audio sample (gateway) to only connect to a single headset and added the NUS service similar to the example referenced above. I can connect to the device using NRFConnect application, but no services or characteristics appear on the NrfConnect app. Any idea what I might be doing wrong?

    Update: I found that if I temporarily remove the call to ble_mcs_server_init() in the audio sample code, then my services will appear. Perhaps there is a conflict with the gatt_register_services done by mcs and other gatt services?

  • Hello,

    Could you share some details on what changes you made to the application to add the NUS service, and how it is behaving following these changes?
    Do you get any unexpected logs, or are there logs you would expect to see that are missing, etc?

    Best regards,
    Karl

  • I don't know if you saw my update, but I tracked down the issue to the audio sample calling ble_mcs_server_init(). If I set CONFIG_BT_MCS=n then my services/attributes show up normally.

Related