You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing with LE Audio broadcast sinks and sources and I stumbled upon following issue. pa_sync_lost callback from bt_audio_broadcast_sink_cb gets one input argument - pointer to bt_audio_broadcast_sink structure called sink. When PA sync is lost and pa_sync_lost is called, all members of sink are zeros inside of this callback. One of the consequences is, that it's not possible to use sink->broadcast_id to determine to which source the lost PA belonged.
The reason all members of sink are zeroed lies in subsys/bluetooth/audio/broadcast_sink.c, in fuction:
As we can see, broadcast_sink_cleanup(sink), that memsets all sink members to zero, is called before the pa_sync_lost callbacks.
What is the reason to call broadcast_sink_cleanup(sink) first? Is it so that the pa_sync_lost callbacks don't get pointers to elements that are no longer valid because the PA was lost already? Or would it be safe to call the cleanup after the callbacks? In my opinion, there should be either an update to pa_sync_lost documentation notifying about this behaviour, or change of the code that would move the callback further down. Either way, I'm more then willing to prepare a PR. But before I do that, I just wanted to make sure I'm not missing anything.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello All,
I'm playing with LE Audio broadcast sinks and sources and I stumbled upon following issue.
pa_sync_lost
callback frombt_audio_broadcast_sink_cb
gets one input argument - pointer tobt_audio_broadcast_sink
structure calledsink
. When PA sync is lost andpa_sync_lost
is called, all members ofsink
are zeros inside of this callback. One of the consequences is, that it's not possible to usesink->broadcast_id
to determine to which source the lost PA belonged.The reason all members of
sink
are zeroed lies insubsys/bluetooth/audio/broadcast_sink.c
, in fuction:As we can see,
broadcast_sink_cleanup(sink)
, that memsets all sink members to zero, is called before thepa_sync_lost
callbacks.What is the reason to call
broadcast_sink_cleanup(sink)
first? Is it so that thepa_sync_lost
callbacks don't get pointers to elements that are no longer valid because the PA was lost already? Or would it be safe to call the cleanup after the callbacks? In my opinion, there should be either an update topa_sync_lost
documentation notifying about this behaviour, or change of the code that would move the callback further down. Either way, I'm more then willing to prepare a PR. But before I do that, I just wanted to make sure I'm not missing anything.Thanks,
Ladivin
Beta Was this translation helpful? Give feedback.
All reactions