UBT(4)
๐ UBT(4) โ USB Bluetooth driver ๐
ok so bestie, you found a Kernel Interfaces Manual page and it's literally about the ubt driver. buckle up, we're getting into dongle lore ๐ฆ
โจ NAME โจ
ubt โ the USB Bluetooth driver, aka the little guy that makes your tiny USB Bluetooth stick actually do stuff ๐
๐ SYNOPSIS ๐
ubt* at uhub? port ? configuration ? interface ?
like, that's the whole ritual. no cap. โจ
๐ธ DESCRIPTION ๐ธ
okay so the ubt driver is the one that gives the Bluetooth protocol stack support for USB Bluetooth dongles. it's giving matchmaker, honestly โ it introduces your dongle to the stack ๐ซถ
here's the cute part (and also the slightly annoying part): USB Bluetooth dongles show up with two interfaces, and the ubt driver claims both of them. yes, both. it's an all-in package deal ๐
the second interface is the one used for Isochronous data, and it has several alternate configurations regarding bandwidth consumption. you can set which one you want with the hw.ubtN.config sysctl(8) variable ๐ฅ
wanna know how many alternate configurations exist? that number lives in the hw.ubtN.alt_config variable. and the isoc frame size for your current configuration is chillin' in the hw.ubtN.sco_rxsize and hw.ubtN.sco_txsize variables. icons only ๐
by default, configuration 0 is selected โ which means no bandwidth is used on the Isochronous interface, and no SCO data can be sent. zero. none. it's giving "resting state" ๐ด
for the complete instructions on setting bandwidth consumption, consult the Bluetooth USB specification at https://www.bluetooth.org/ โ the following extract is still useful as general guidance, though details may differ between manufacturers. (translation: don't come for me if your dongle does its own thing ๐)
0โ No active voice channels1โ One voice channel with 8-bit encoding2โ Two voice channels with 8-bit encoding, or one voice channel with 16-bit encoding.3โ Three voice channels with 8-bit encoding4โ Two voice channels with 16-bit encoding5โ Three voice channels with 16-bit encoding
slay, that's the whole menu ๐
๐ SEE ALSO ๐
bluetooth(4)uhub(4)sysctl(8)
(the whole friend group fr fr ๐ซถ)
๐ฆ HISTORY ๐ฆ
ngl this one has a whole glow-up arc. this ubt device driver was originally a character device, written by David Sainty and Lennart Augustsson. then it got rewritten to support socket based Bluetooth access for NetBSD 4.0 by Iain Hibbert. main character energy, honestly โจ
๐ CAVEATS ๐
okay bestie, listen carefully, this is the part where it gets real ๐ญ
Isochronous data is seemingly not well supported over USB in the current system, and to get SCO working you may have to calculate the SCO packet size that the stack will use. it's the sco_mtu value reported by the btconfig(8) command, and when you combine it with the SCO header (3 bytes) it should fit exactly into an integer number of Isochronous data frames โ where the frame size is indicated by the โhw.ubtN.sco_txsizeโ sysctl variable. math girl summer, unfortunately ๐งฎ๐
for example: I want one voice channel (which is all that is supported, for now) so I'm using configuration #2, with a frame length of 17 bytes. this gives possible values of:
(17 * 1) - 3 = 14
(17 * 2) - 3 = 31
(17 * 3) - 3 = 48
(17 * 4) - 3 = 65
(17 * 5) - 3 = 82
etc. ๐
btconfig(8) shows the maximum SCO payload as 64 bytes, so I'm using the next smaller size of 48, to minimize the overhead of the 3 header bytes. see? simple. iconic. lowkey stressful. ๐
the SCO packet size can be changed using the โscomtuโ option to btconfig(8) ๐
and the failure mode? the USB Bluetooth dongle locks up ๐ญ though generally removal/reinsertion will clear the problem. so like. unplug it and plug it back in. the ancient IT ritual. it works. ๐ซถ
โญ BUGS โญ
The Isochronous configuration can only be changed when the device is not marked up. that's it, that's the bug note, respect the boundary ๐คโจ
and that's the tea, bestie ๐ this page came from the Debian gang, version dated August 27, 2006 โ a whole vintage moment, and yes she still ate ๐
๐
UBT(4) โ go forth and slay your dongle configuration ๐ธ๐ฆ๐
๐ฆ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2006 Itronix Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms