path: root/
diff options
authorJames Bottomley <>2021-02-17 09:44:34 +0300
committerPulseAudio Marge Bot <>2021-04-05 15:43:32 +0000
commitf22cfa8f811f4f67a5aee38a610da72ad28fe083 (patch)
treec50a4c24743f6ef0d7642363f8982a1811c71b54 /
parenta7b21fb5554cc84c3c5e3aeb8a120607bd078f1e (diff)
bluetooth: add support for mSBC codec
Adding processing support for the mSBC codec is somewhat problematic, because, although it is a SBC codec, the a2dp handling can't simply be reused because the codec is used on an eSCO link with transparent data, meaning the transmission unit has to be 48 bytes (fragmenting the codec packets) and reassembly and boundary detection is required to be done by the implementation. Therefore we have to implement separate render and push routines for msbc that do this fragmentation. Fragmentation is done by emulating circular buffers. The receive (push) buffer is easy, since the mSBC packet size is 60, simply have a buffer of this size in the sbc_info area where the fragments are reassembled. Once we have a full 60 bytes, decode and restart from zero. The send (render) buffer is more problematic, since the transmit must be done from contiguous memory. This means that the buffer must be the lowest common multiple of the transmission unit and the packet size. This value is 240 since 240/48 == 5 and 240/60 == 4. So the buffer pointers are reset at 240 which is a whole number of both rendered packets and eSCO transmission units. Signed-off-by: James Bottomley <> Part-of: <>
Diffstat (limited to '')
1 files changed, 1 insertions, 0 deletions
diff --git a/ b/
index 6b86ba2bc..fd146a7e7 100644
--- a/
+++ b/
@@ -696,6 +696,7 @@ if avahi_dep.found()
sbc_dep = dependency('sbc', version : '>= 1.0', required : false)
if get_option('bluez5')
assert(dbus_dep.found(), 'BlueZ requires D-Bus support')
assert(sbc_dep.found(), 'BlueZ requires SBC support')