How I managed to use BlueTooth audio with ThinkPad X220:

  1. 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
  2. Ensure kernel module ng_ubt is loaded, though it should be loaded automatically by devd:
     kldload ng_ubt
  3. Ensure bthidd service is enabled and started:
     sysrc bthidd_enable=yes ; service bthidd start
  4. Ensure hcsecd service is enabled and started:
     sysrc hcsecd_enable=yes ; service hcsecd start
  5. 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
  6. Ensure that the connection exists by running hccontrol:
     hccontrol -n ubt0hci create_connection BT_ADDR_OF_DEVICE
  7. Verify connection using:
     hccontrol -n ubt0hci read_connection_list
  8. Install virtual_oss port:
     pkg install virtual_oss
  9. 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.

  10. Play audio via vlc or other app

Further reading:


CategoryHowTo

SteveWills/BTSpeaker (last edited 2018-01-29T22:34:32+0000 by MarkLinimon)