<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf5340 audio broadcast sink sync fail when connecting with app through BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/129533/nrf5340-audio-broadcast-sink-sync-fail-when-connecting-with-app-through-ble</link><description>Hello, 
 I&amp;#39;m using an NRF5340 audio broadcast sink, and the nRF Connect SDK version is v3.4.0. 
 I&amp;#39;ve added ble connection related definitions to the code to allow the mobile app to connect to the NRF5340 audio broadcast sink via BLE. 
 
 During testing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Nov 2026 01:32:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/129533/nrf5340-audio-broadcast-sink-sync-fail-when-connecting-with-app-through-ble" /><item><title>RE: nrf5340 audio broadcast sink sync fail when connecting with app through BLE</title><link>https://devzone.nordicsemi.com/thread/572856?ContentTypeID=1</link><pubDate>Wed, 04 Nov 2026 01:32:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e426bf11-94d1-407c-b2ae-4e10fa32c1f5</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Thanks for your assistance. This method works.&lt;/p&gt;
&lt;p&gt;Now I can connect to the app via BLE and sync the source simultaneously, regardless of the order.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 audio broadcast sink sync fail when connecting with app through BLE</title><link>https://devzone.nordicsemi.com/thread/572827?ContentTypeID=1</link><pubDate>Tue, 03 Nov 2026 10:42:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1a435aa-c286-4a48-94e6-fc320cdc12fe</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Update: I discussed this with one of the developers who confirmed that this is a bug. It was fixed by&amp;nbsp;&lt;span data-teams="true"&gt;&lt;a id="menur10656" class="fui-Link ___1q1shib f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv fk6fouc fjoy568 figsok6 f1s184ao f1mk8lai fnbmjn9 f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a f1h8hb77 f1lqvz6u f10aw75t fsle3fq f17ae5zn" title="https://github.com/zephyrproject-rtos/zephyr/pull/106981" href="https://github.com/zephyrproject-rtos/zephyr/pull/106981" rel="noopener noreferrer" target="_blank"&gt;Bluetooth: BAP: SD: Notify only bonded devices on reconnect by Thalley &amp;middot; Pull Request #106981 &amp;middot; zeph&amp;hellip;&lt;/a&gt;. Unfortunately,&amp;nbsp;it has not been back ported to nRF Connect SDK v3.4.x, but they will look into doing that.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span data-teams="true"&gt;In the meantime you may consider one of the&amp;nbsp;following workarounds proposed by the developer:&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;The suggested workaround in the devzone ticket&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;pre class="language-c" style="padding-left:30px;"&gt;&lt;em&gt;&lt;code&gt;&amp;nbsp;&lt;span class="hljs-keyword"&gt;if&lt;/span&gt;&amp;nbsp;(internal_state-&amp;gt;attr&amp;nbsp;==&amp;nbsp;NULL)&amp;nbsp;{&lt;br /&gt;  &lt;span class="hljs-keyword"&gt;return&lt;/span&gt;;&lt;br /&gt; }&lt;/code&gt;&lt;/em&gt;&lt;/pre&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;Is the simplest solution for the specific issue (i.e. &lt;code&gt;set_receive_state_changed_cb&lt;/code&gt; could be called before &lt;code&gt;bt_bap_scan_delegator_register&lt;/code&gt;.&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;Alternative solutions would be to call &lt;code&gt;bt_bap_scan_delegator_register&lt;/code&gt; before establishing any connections (which is also idea to do so that new connections can actually discover the service).&amp;nbsp;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 audio broadcast sink sync fail when connecting with app through BLE</title><link>https://devzone.nordicsemi.com/thread/572822?ContentTypeID=1</link><pubDate>Tue, 03 Nov 2026 09:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208eafee-ea38-468b-94bd-11eb12e4ca9e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks, knowing that the call is made from set_receive_state_changed_cb() helps narrow down the problem. I will check with the developers who are more familiar with this codebase to get their thoughts. In the meantime, you could try skipping notifications when the attr pointer is NULL.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void set_receive_state_changed_cb(struct bt_conn *conn, void *data)
{
	struct bass_recv_state_internal *internal_state = data;
	struct bass_recv_state_flags *flags = &amp;amp;internal_state-&amp;gt;flags[bt_conn_index(conn)];
	struct bt_conn_info conn_info;
	int err;
	
	if (internal_state-&amp;gt;attr == NULL) {
		return;
	}
	...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 audio broadcast sink sync fail when connecting with app through BLE</title><link>https://devzone.nordicsemi.com/thread/572816?ContentTypeID=1</link><pubDate>Tue, 03 Nov 2026 03:25:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e0c52da-0509-429a-a2f3-cad57b01378b</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;ve added `CONFIG_BT_MAX_CONN` to both `prj.conf` and `overlay-broadcast_sink.conf`. Without connecting to the app via BLE, the broadcast sink can sync with the broadcast source, and after synchronization, it can connect to the app via BLE. However, if it connects to the app via BLE first, it still cannot synchronize with the broadcast source.&lt;/p&gt;
&lt;p&gt;In short, currently, synchronizing with the broadcast source first and then connecting to the app via BLE succeeds, but connecting to the app via BLE first and then synchronizing with the broadcast source causes problems.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/129533/nrf5340-audio-broadcast-sink-sync-fail-when-connecting-with-app-through-ble/572789"]where&amp;nbsp;bt_gatt_is_subscribed() is being called from, do you know?[/quote]
&lt;p&gt;`bt_gatt_is_subscribed` is called from `set_receive_state_changed_cb` in bap_scan_delegator.c.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/129533/nrf5340-audio-broadcast-sink-sync-fail-when-connecting-with-app-through-ble/572789"]Also, do you get the same error if you keep&amp;nbsp;CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION enabled?[/quote]
&lt;p&gt;If `CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION` is enabled, BLE read/write operations after connecting to the app via BLE will have problems, so I&amp;#39;m not considering enabling it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 audio broadcast sink sync fail when connecting with app through BLE</title><link>https://devzone.nordicsemi.com/thread/572789?ContentTypeID=1</link><pubDate>Mon, 02 Nov 2026 11:54:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd75c3f1-906f-4c9a-8b15-ad58781efa9b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The log shows that the assert is raised here because the &amp;quot;attr&amp;quot; pointer is NULL:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/bf801e4e3d19e1ffa76164346480cb7734dd2800/subsys/bluetooth/host/gatt.c#L3343"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/bf801e4e3d19e1ffa76164346480cb7734dd2800/subsys/bluetooth/host/gatt.c#L3343&lt;/a&gt;&amp;nbsp;but it&amp;nbsp;doesn&amp;#39;t show where&amp;nbsp;bt_gatt_is_subscribed() is being called from, do you know? Also, do you get the same error if you keep&amp;nbsp;CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION enabled?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>