That one (0277a18
/sco-fix-msbc-probe
) works as well.
Thank you for the quick turnaround!
That (f783d7b4
) works as well.
Feel free to use me as your guineapig. Now that I know how to test this, the turnaround is reasonably fast, certainly faster than installing-uninstalling Pulseaudio, pairing-unpairing devices and recording btmon
dumps all the time :)
That works, both playback and recording.
With Pipewire 0.3.36 it works, so it seems to be a 0.3.37 regression.
The little disconnection dance does not change anything with Pipewire :)
So I've now done this (please let me know if I've blown anything up, from the comment on the other issue I thought that is the right way to test):
git clone https://gitlab.freedesktop.org/pvir/pipewire.git pipewire
git checkout a2b910b9
cd pipewire
./autogen.sh
systemctl --user stop pipewire.service pipewire.socket pipewire-pulse.service pipewire-pulse.socket pipewire-media-session.service
make run
Now the CVSD output just remains silent. When I switch the unit to aptX I get sound. Recording in HFP/HSP is possible, but gives the same distorted robot sound.
Here's a btmon
dump from trying to record: hfp-record-pipewire-a2b910b9.btsnoop
The output from make run
is the following (the last message about connection reset appeared while I was making the btsnoop from the recording):
> make run
ninja -C /home/username/programming/pipewire/builddir
ninja: Entering directory `/home/username/programming/pipewire/builddir'
ninja: no work to do.
SPA_PLUGIN_DIR=/home/username/programming/pipewire/builddir/spa/plugins \
PIPEWIRE_MODULE_DIR=/home/username/programming/pipewire/builddir/src/modules \
PATH=/home/username/programming/pipewire/builddir/src/examples:/home/username/bin:/home/username/.local/bin:/home/username/.cargo/bin:/home/username/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/snap/bin:/usr/games:/usr/games \
PIPEWIRE_CONFIG_DIR=/home/username/programming/pipewire/builddir/src/daemon \
ACP_PATHS_DIR=/home/username/programming/pipewire/spa/plugins/alsa/mixer/paths \
ACP_PROFILES_DIR=/home/username/programming/pipewire/spa/plugins/alsa/mixer/profile-sets \
/home/username/programming/pipewire/builddir/src/daemon/pipewire-uninstalled
[W][00211.047596] mod.protocol-pulse | [ server.c: 576 start_unix_server()] server 0x564f6697eab0: unlinking stale socket '/run/user/1000/pulse/native'
[W][00211.490539] spa.bluez5.quirks | [ quirks.c: 267 spa_bt_quirks_create()] failed to load bluez-hardware.conf
[W][00794.620794] spa.bluez5.sink.sco | [ sco-sink.c: 481 flush_data()] sco-sink: write failure: -104 (Die Verbindung wurde vom Kommunikationspartner zurückgesetzt)
OK, I've worked around that by unpairing the device, switching it off, then starting the btmon
log, powering up the device and re-pairing it:
I've also added it to the comment above.
Let me know if that works.
Pulseaudio (at least 15.0) seems to have a bug where I can select HFP/HSP only if the device is connected at bootup. When I connect it later, I don't see the HFP/HSP option and am stuck with A2SP. This was the only way I could get a btsnoop of Pulseaudio in HFP/HSP mode at all.
Here are btmon
logs of recording successfully with Pulseaudio and unsuccessfully with Pipewire:
btmon
log was started): hfp-record-pulseaudio.btsnoop
With load-module module-bluetooth-discover enable_msbc=false
in /etc/pulse/default.pa
, Pulseaudio will no longer connect to any Bluetooth audio devices; the connection instantly fails.
Thank you @pvir.
Following your suggestions, I've now done the following:
ofono
, with no effect.btmon
traffic dump here: hfp.btsnoop - (it's the first seconds of a Youtube video).Apologies if this has already been reported. I'm new to Pipewire and don't know much about Bluetooth and codecs. I did search through the issues for HFP/HSP and did not see this, but it may have been my mistake.
I'm using Pipewire 0.3.38 (from OpenSUSE's Multimedia Libs repo) with OpenSUSE Tumbleweed, kernel 5.14.6. Whenever I switch a Bluetooth audio device from A2DP to HFP/HSP, I'm seeing terrible distortion. I'm not expecting much quality from HFP/HSP, but it's worse than that: chopped stutter, heavy clipping, drops of several seconds, basically everything is mangled and unintelligible. It concerns not only output, but microphone input as well.
I'm seeing this with several devices, a Sony SRS-BTX500 speaker and a BlueParrott B450-XT wireless headset. Both devices used to work OK when connected through PulseAudio.
I've attached logs below where I switch between A2SP and HFP/HSP. Here are the basic parameters of the system:
Bluetooth Radio, Bluetooth Headset, Desktop Environment, Distribution, Version (Bluez, Kernel, and PipeWire):
> lsusb; bluetoothctl devices; echo $XDG_SESSION_DESKTOP; grep PRETTY /etc/os-release; pipewire --version; bluetoothctl --version; uname -r
Bus 004 Device 002: ID 046d:0893 Logitech, Inc. StreamCam
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0bda:0328 Realtek Semiconductor Corp. USB3.0-CRW
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04f2:b61e Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 002: ID 056e:010d Elecom Co., Ltd M-HT1DRBK HUGE Wireless Optical TrackBall
Bus 001 Device 005: ID 056a:5146 Wacom Co., Ltd Pen and multitouch sensor
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device C8:84:47:F9:34:02 SRS-BTX500
Device 44:4A:DB:B6:F8:40 FBI Surveillance Van
Device 30:50:75:0F:A3:D0 Jabra Speak 750
Device 3C:68:16:06:70:04 B450-XT v1.11
Device 00:16:94:0F:07:50 Sennheiser MM450-X
KDE
PRETTY_NAME="openSUSE Tumbleweed"
pipewire
Compiled with libpipewire 0.3.38
Linked with libpipewire 0.3.38
bluetoothctl: 5.61
5.14.6-1-default
Here is the bluetoothctl
output for the Sony SRS-BTX500:
> bluetoothctl
Agent registered
AdvertisementMonitor path registered
[SRS-BTX500]# info
Device C8:84:47:F9:34:02 (public)
Name: SRS-BTX500
Alias: SRS-BTX500
Class: 0x00240414
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Serial Port (00001101-0000-1000-8000-00805f9b34fb)
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
Affected by Policy: no
dmesg
output for Bluetooth:
# dmesg | grep Bluetooth
[ 9.157549] Bluetooth: Core ver 2.22
[ 9.157574] Bluetooth: HCI device and connection manager initialized
[ 9.157578] Bluetooth: HCI socket layer initialized
[ 9.157580] Bluetooth: L2CAP socket layer initialized
[ 9.157584] Bluetooth: SCO socket layer initialized
[ 9.380152] Bluetooth: hci0: Bootloader revision 0.0 build 26 week 38 2015
[ 9.381347] Bluetooth: hci0: Device revision is 16
[ 9.381350] Bluetooth: hci0: Secure boot is enabled
[ 9.381351] Bluetooth: hci0: OTP lock is enabled
[ 9.381352] Bluetooth: hci0: API lock is enabled
[ 9.381353] Bluetooth: hci0: Debug lock is disabled
[ 9.381354] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[ 9.440412] Bluetooth: hci0: Found device firmware: intel/ibt-12-16.sfi
[ 10.878929] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 10.878934] Bluetooth: BNEP filters: protocol multicast
[ 10.878938] Bluetooth: BNEP socket layer initialized
[ 10.911176] Bluetooth: hci0: Waiting for firmware download to complete
[ 10.911323] Bluetooth: hci0: Firmware loaded in 1436432 usecs
[ 10.911365] Bluetooth: hci0: Waiting for device to boot
[ 10.923336] Bluetooth: hci0: Device booted in 11709 usecs
[ 10.923496] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-12-16.ddc
[ 10.926337] Bluetooth: hci0: Applying Intel DDC parameters completed
[ 10.927338] Bluetooth: hci0: Reading supported features failed (-16)
[ 10.928338] Bluetooth: hci0: Firmware revision 0.1 build 197 week 12 2021
[ 11.045615] Bluetooth: RFCOMM TTY layer initialized
[ 11.045625] Bluetooth: RFCOMM socket layer initialized
[ 11.045632] Bluetooth: RFCOMM ver 1.11
[ 507.774219] Bluetooth: hci0: urb 00000000a7aea6e4 submission failed (90)
[ 564.227187] Bluetooth: hci0: urb 00000000a08cdd05 submission failed (90)
[ 750.114094] Bluetooth: hci0: urb 00000000c8fc1f21 submission failed (90)
[ 917.069893] Bluetooth: hci0: urb 000000005c8c89e2 submission failed (90)
Output of pw-dump
: pw-dump.out
Output of PIPEWIRE_DEBUG=4 pipewire-media-session 2>&1 | grep --line-buffered -Ei '\[[EW]\]|\[\s*bluez5|\[\s*a2dp|\[\s*backend|\[\s*sco|quirk' > pipewire-bluez.log
(I switched from A2SP to HFP/HSP and back again):
pipewire-bluez.log
Pipewire log (from journalctl -xe | grep pipewire
over a few instances of switching back and forth between A2SP and HFP/HSP): pipewire.log