How I managed to use BlueTooth audio with ThinkPad X220:
Enable BlueTooth support:
kldload acpi_ibm ; echo 'acpi_ibm_load="YES"' >> /boot/loader.conf sysctl dev.acpi_ibm.0.bluetooth=1 ; echo dev.acpi_ibm.0.bluetooth=1 >> /etc/sysctl.conf
- Ensure kernel module ng_ubt is loaded, though it should be loaded automatically by devd:
kldload ng_ubt
- Ensure bthidd service is enabled and started:
sysrc bthidd_enable=yes ; service bthidd start
- Ensure hcsecd service is enabled and started:
sysrc hcsecd_enable=yes ; service hcsecd start
Put device in pairing mode and pair with FreeBSD. Can be done manually using hccontrol or using bluetooth-config script from Phabricator review
bluetooth-config
- Ensure that the connection exists by running hccontrol:
hccontrol -n ubt0hci create_connection BT_ADDR_OF_DEVICE
- Verify connection using:
hccontrol -n ubt0hci read_connection_list
- Install virtual_oss port:
pkg install virtual_oss
- Start virtual_oss:
virtual_oss -C 2 -c 2 -r 48000 -b 16 -s 1024 -R /dev/null -P /dev/bluetooth/BT_ADDR_OF_DEVICE -d dsp
If after src r295440, add -T /dev/sndstat before the -d to enable the device to show up in /dev/sndstat. If you want to use the virtual_oss_ctl package to control the virtual_oss device via GUI, add -t vdsp.ctl to the end. If you have trouble, try changing 48000 to 44100.
- Play audio via vlc or other app
Further reading: