about the difference timestamp of rtp header for avdtp betwwen android and ios

47 views
Skip to first unread message

Daniel Su

unread,
Aug 23, 2025, 12:03:47 AMAug 23
to btstack-dev
Hi  Matthias;

    For btstack-1.6.2(running on Raspberry pi), a2dp_sink_demo(and forwarding directly without decode and encode to remote headset(refer to a2dp_source_demo)), I find the timestamps of rtp header from avdtp packet  are quite different betwwen android and ios phone. 
    From the start with rtp sequence number 0(packet_1125 in attachement),  for android, the timestamp also 0, but for IOS , it's a huge number(packet_1104 in attachemnt ). Then I try to forward the packet (with sequence number and timestamp unchanged) to another a2dp sink headset (sbc configuration including bitpool range) .  With apple airpod, the music streams ok,
but with other brand headset,  totally no sound comes out,seems sbc frames not decoded.
    So should be the timestamp issue? confused aboout this. The timestamp should be counting up  according to samples of raw data in packet.


ios log
ios.jpg





android log
android.jpg

Daniel Su

unread,
Aug 23, 2025, 12:05:55 AMAug 23
to btsta...@googlegroups.com
forget to attach hci dump


Best
Daniel

Daniel Su <sueshe...@gmail.com> 于2025年8月23日周六 12:03写道:
--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/0e02cac1-91ca-477f-aaa5-876e49533211n%40googlegroups.com.
android.jpg
ios.jpg
hci_dump_a2dp_android.pklg
hci_dump_a2dp_ios.pklg

Matthias Ringwald

unread,
Aug 23, 2025, 7:28:57 AMAug 23
to btsta...@googlegroups.com
Hi Daniel

The RTP timestamp counts the number of samples, that’s correct. In the beginning, out examples did use the local time in milliseconds, which seemed to work with all devices expect the Apple Airpod Pro 2.

I would suggest to try different start setups with different headsets: seq nr = rtp timestamp = 0 or others and then overwrite these two metafieldscof the AVDTP Media packets when forwarding to use the working setup. 

Please let us know what you find out. 

Cheers,
Matthias

On 23 Aug 2025, at 06:06, Daniel Su <sueshe...@gmail.com> wrote:


forget to attach hci dump


Best
Daniel

Daniel Su <sueshe...@gmail.com> 于2025年8月23日周六 12:03写道:
Hi  Matthias;

    For btstack-1.6.2(running on Raspberry pi), a2dp_sink_demo(and forwarding directly without decode and encode to remote headset(refer to a2dp_source_demo)), I find the timestamps of rtp header from avdtp packet  are quite different betwwen android and ios phone. 
    From the start with rtp sequence number 0(packet_1125 in attachement),  for android, the timestamp also 0, but for IOS , it's a huge number(packet_1104 in attachemnt ). Then I try to forward the packet (with sequence number and timestamp unchanged) to another a2dp sink headset (sbc configuration including bitpool range) .  With apple airpod, the music streams ok,
but with other brand headset,  totally no sound comes out,seems sbc frames not decoded.
    So should be the timestamp issue? confused aboout this. The timestamp should be counting up  according to samples of raw data in packet.


ios log
<ios.jpg>






android log
<android.jpg>

--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/0e02cac1-91ca-477f-aaa5-876e49533211n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/CA%2ByU7WajmBxMjFZd46zhe32t6SkR00vR6YPck7C%3DjkYg8wACAQ%40mail.gmail.com.
<android.jpg>
<ios.jpg>
<hci_dump_a2dp_android.pklg>
<hci_dump_a2dp_ios.pklg>

Daniel Su

unread,
Aug 23, 2025, 8:44:34 AMAug 23
to btsta...@googlegroups.com
Hi Matthias,

    I have also tried dropping original timestamp from source(phone side) and rebuild it (from  num_frames,sub_bands,and blocks) before forawrding to sink.  This still works with both apple airpod and other brands headset with android phone as source. However, other brands headset still can not work with ios devices(iphone/ipad).  Only airpod works with apple phone/pad.  Ever considering it as  SCMS-T issue, but sink demo can decode sbc from ios and saved as wav file. So seems something mismatch... 


