Just waiting for you to report your findings
EDIT: you mean this build from @attah Release test1 ¡ attah/sailfish-pulseaudio ¡ GitHub just to keep the info in proximityâŚ
SIGH, EDIT, Edit: Iâm not a good testing candidate since I donât have any bluetooth headphones.
EDIT: Unfortunately the below doesnât quite work as plannedâŚ
You should now be able to install a package called pulseaudio-gst-bt from the gst-bluetooth repo directly. It packages only that one .so file, and places it in /opt/pulse-17.0/modules/libbluez5-util.so. I.e. you donât need to install the attah package.
(Changes to attahâs branch visible here.)
With this installed you should be able to load the .so from /opt - either by adding --dl-search-path argument to the PA daemon, or setting the env var LTDL_LIBRARY_PATH.
Note that the PA systemd unit references an environment file at /etc/sysconfig/pulseaudio, so you can put LTDL_LIBRARY_PATH in there without editing any files belonging to a package.
It works for music (softlinked to .so in /usr/lib64/pulse-17.0/modules/ after renaming the original file) the Path Setting did not work.
pactl send-message /card/bluez_card.XXXXXXXXXXXX/bluez get-codec
âldac_hqâ
but during a call, it still changes to
âCVSDâ
So at least a partial victory
mSBC is disabled in /etc/pulse/default_sailfish.pa. You can reenable it but mSBC audio isnât working (at least during phone calls). Iâm looking into it.
Okay, I got mSBC working. When pulseaudio-modules-droid-jb2q (the version used on my Xperia 10 II) routes the Bluetooth audio, it does so by setting the BT_SCO=on in the HIDL audio HAL. This causes the HAL to tell ALSA and then finally the kernel btfm driver that the sample rate is 8k, which causes a very low volume garbled mess.
All we need to do is activate the wideband audio in the audio HAL, by setting bt_wbs=on here as well. I tested this by changing enable_msbc=false to true in /etc/pulse/default_sailfish.pa and then manually switching my Bluetooth headset to HFP and setting up the droid source/sinks, then injecting the command using pulseaudio-modules-droid-hidlâs DBus interface:
pactl set-card-profile bluez_card.70_BF_92_D8_DF_0F handsfree_head_unit
pactl set-sink-port sink.primary_output output-sco_headset
pactl set-source-port source.droid input-bluetooth_sco_headset
dbus-send --print-reply --type=method_call --address='unix:path=/run/user/100000/pulse/dbus-socket' --dest=org.SailfishOS.AudioSystemPassthrough /org/sailfishos/audiosystempassthrough org.SailfishOS.AudioSystemPassthrough.set_parameters string:bt_wbs=on
Doing this, then either recording using parecord or staring a call, the headset is now in a functional mSBC mode. Youâll see a line like this in your syslog (note the rates:16000):
kernel: btfm_slim_enable_ch: channel define - rates:16000, baser:1, ratem:4
What we need now, is to figure out how to selectively activate bt_wbs=on/off in pulseaudio-modules-droid[-jb2q] based on whether or not the HFP is going into mSBC or CVSD mode. If anyone is knowledgeable about PulseAudio internals I am all ears.
Sadly there is regression in this regard in SFOS 5.2.
After connecting always the best quality is selected(552kbps) and it gets me a lot of distortion (most likely bt receiver issue). Then I have to choose standard quality âsbcâ but every reconnect it goes back to âsbc_xq_552â. At the moment bt is barely usable for me.
Workaround for the time being:
Requirements:
Situations and bluetoothctl
devel-su pkcon install bluez-tools
then a new rule should be created in Situtation:
When: BT device
What: Command:
pactl send-message /card/bluez_card.XX_XX_XX_XX_XX_XX/bluez switch-codec sbc
bluetoothctl disconnect XX:XX:XX:XX:XX:XX
bluetoothctl connect XX:XX:XX:XX:XX:XX
where XX⌠are device address
and in Command settings(gear at left bottom) set 1000ms delay