Skip to contentSkip to conversation

Support for the Bluetooth subband codec (SBC)

DISCUSSION Marcel Holtmann 2 participants 5 messages Nov 8, 2004

lore
Share & tools
lore
#0 lore raw

Hi guys,

besides the Bluetooth headset/handsfree support there is another type of audio support. It is the high quality audio (A2DP) for headphones and so on. To include a native support for these devices with every Bluetooth adapter (for example the ones built into your notebook) it is necessary to support the subband codec (SBC) from Philips. The codec description is in the Advanced Audio Distribution Profile (A2DP).

I am not an audio expert and far away from doing any codec specific things, but from my understanding the ALSA kernel part should be extended with the SBC type for PCM devices and the library should know how to convert any PCM data into the SBC format so we can use it inside the kernel in a A2DP driver.

Any comments?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#1 lore raw
Quoted 9 lines · Marcel Holtmann

Hi guys,

besides the Bluetooth headset/handsfree support there is another type of audio support. It is the high quality audio (A2DP) for headphones and so on. To include a native support for these devices with every Bluetooth adapter (for example the ones built into your notebook) it is necessary to support the subband codec (SBC) from Philips. The codec description is in the Advanced Audio Distribution Profile (A2DP).

Quoted 5 lines

I am not an audio expert and far away from doing any codec specific things, but from my understanding the ALSA kernel part should be extended with the SBC type for PCM devices and the library should know how to convert any PCM data into the SBC format so we can use it inside the kernel in a A2DP driver.

Any datasheet for this format? Anyway, if SBC format only encapsulates linear PCM samples to packets, then it should be handled in the driver like the USB driver does.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#2 lore raw

Hi Jaroslav,

Quoted 13 lines
Quoted 7 lines

besides the Bluetooth headset/handsfree support there is another type of audio support. It is the high quality audio (A2DP) for headphones and so on. To include a native support for these devices with every Bluetooth adapter (for example the ones built into your notebook) it is necessary to support the subband codec (SBC) from Philips. The codec description is in the Advanced Audio Distribution Profile (A2DP).

Quoted 5 lines

I am not an audio expert and far away from doing any codec specific things, but from my understanding the ALSA kernel part should be extended with the SBC type for PCM devices and the library should know how to convert any PCM data into the SBC format so we can use it inside the kernel in a A2DP driver.

Quoted 3 lines

Any datasheet for this format? Anyway, if SBC format only encapsulates linear PCM samples to packets, then it should be handled in the driver like the USB driver does.

the datasheet for this codec can be found on the Bluetooth specification webpage (www.bluetooth.org/spec/). It is part of the A2DP document. I think you need to be logged in to get it and so I will send it to you in a private mail later.

I don't think that this is linear PCM, but actually I am no expert when it comes to codec specific stuff. I would be great if you can take a look at it and tell me what you think how we should support it.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#3 lore raw
Quoted 3 lines · Marcel Holtmann

I don't think that this is linear PCM, but actually I am no expert when it comes to codec specific stuff. I would be great if you can take a look at it and tell me what you think how we should support it.

I see - SBC is an audio compression. It should be implemented in alsa-lib as you suggested.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#4 lore raw

Hi Jaroslav,

Quoted 6 lines
Quoted 3 lines

I don't think that this is linear PCM, but actually I am no expert when it comes to codec specific stuff. I would be great if you can take a look at it and tell me what you think how we should support it.

I see - SBC is an audio compression. It should be implemented in alsa-lib as you suggested.

my idea is to add a snd_pcm_t for every stream endpoint and then set the type of the snd_pcm_hardware_t to SBC at runtime. The ALSA library then must do the audio compression, rate conversion etc.

However my current problem is that SBC type has some codec specific information elements (A2DP, page 20) and I don't know for some of them how we should support them. For all that don't have the specification these information are:

- Sampling Frequency
- 16000, 32000, 441000 and 48000 Hz
- Channel Mode
- Mono, Dual channel, Stereo, Joint stereo
- Block Length
- 4, 8, 12 and 16
- Subbands
- 4 and 8
- Allocation Method
- SNR and Loudness
- Minimum Bitpool Value
- Maximum Bitpool Value
- Both are ranging from 2 to 250

Some of these settings are mandatory to support and some of them are optional.

The only clear value for me is the sampling frequency. Mapping the channel mode to the channels_{min|max} is not clear and for the rest I have no idea.

Any ideas on how we should support this?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click