Bluetooth Audio Connection Issue

Hello Everybody!

I am trying to get sound through USB to work but am encountering some problems.

My environment:
- Version: 13.1-RELEASE-p2
- Device: Lenovo Thinkpad T460
- Bluetooth Adapter: Integrated in Intel Wireless 6280
- Headphones: Anker Soundcore P3

This is how I am trying to set things up. Commented-Out lines show what things I've found and tried - without success - in bug reports and other forum posts.

Code:
#!/bin/sh
# service hcsecd stop
# rm /var/db/hcsecd.keys
service hcsecd onestart
service bluetooth restart ubt0
hccontrol -n ubt0hci create_connection headphones
# sysctl hw.snd.basename_clone=0
# trap "sysctl hw.snd.basename_clone=1" INT
virtual_oss -S -C 2 -c 2 -r 44100 -b 16 -s 1024 -R /dev/null -P /dev/bluetooth/headphones -T /dev/sndstat -d dsp4

"headphones" is aliased to the BT_ADDR of my bluetooth headphones and they connect fine, however when trying to attach with virtual_oss I get the error that can be seen in the latter bit of the output. This will loop endlessly until Ctrl-C'ed.

Code:
❯ doas bt-headphones
Password:
hcsecd already running?  (pid=7998).
BD_ADDR: headphones
Connection handle: 256
Encryption mode: Disabled [0]
backend_bt: PSM=0x19
backend_bt: Could not connect to HC: 5
backend_bt: PSM=0x19
backend_bt: Could not connect to HC: 5

Maybe someone has an Idea how this could be solved? I sadly don't have any other Bluetooth devices to test this with.
 
From my experience, starting connection to Bluetooth audio on FreeBSD has a bit too short timeout. It means, that usually you have to trigger command service bluetooth start ubt0 a couple of times, until it really starts.

Here is my script to connect Bluetooth headphones, maybe something will be useful for you. ;)
 
Thank you so much for your reply and the script! The bluetooth service does start, otherwise hccontrol gives an error message. The script did behave exactly like mine, just with more bells and whistles. Still getting "Could not connect to HC: 5"
 
Connection works with this now. However sound drops out multiple times a second and only one of the two earplugs actually play music. Has someone maybe got an idea? Toggling the resample switch -S, increasing the samplerate, playing with the buffer -s or the channels -C/-c did not change anything.

Code:
#!/bin/sh

# requires /etc/bluetooth/hosts to contain entry for "headphones" which maps the MAC
# works for soundcore if pin "1234" and key nokey is set in /etc/bluetooth/hcsecd.conf

kldunload cuse
kldload cuse
service hcsecd stop
rm /var/db/hcsecd.keys
service bluetooth restart ubt0
service hcsecd onestart
sysctl hw.snd.basename_clone=1
hccontrol -n ubt0hci write_authentication_enable 1
hccontrol -n ubt0hci create_connection headphones
virtual_oss -S -C 2 -c 2 -r 44100 -b 16 -s 20ms -R /dev/null -P /dev/bluetooth/headphones -T /dev/sndstat -d dsp -t vdsp.ctl
 
Unfortunately hselasky@ passed away. See the signature under his posts (which I put there this morning). Core@ is preparing a statement which I will post on the forums.
 
Unfortunately hselasky@ passed away. See the signature under his posts (which I put there this morning). Core@ is preparing a statement which I will post on the forums.
That makes me unbelievably sad.
I recall Hans-Peter as a open and warm and welcoming guy with incredible technical competence.
He was helping me ~20 years ago making my first commit (to usb driver quirks).
His legacy will be hard to cover.
May I ask why he passed away?

RIP!
 
I read about this car accident in the news, but I didn't realize it was HPS who was in it. A terrible loss.
 
Back
Top