[pulseaudio-discuss] Extra A2DP codecs support in bluetooth module
ValdikSS
iam at valdikss.org.ru
Mon Jul 30 07:24:10 UTC 2018
On 30.07.2018 10:17, Pali Rohár wrote:
> On Monday 30 July 2018 06:30:14 valdikss wrote:
>> On 22.07.2018 14:37, Pali Rohár wrote:
>>
>>> Information which I have about FastStream: It is just SBC codec with
>>> following parameters: frequency rate 44.1 kHz or 48.0 kHz, Blocks 16,
>>> Sub-bands 8, Joint Stereo, Loudness and Bitpool = 29. So data rate = 212
>>> kbps, packet size = 72*3+4 = 220 = DM5 and that DSP decoders round 71
>>> bytes frames to 72 bytes. So I'm not sure how "low latency" it is.
>>> Normal SBC codec allows you to specify all those parameters. But
>>> FastStream has one additional feature: it supports backchannel for
>>> voice, so you do not have to switch between HFP/HSP and A2DP once you
>>> have incoming voice call. You can always use just A2DP with FastStream.
>>>
>>> Pulseaudio for SBC codec choose those parameters: Joint Stereo, Block
>>> 16, Sub-bands 8, Loudness. Frequency and bitpool depends on pulseaudio
>>> source. If bluetooth device does not support those parameters,
>>> pulseaudio lower values. So for me it looks like that FastStream matches
>>> default SBC pulseaudio configuration.
>>>
>>> Backchannel in FastStream for microphone voice again uses SBC codec with
>>> parameters: 16 KHz frequency rate, Blocks 16, Sub-bands 8, Loudness,
>>> Bitpool 32. So data rate = 72 kbps, packet size = 3*72 + 4 = 220 <= DM5.
>>> Which should be much better then CVSD codec at 8 kHz used in HFP/HSP.
>>> But is there really difference for voice data which comes from
>>> (probably poor) microphone integrated in headsets?
>>>
>>>> handful of Creative headsets that don't seem to support any other codecs. I
>>>> would put it between SBC and AAC. If someone prefers SBC over it, they know
>>>> enough about Bluetooth operation to qualify as a power user capable of using
>>>> the config file to disable FastStream.
>>> Based on above details I would say it must be similar (or same?) as SBC
>>> for streaming. But who knows how is receiver implemented? I would not be
>>> surprised if some bluetooth headset have degraded SBC A2DP codec just
>>> for marketing purposed to show that other vendor codec is "better".
>>>
>>> As I said, I need to play with FastStream and see what my headset would
>>> do with it. For me interesting part is that backchannel support to avoid
>>> all problems with switching between A2DP and HSP/HFP profiles (to
>>> activate HSP/HFP only in case I have incoming call and after hangup
>>> switch back to AD2P...).
>> It would be great if FastStream support could be implemented. I have a headset with CSR (now Qualcomm) chip which supports SBC, AptX, AAC and FastStream. The headset is rather unknown and not expensive (but surprisingly good), so I assume FastStream support is not that rare.
>> If high-quality duplex audio is possible with Bluetooth, that would be very handy for conferences.
> Now I have working sink support (sending audio from host to headset) for
> FastStream codec in pulseaudio. Voice backchannel support would be
> rather challenge as I do not know if bluez provides API for such thing.
>
> Anyway good news is that at least my Creative headset automatically
> starts sending voice data after FastStream codec is negotiated and via
> "btmon" I was able to capture voice data and via "sbcdec" decode them to
> check that it is correct and usable.
>
> May I ask which headset it is? I was told that FastStream is supported
> only by Creative headsets.
>
It's RealForce OverDrive D1.
Here's what could be seen in btmon upon connection:
> ACL Data RX: Handle 256 flags 0x02 dlen 20 #100 [hci0] 5.331899
Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 13 nosp 0
Service Category: Media Transport (0x01)
Service Category: Media Codec (0x07)
Media Type: Audio (0x00)
Media Codec: SBC (0x00)
Frequency: 0xf0
16000
32000
44100
48000
Channel Mode: 0x0f
Mono
Dual Channel
Stereo
Joint Stereo
Block Length: 0xf0
4
8
12
16
Subbands: 0x0c
4
8
Allocation Method: 0x03
SNR
Loudness
Minimum Bitpool: 2
Maximum Bitpool: 53
Service Category: Content Protection (0x04)
Content Protection Type: SCMS-T (0x0002)
> ACL Data RX: Handle 256 flags 0x02 dlen 19 #103 [hci0] 5.361891
Channel: 66 len 15 [PSM 25 mode 0] {chan 2}
AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 14 nosp 0
Service Category: Media Transport (0x01)
Service Category: Media Codec (0x07)
Media Type: Audio (0x00)
Media Codec: Non-A2DP (0xff)
Vendor ID: APT Licensing Ltd. (0x0000004f)
Vendor Specific Codec ID: aptX (0x0001)
Frequency: 0xf0
16000
32000
44100
48000
Channel Mode: 0x02
Stereo
> ACL Data RX: Handle 256 flags 0x02 dlen 20 #106 [hci0] 5.391902
Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 15 nosp 0
Service Category: Media Transport (0x01)
Service Category: Media Codec (0x07)
Media Type: Audio (0x00)
Media Codec: MPEG-1,2 Audio (0x01)
Layer: 0x20
Layer III (mp3)
CRC: Yes
Channel Mode: 0x0f
Mono
Dual Channel
Stereo
Joint Stereo
Media Payload Format: RFC-2250
Frequency: 0x3f
16000
22050
24000
32000
44100
48000
VBR: Yes
Service Category: Content Protection (0x04)
Content Protection Type: SCMS-T (0x0002)
> ACL Data RX: Handle 256 flags 0x02 dlen 20 #109 [hci0] 5.421906
Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 0 nosp 0
Service Category: Media Transport (0x01)
Service Category: Media Codec (0x07)
Media Type: Audio (0x00)
Media Codec: Non-A2DP (0xff)
Vendor ID: Cambridge Silicon Radio (0x0000000a)
Vendor Specific Codec ID: Unknown (0x0001)
03 23 .#
Am I misunderstanding the latest item? Is it not a FastStream?
More information about the pulseaudio-discuss
mailing list