SCO data callback in 20706

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LJYe_2922526
Level 5
Level 5
25 likes received 10 likes received 5 likes given

Hi,

We are routing audio data(SCO) to the app using setup as follows:

wiced_bt_voice_path_setup_t stBlAudioPathSetup =

{

    .path = WICED_BT_SCO_OVER_APP_CB,

    .p_sco_data_cb = BlAudioHandleSCOData,

};

What I'm noticing is the sco data callback is not called at the expected frequency at the beginning of an audio session. To be exact, I'm expecting 16-bit audio data at 8kHz sample rate, equating to 16000 bytesper second. According to my log below, in the first second I got 13900 bytes, in the second second I got 14700 bytes, and only until the 4th second I got the expected 16000 bytes.

Debug log from my custom app:

[1]Audio byte rate:13900

[2]Audio byte rate:14700

[3]Audio byte rate:15600

[4]Audio byte rate:16000

[5]Audio byte rate:16000

My questions:

1) What can cause the low data rate described above at the beginning of an audio session?

2) What triggers the sco data callback? I seem to remember at some point I get 120 bytes per callback, but now I'm only getting 100 bytes per callback. Is this amount configurable?

Thanks!

0 Likes
1 Solution
Anonymous
Not applicable

Is this with your custom application or have you just modified the example? Also how are you measuring the byte rate?

1) My guess would be that there are some packet losses initially because of which you have lesser byte rate initially. Do you see any change in the sco parameters after 1 or 2 seconds?

2) Once you configure path as app, the callback is called once the internal buffer reaches a watermark level. The watermark is actually set to 60 samples or 120 bytes. This cannot be changed, it's strange that you are receiving only 100 bytes.

View solution in original post

6 Replies
Anonymous
Not applicable

Is this with your custom application or have you just modified the example? Also how are you measuring the byte rate?

1) My guess would be that there are some packet losses initially because of which you have lesser byte rate initially. Do you see any change in the sco parameters after 1 or 2 seconds?

2) Once you configure path as app, the callback is called once the internal buffer reaches a watermark level. The watermark is actually set to 60 samples or 120 bytes. This cannot be changed, it's strange that you are receiving only 100 bytes.

It's a custom application. I added up the data length in the sco callback and set up a periodic seconds timer to print the sum of bytes received in the second.

After the first 2-3 seconds the data rate is steady at the expected 16kB per second. Is there any way I can trace or confirm the packet loss theory? Is this data loss caused by the stack or the remote headset I'm connected to?

I'll run the app again to confirm about the 100 byte callback behavior.

0 Likes

Previously I was using WICED Studio SDK 6.0. I just tried 6.1, and the SCO data call back (wiced_bt_sco_data_cb_t) now gives me 60 bytes... and with that audio stops working and gives me a ringing noise.

Did anything change in 6.1 around SCO?

0 Likes
Anonymous
Not applicable

I just tested it on WICED 6.1, didn't find any issues with the default app. I disabled WBS and routed the data to the callback and was able to receive 120 bytes of data as expected.

Is this the AG sample app in 6.1?

0 Likes
Anonymous
Not applicable

Yes I have tested with the hci_audio_gateway example in WICED 6.1. Attached is the debug logs. I receive 120 bytes as expected.

pastedImage_0.png