Best
Daniel

Matthias Ringwald <matthias...@gmail.com> 于2025年8月23日周六 19:28写道:

Daniel Su

unread,
Aug 23, 2025, 8:48:10 AMAug 23
to btsta...@googlegroups.com
Hi Matthias,

    Also,for the timestamp rebuilding, it counts from zero and counting up which is exactly the same with android phone mechanism(event the values are equal).

Best
Daniel

Daniel Su <sueshe...@gmail.com> 于2025年8月23日周六 20:44写道:

Matthias Ringwald

unread,
Aug 25, 2025, 3:30:56 AMAug 25
to btsta...@googlegroups.com
Hi Daniel

Which headsets (name/brand) don't work for you? You could check the product data base at Bluetooth SIG to see if they use the same Bluetooth SoC.
(Requires a free account).

As you're forwarding audio which doesn't work, I would suggest to verify that a2dp_source_demo works with these specific headsets.

Also: do they work with other sources:
- iOS
- Android
- Mac
- Windows
- BlueZ
?

Cheers
Matthias
> To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/CA%2ByU7Wa5rS0LNppqvET4xjPHBffZs2AhQ_9ogN20ph2W47nQSg%40mail.gmail.com.


Daniel Su

unread,
Aug 25, 2025, 5:33:50 AMAug 25
to btsta...@googlegroups.com
Hi  Matthias;

  Q: Which headsets (name/brand) don't work for you? You could check the product data base at Bluetooth SIG to see if they use the same Bluetooth SoC.
(Requires a free account).
  A:  I have test serval part no including Beosound A1 2nd Gen,SOUNDPEATS RunFree,JBL TUNE3. And also a qualcomm QCC3083 evk which I can build firmware by myself.
       They must use different Bluetooth SOCs.

 Q: As you're forwarding audio which doesn't work, I would suggest to verify that a2dp_source_demo works with these specific headsets.
 A: The issue is that  only iphone(ipad) as audio source and forwarding gets problem while android phones don't have.  And Iphone streaming directly to those headset have no problem(also sbc,not aac)

 Since i can build firmware for Qualcomm QCC3083 EVK, and I have configured its SBC codec caps the same with bridge one(sink&source combo). It also can works well with ios device directly.

 Finding more,  as sink&source combo, if sbc bitpool max value configured 27, then some of the headsets(or speaker) get music out althogh having a little noise.
        
  It seems that the headsets get information(like over Device information profile) of audio source(ios or android) and do some special handling (and information lost during forwarding)as i guess.

Cheers
Daniel

Matthias Ringwald <matthias...@gmail.com> 于2025年8月25日周一 15:30写道:

Matthias Ringwald

unread,
Aug 25, 2025, 6:22:07 AMAug 25
to btsta...@googlegroups.com
Hi Daniel

Thanks for the information and testing. I've checked the Bluetooth SIG database.

The Beosound A1 2nd Gen uses a Qualcomm QCC302x/3x or QCC512x, while the SOUNDPEATS RunFree and the JBL TUNE3 use Controller and Stack from Actions Semi.

Does a2d_source_demo does work with these (as they should)?

While this sounds tedious, you could mirror the Device Information as well when playing man-in-the-middle... :)


Cheers
Matthias


> On 25 Aug 2025, at 11:33, Daniel Su <sueshe...@gmail.com> wrote:
>
> Hi Matthias;
> To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/CA%2ByU7WZV0jpGaETWbDqLxjnumBk0Q%3DfbPT5VjD0UPhvgcTzw3g%40mail.gmail.com.

Daniel Su

unread,
Aug 25, 2025, 10:01:14 AM (14 days ago) Aug 25
to btsta...@googlegroups.com
Hi  Matthias;
      Yeah, tested with same sbc caps with "the combo" using a2dp_source_demo,  it streams well to Beosound A1 2nd Gen.  Will investigate operation between ios and such non-apple Bluetooth headset.
Cheers
Daniel

Matthias Ringwald <matthias...@gmail.com> 于2025年8月25日周一 18:22写道:
Reply all
Reply to author
Forward
0 new messages