<?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>receiver does not sync to audio after getting back in range</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117181/receiver-does-not-sync-to-audio-after-getting-back-in-range</link><description>Hello, 
 i am debugging issue in our device. I ported the nrf5340 Audio application to our custom board and modified it for our use. We use audio broadcast mode. 
 Device works but sometime the receiver does not re-connect after the transmitter out of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jan 2025 18:06:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117181/receiver-does-not-sync-to-audio-after-getting-back-in-range" /><item><title>RE: receiver does not sync to audio after getting back in range</title><link>https://devzone.nordicsemi.com/thread/517546?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 18:06:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6f1e56d-897f-495c-a162-9a18fc88855a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try to use the latest NCS v2.9.0 to get the improvement.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: receiver does not sync to audio after getting back in range</title><link>https://devzone.nordicsemi.com/thread/516881?ContentTypeID=1</link><pubDate>Sun, 05 Jan 2025 21:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48583360-95f9-483f-bd65-d0272f938687</guid><dc:creator>JeraDrson</dc:creator><description>&lt;p&gt;Ok, so after testing the solution was not correct. It did solve the original issue however sound had glitches and range&amp;nbsp;was worse so I had&amp;nbsp; to reenabled the scan restart by timeout.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So i am back at the beginning.&lt;/p&gt;
&lt;p&gt;To summarize:&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;&lt;span&gt;&lt;span&gt;LE_AUDIO_EVT_SYNC_LOST is handled in main short before&amp;nbsp;&lt;/span&gt;&lt;/span&gt;pa_sync_timer expires, the scanning can not be reenabled again.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:95px;max-width:428px;" height="95" src="https://devzone.nordicsemi.com/resized-image/__size/856x190/__key/communityserver-discussions-components-files/4/pastedimage1736105443087v2.png" width="428" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Compared to the original audio application there is one related change. I added custom advertisement. To be able to receive it I removed&amp;nbsp;&lt;span&gt;bt_le_scan_stop from&amp;nbsp;&lt;/span&gt;pa_synced_cb.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: receiver does not sync to audio after getting back in range</title><link>https://devzone.nordicsemi.com/thread/514615?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2024 21:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f89989f-0040-455c-b89a-898d3dfdbf90</guid><dc:creator>JeraDrson</dc:creator><description>&lt;p&gt;Thank you for the reply.&lt;/p&gt;
&lt;p&gt;I use 2.6.1.&lt;/p&gt;
&lt;p&gt;My current theory is that I needed to add custom advertisment and did not want to stop scanning when&amp;nbsp;&lt;span&gt;&lt;span&gt;pa_synced_cb happens. So&amp;nbsp;I commented the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;bt_le_scan_stop out from it. However the timeout restart pa_sync_timer is still running. Therefore when the sync is lost the scanning restart may come from the mechanism you described or from the &lt;span&gt;pa_sync_timeout and this may cause the problem.&lt;br /&gt;Does this make sense?&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I now tried to disable the&amp;nbsp;timer (with pa_sync_timeout)&amp;nbsp;entirely so the restart happens only after sync lost.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;It did not get stuck so far but it is too soon to know yet. Hope this does not cause another issues.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;with regards Jeronym&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: receiver does not sync to audio after getting back in range</title><link>https://devzone.nordicsemi.com/thread/514576?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2024 15:53:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ffc5e81-bb33-4c1b-9b07-d67c9fdf970b</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When a timeout happens (like we lost the gateway),&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The stream_stopped_cb() triggered, with reason &amp;quot;BT_HCI_ERR_CONN_TIMEOUT&amp;quot;&lt;/li&gt;
&lt;li&gt;Sending &amp;quot;LE_AUDIO_EVT_SYNC_LOST&amp;quot; event&lt;/li&gt;
&lt;li&gt;In &lt;span&gt;streamctrl_broadcast_sink.c, we catch LE_AUDIO_EVT_SYNC_LOST and delete PA sync&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Once if the PA sync terminated, the callback for PA sync terminated will be triggered, and BT_MGMT_PA_SYNC_LOST will be sent&lt;br /&gt; Which trigger the scanning automatically&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;According to &lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__system__errno.html"&gt;this page&lt;/a&gt;,&amp;nbsp;&lt;span&gt;The error code -120 returned by &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c#L68"&gt;this line&lt;/a&gt;&amp;nbsp;typically corresponds to EALREADY which means the&amp;nbsp;Operation is already in progress, but &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c#L57"&gt;this line&lt;/a&gt; should already stop scanning before it.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What NCS version are you using?&amp;nbsp;Do you modify the&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.8.0/applications/nrf5340_audio/src/bluetooth/bt_management/scanning/bt_mgmt_scan_for_broadcast.c#L53C13-L53C32"&gt;scan_restart_worker&lt;/a&gt; function?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: receiver does not sync to audio after getting back in range</title><link>https://devzone.nordicsemi.com/thread/514562?ContentTypeID=1</link><pubDate>Wed, 11 Dec 2024 14:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de25d684-f1d5-4c9d-b920-377887097919</guid><dc:creator>JeraDrson</dc:creator><description>&lt;p&gt;Update:&lt;br /&gt;I did more tests. Dependence on temperature and battery did not confirm.&lt;/p&gt;
&lt;p&gt;I now think it is now related to the scenario where&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;LE_AUDIO_EVT_SYNC_LOST is handled in main shortly before the Sync timeout showed in previous message.&lt;br /&gt;&lt;br /&gt;My understanding is that in original application the sync timeout was disabled after the first successful sync. However i needed to add custom data advertisement so i commented out the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;bt_le_scan_stop&lt;/span&gt;&lt;span&gt;&lt;span&gt;(); from&amp;nbsp;&lt;/span&gt;&lt;/span&gt;pa_synced_cb function so my data is passing through. This was in my previous ticket here&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/112267/bl-audio-multicast"&gt;BL Audio multicast&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>