Solved Airbuds with Bluetooth AC7006F4 driver

Hi, I just purchased the XSSIVE XSS-AIRC01 device, a Bluetooth 5.3 device that uses the AC7006F4 chip.

Does anyone know if is there a way to use this with FreeBSD.
 
By following this: https://www.jrgsystems.com/posts/2022-08-20-how-i-configure-bluetooth-headphones-on-freebsd-13-1 I was able to connect the headphones:

Code:
sudo hccontrol -n ubt0hci create_connection headphones
BD_ADDR: headphones
Connection handle: 256
Encryption mode: Disabled [0]
sudo hccontrol -n ubt0hci read_connection_list        
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
headphones           256  ACL    0 MAST    NONE       0     0 OPEN

But if I call again sudo hccontrol -n ubt0hci read_connection_list after a couple of seconds the device "headphones" no longer exists.
 
Also, if I quickly (before the device disappear from read_connection_list) run this

Code:
sudo virtual_oss -S -a o,-4 -C 2 -c 2 -r 44100 -b 16 -s 1024 -R /dev/dsp0 -P /dev/bluetooth/headphones -d dsp -t vdsp.ctl

I get:

Code:
hw.snd.basename_clone: 0 -> 0
virtual_oss: Could not create CUSE DSP device
 
I managed to get rid of the virtual_oss: Could not create CUSE DSP device message, I don't know why in /boot/loader.conf I had:

Code:
cuse4bsd_load="YES"

And replaced by:

Code:
cuse_load="YES"

Now, sudo hccontrol -n ubt0hci read_connection_list shows the device even after a while, before the cuse_load it disconnected.
 
I found something interesting, by re-reading the document mentioned at the beginning of this thread I found the author runs:

Code:
sudo hccontrol -n ubt0hci write_authentication_enable 1

And now the read_connection_list returns this:

Code:
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
headphones          3865  ACL    0 MAST    NONE       0     0 W4_CONN_COMPLETE

Instead of:

Code:
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
headphones           512  ACL    0 MAST    NONE       0     0 OPEN
 
Now, after running the following line on one console and running vlc to play an mp3 on a 2nd console:

Code:
sudo virtual_oss -C 2 -c 2 -r 48000 -b 16 -s 20ms -P /dev/bluetooth/headphones -R /dev/null -w dsp.ctl -d dsp -l mixer

I get:

Code:
hw.snd.basename_clone: 0 -> 0
backend_bt: Could not open SDP
backend_bt: PSM=0xffffffff
backend_bt: PSM not found
 
Mmm, I noticed that after a while the command sudo hccontrol -n ubt0hci read_connection_list, returns an empty list, even after it changed from OPEN to W4_CONN_COMPLETE, let's continue investigating.
 
Recap:

Code:
sudo service hcsecd restart
sudo service bluetooth restart ubt0 (two times)
Now press the power button on the headphones for two seconds, to enable "pairing mode".
sudo hccontrol -n ubt0hci create_connection headphones
sudo hccontrol -n ubt0hci write_authentication_enable 1

After those I can run sudo hccontrol -n ubt0hci read_connection_list and get

Code:
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
headphones           256  ACL    0 MAST    NONE       0     0 OPEN

And some times I get

Code:
Remote BD_ADDR    Handle Type Mode Role Encrypt Pending Queue State
headphones          3865  ACL    0 MAST    NONE       0     0 W4_CONN_COMPLETE

But mostly I get an empty list.
 
Now the connection is maintained forever (or at least I get W4_CONN_COMPLETED), but when I run:

Code:
sudo virtual_oss -C 2 -c 2 -r 48000 -b 16 -s 20ms -P /dev/bluetooth/headphones -R /dev/null -w dsp.ctl -d dsp -l mixer

I get:

Code:
hw.snd.basename_clone: 0 -> 0
backend_bt: Could not open SDP
backend_bt: PSM=0xffffffff
backend_bt: PSM not found
backend_bt: Could not open SDP
backend_bt: PSM=0xffffffff
backend_bt: PSM not found
backend_bt: Could not open SDP
backend_bt: PSM=0xffffffff
backend_bt: PSM not found
backend_bt: Could not open SDP
backend_bt: PSM=0xffffffff
backend_bt: PSM not found
 
Wow!, I finally made it work, yeaa!!

It looks like this device doesn't need hccontrol -n ubt0hci write_authentication_enable 1

I'll reboot and try clean.
 
One key aspect I forgot to document was this:

Code:
sudo service sdpd onestart

This is ESSENTIAL.

BTW, I'm running FreeBSD 14.1 and testing sound output from command line with mplayer myfile.wav, now I must test audio output from Firefox/Chrome.
 
Well, It looks like I set media.cubeb.backend: oss on Firefox before, now audio output runs without issues, tested with Youtube.
 
This is awesome, tried Whereby (a Zoom/Meet-like service) and everything (microphone, audio output and camera)worked beautifully.
 
For the record, once the laptop is rebooted, the steps to redirect audio to the headset is, power on them (the XSSIVE XSS-AIRC01 has two small buttons on one ear, just press one of them) and execute:

Code:
sudo virtual_oss -C 2 -c 2 -r 48000 -b 16 -s 20ms -P /dev/bluetooth/headphones -R /dev/null -w dsp.ctl -d dsp -l mixer

The result should be something like this:

Code:
hw.snd.basename_clone: 1 -> 0
backend_bt: PSM=0x19
 
Back
Top