Cannot maintain two connections for a 5340 running as Peripheral and Central

I am running the 5340 audio example on three dev kits. My goal is to have the gateway to act as a peripheral and a central so that the device can connect to the two headphones and so that a remote phone can connect to it so that it can control the gateway.

  • Phone connection
  • NRF5340 Gateway
    • NRF5340 Headphone L
    • NRF5340 Headphone R

I modified the gateway code so that advertises similarly to the headphone code, but checks the role connections/disconnections on whether it is a PERIPHERAL or CENTRAL. I can get it to connect as a peripheral and can get it to connect as central but not simultaneously. I read through Zephyr and Bluetooth specification and it says that it is possible, but my device keeps kicking off my phone connection:

The Link Layer state machine allows only one state to be active at a time. The
Link Layer shall have at least one Link Layer state machine that supports one
of Advertising state or Scanning state. The Link Layer may have multiple
instances of the Link Layer state machine.

My main questions are: 

  1. How do I prevent them from kicking it off? Do I need to make a separate thread?
  2. For media or remote control for the phone, where should I look? is it MCS/MPS examples?
Parents
  • Hello again,

    Thank you for your patience.

    1. We have one sample which demonstrates concurrent peripheral and central roles. It is called Central and Peripheral HRS and the documentation is found here.
      There may be some restrictions for the dedicated audio controller, but I need to check this. I will let you know early next week.
    2. I need to check this as well.

    Sorry for giving you few answers. I wish you a nice weekend.

    Best Regards,
    Maria

  • Hi Maria! 

    Thanks for your response. 

    I had previously been using that example to model using both peripheral and central. I am able to run as peripheral and central currently, but whenever I am connected to both it seems the audio stream kicks in there is a stack of calls that forces out any current connections in conn.c. 

            - bt_audio_stream_start()
            - bt_unicast_client_start()
            - bt_audio_stream_connect()
            - bt_conn_set_state(iso_chan->iso, BT_CONN_CONNECTING);



    I tried running it similarly to the Central / Peripheral HR example and recently gave each it's own thread however they still fight as if they are using the same connection. The Bluetooth LE specifications say: 

    "An instance of the state machine may only be in one state at a time. A link layer implementation may
    support more than one state machine instance concurrently."

    Could you advise how to add another state machine? Or if this is possible with the Zephyr?

    Thank you for your help!!

Reply
  • Hi Maria! 

    Thanks for your response. 

    I had previously been using that example to model using both peripheral and central. I am able to run as peripheral and central currently, but whenever I am connected to both it seems the audio stream kicks in there is a stack of calls that forces out any current connections in conn.c. 

            - bt_audio_stream_start()
            - bt_unicast_client_start()
            - bt_audio_stream_connect()
            - bt_conn_set_state(iso_chan->iso, BT_CONN_CONNECTING);



    I tried running it similarly to the Central / Peripheral HR example and recently gave each it's own thread however they still fight as if they are using the same connection. The Bluetooth LE specifications say: 

    "An instance of the state machine may only be in one state at a time. A link layer implementation may
    support more than one state machine instance concurrently."

    Could you advise how to add another state machine? Or if this is possible with the Zephyr?

    Thank you for your help!!

Children
  • Hello,

    Maria Gilje said:
    There may be some restrictions for the dedicated audio controller, but I need to check this. I will let you know early next week.

    The dedicated audio controller supports a maximum of two ACL links. So the gateway would only be able to connect to one of the headphones when also connected to the phone. To ensure that the gateway is able to connect to the phone and one headset, make sure that CONFIG_BT_MAX_CONN=2. This is the default value when building nRF5340 Audio for the gateway.

    Have you made your own proj.conf or Kconfig files or modified the ones from the application?

    ernieforzano said:
    For media or remote control for the phone, where should I look? is it MCS/MPS examples?

    The Bluetooth Media API is used in nRF5340 Audio in src/bluetooth/ble_audio_services.c. I did not find other samples in nRF Connect SDK where it is used.

    You may be able to use the Zephyr controller instead of the dedicated audio controller from nRF5340 Audio. To switch to the Zephyr controller, include CONFIG_BT_LL_SW_SPLIT in the prj.conf for hci_rpmsg and include hci_rpmsg as a child image for your audio application. To my knowledge the Zephyr controller is not limited to two ACL so now you can increase the maximum connections.

    Best Regards,
    Maria

  • Hi Maria!

    Unfortunately, we have a requirement for utilizing a gateway connecting to the phone and the headphones. There is still something in the BLE connection logic that forces out other connections when the headphones get connected.


    We are willing to do only one phone connection and one headphone if necessary. We have started exploring using the gateway to connect to the phone as a peripheral as well. Our suspicion is a few Bluetooth settings compiled on the binary on the network core. 

    If there is some documentation you can point us too or if someone would, we would love to jump on a call.


    Thanks, 
    Ernie

  • Hello,

    Pardon the delay. I was out of office for a few days.

    ernieforzano said:

    Unfortunately, we have a requirement for utilizing a gateway connecting to the phone and the headphones. There is still something in the BLE connection logic that forces out other connections when the headphones get connected.

    Can you please share the log when the connection fails? Performing a sniffer trace with a professional packet sniffer (i.e. Ellisys) could also help to shed light on what goes wrong.

    If you don't want to share a log on a public ticket, I can make it private. Just let me know.

    ernieforzano said:

    We are willing to do only one phone connection and one headphone if necessary. We have started exploring using the gateway to connect to the phone as a peripheral as well. Our suspicion is a few Bluetooth settings compiled on the binary on the network core. 

    I understand that the limitations in the current state of the application are restrictive. The LE Audio features available in our SDK now is experimental, and they are expected to change and expand in the future. You can look at the current supported features in the Feature support matrix in the intro of the documentation for the nRF5340 Audio application.

    ernieforzano said:
    If there is some documentation you can point us too or if someone would, we would love to jump on a call.

    Are you referring to the documentation for the LE Audio Controller?

    We generally don't provide phone support, but I will ask my manager about our options.

    Edit: I have spoken to my manager. We don't take calls. A Regional Sales Director will contact you soon.

    Best Regards,
    Maria

Related