Cannot use aptX audio when I want to use audio input at the same time

Problem

I wanna use aptX with my Bluetooth headset. The reason for aptX is, that obviously due to better compression and two-way communcation in a low-bandwidth medium as Bluetooth.
So I’ve installed pipewire-codec-aptx from rpmfusion. This solves it for input. However, when wanting to use it for input too, it switches back to an ugly codec. After all, aptX was invented for the fact to use it together with input/output however!

As such, I cannot use the headet as an input device at the same time, as the codec then automatically switches to HSP/HFP/mSBC. AptX can only be used in input here as it seems.
In the end, this makes the whole headset unusable for audio input, as obviously that other codec is pure noise and one cannot hear anything or so.

Note this is a summary of a longer painful background story of getting aptX to work in general. Especially I had the same (or at least very similar) issue on Fedora 34, where I had to use pulseaudio-module-bluetooth-freeworld from rpmfsion for this still, i.e. with Pulseaudio, I guess. But I had hoped this has changed with Wireplumber.

Also I don’t know all the technical details here please let me where there is a better place to report this.

Screencast / STR

Video:

What happens

Codec switches back to HSP/HFP/mSBC.

What should happen

Also use aptX for audio input.

Log

$ journalctl --since="-30 min" --no-hostname | grep --context=1 -i -E "wireplumber|bluetooth|codec|audio|headset|Bower|input|apt|gnome-control-center|bluez" | tee ~/Downloads/Fedora-36/new-bluetooth-inputisssue.txt
Mai 15 21:53:21 systemd[2088]: app-gnome-gnome\x2dbluetooth\x2dpanel-3665.scope: Consumed 13min 17.429s CPU time.
Mai 15 21:53:23 nautilus[88451]: Connecting to org.freedesktop.Tracker3.Miner.Files
--
Mai 15 21:54:38 rpm-ostree[88914]: In idle state; will auto-exit in 62 seconds
Mai 15 21:55:22 kernel: Bluetooth: hci0: SCO packet for unknown connection handle 257
Mai 15 21:55:22 kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7
--
Mai 15 22:03:41 systemd[2088]: Started vte-spawn-3d07b8c8-a1a8-4b6f-b3f1-f8a7e6118d8b.scope - VTE child process 91159 launched by gnome-terminal-server process 88814.
Mai 15 22:03:48 wireplumber[2212]: sbc_decode failed: -3
Mai 15 22:05:26 wpa_supplicant[1548]: wlp1s0: WPA: Group rekeying completed with 94:83:c4:04:dc:f8 [GTK=TKIP]
--
Mai 15 22:11:11 polkitd[1308]: Unregistered Authentication Agent for unix-process:93325:12272016 (system bus name :1.2224, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale de_DE.UTF-8) (disconnected from bus)
Mai 15 22:11:35 kernel: Bluetooth: hci0: SCO packet for unknown connection handle 257
Mai 15 22:11:35 kernel: Lockdown: systemd-logind: hibernation is restricted; see man kernel_lockdown.7

System

Bluetoth device: PX7 Bowers & Wilkins
Fedora Linux 36.20220514.0 (Silverblue)

$ uname -i -s -r -v -o -p
Linux 5.17.6-300.fc36.x86_64 #1 SMP PREEMPT Mon May 9 15:47:11 UTC 2022 x86_64 x86_64 GNU/Linux
$ pipewire --version 
pipewire
Compiled with libpipewire 0.3.51
Linked with libpipewire 0.3.51
$ bluetoothctl -v
bluetoothctl: 5.64
$ gnome-control-center --version
gnome-control-center 42.1
$ rpm-ostree status -v
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 23h ago
Deployments:
● fedora:fedora/36/x86_64/silverblue
                   Version: 36.20220514.0 (2022-05-14T00:45:42Z)
                BaseCommit: 37a03048e5cebd64eb20ad9ff42ad4b7672a7722e9d1f3a6705927c64bb8bbfa
                            β”œβ”€ repo-0 (2022-05-04T21:16:11Z)
                            β”œβ”€ repo-1 (2022-05-14T00:18:44Z)
                            └─ repo-2 (2022-05-14T00:22:04Z)
                    Commit: 548dcced972cb1b647655b5c2f5ed7950ffc1e21b9ec57575e5ac8de9eb220a1
                            β”œβ”€ fedora-modular (2022-05-04T21:12:01Z)
                            β”œβ”€ fedora (2022-05-04T21:16:11Z)
                            β”œβ”€ rpmfusion-free (2022-05-04T04:48:11Z)
                            β”œβ”€ fedora-cisco-openh264 (2022-04-07T16:52:38Z)
                            β”œβ”€ updates (2022-05-13T01:50:57Z)
                            β”œβ”€ rpmfusion-free-updates (2022-05-13T10:06:59Z)
                            β”œβ”€ updates-modular (2022-05-08T01:14:17Z)
                            └─ updates-archive (2022-05-14T03:31:43Z)
                    Staged: no
                 StateRoot: fedora
              GPGSignature: 1 signature
                            Signature made Sa 14 Mai 2022 02:45:45 CEST using RSA key ID 999F7CBF38AB71F4
                            Good signature from "Fedora <fedora-36-primary@fedoraproject.org>"
           LayeredPackages: adb compat-ffmpeg28 dconf-editor firewall-config git git-credential-libsecret git-subtree
                            gnome-tweaks gstreamer1-plugin-openh264 gtkhash-nautilus heimdall htop httpie keepassxc kid3
                            lshw mozilla-openh264 nautilus-image-converter nextcloud-client nextcloud-client-nautilus
                            nvme-cli openssl pipewire-codec-aptx podman-compose rpmfusion-free-release simple-scan
                            smartmontools sushi tldr zsh

Questions

  • With old pulseaudio (where it also did not work) I had pactl to debug such issues. Is there something like this for Wireplumber, too?

Created an issue at Wireplumber now, given that this is my first guess of the component that may solve this:

Ah, I should listen to my clever shell:

$ pactl list sink
zsh: correct 'pactl' to 'wpctl' [nyae]? y

Broken state (HSP/HFP for both)

So this is it in broken state:

$ wpctl status
PipeWire 'pipewire-0' [0.3.51, *****, cookie:80774311]
 └─ Clients:
        […]
        97. WEBRTC VoiceEngine                  [0.3.51, *****, pid:115]
        98. gsd-power                           [0.3.51, *****, pid:2557]
        99. Mutter                              [0.3.51, *****, pid:2241]
       105. wpctl                               [0.3.51, *****, pid:98625]
       112. speech-dispatcher-dummy             [0.3.51, *****, pid:35376]
       124. GNOME Settings                      [0.3.51, *****, pid:89501]

Audio
 β”œβ”€ Devices:
 β”‚      41. Renoir Radeon High Definition Audio Controller [alsa]
 β”‚      42. Family 17h (Models 10h-1fh) HD Audio Controller [alsa]
 β”‚     126. PX7 Bowers & Wilkins                [bluez5]
 β”‚  
 β”œβ”€ Sinks:
 β”‚      45. Family 17h (Models 10h-1fh) HD Audio Controller Analog Stereo [vol: 0.74]
 β”‚  *   94. PX7 Bowers & Wilkins                [vol: 0.54]
 β”‚  
 β”œβ”€ Sink endpoints:
 β”‚  
 β”œβ”€ Sources:
 β”‚      46. Family 17h (Models 10h-1fh) HD Audio Controller Analog Stereo [vol: 0.74]
 β”‚  *   96. PX7 Bowers & Wilkins                [vol: 0.74]
 β”‚  
 β”œβ”€ Source endpoints:
 β”‚  
 └─ Streams:
        85. GNOME Settings                                              
            119. monitor_FL     
            122. input_FL        < ALC257 Analog:monitor_FL
            129. monitor_FR     
            136. input_FR        < ALC257 Analog:monitor_FR
        95. speech-dispatcher-dummy                                     
             89. output_MONO     > PX7 Bowers & Wilkins:playback_MONO
       128. GNOME Settings                                              
             61. input_FR        < ALC257 Analog:monitor_FR
            113. monitor_FR     
            116. monitor_FL     
            133. input_FL        < ALC257 Analog:monitor_FL

Video
 β”œβ”€ Devices:
 β”‚      39. Integrated Camera                   [v4l2]
 β”‚      40. Integrated Camera                   [v4l2]
 β”‚  
 β”œβ”€ Sinks:
 β”‚  
 β”œβ”€ Sink endpoints:
 β”‚  
 β”œβ”€ Sources:
 β”‚  *   43. Integrated Camera                  
 β”‚  
 β”œβ”€ Source endpoints:
 β”‚  
 └─ Streams:

Settings
 └─ Default Configured Node Names:
         0. Audio/Sink    bluez_output.B0_67_2F_1B_E4_74.a2dp-sink
         1. Audio/Source  bluez_input.B0_67_2F_1B_E4_74.headset-head-unit

~ 

aptX as output / internal microphone as input

This kinda works, but only for aptX output:

$ wpctl status
PipeWire 'pipewire-0' [0.3.51, rugk@fedidea, cookie:80774311]
 └─ Clients:
        […]
        97. WEBRTC VoiceEngine                  [0.3.51, ****, pid:115]
        98. gsd-power                           [0.3.51, ****, pid:2557]
        99. Mutter                              [0.3.51, ****, pid:2241]
       105. GNOME Settings                      [0.3.51, ****, pid:89501]
       112. speech-dispatcher-dummy             [0.3.51, ****, pid:35376]
       124. GNOME Settings                      [0.3.51, ****, pid:89501]

Audio
 β”œβ”€ Devices:
 β”‚      41. Renoir Radeon High Definition Audio Controller [alsa]
 β”‚      42. Family 17h (Models 10h-1fh) HD Audio Controller [alsa]
 β”‚     126. PX7 Bowers & Wilkins                [bluez5]
 β”‚  
 β”œβ”€ Sinks:
 β”‚      45. Family 17h (Models 10h-1fh) HD Audio Controller Analog Stereo [vol: 0.74]
 β”‚  *   94. PX7 Bowers & Wilkins                [vol: 0.54]
 β”‚  
 β”œβ”€ Sink endpoints:
 β”‚  
 β”œβ”€ Sources:
 β”‚  *   46. Family 17h (Models 10h-1fh) HD Audio Controller Analog Stereo [vol: 0.74]
 β”‚  
 β”œβ”€ Source endpoints:
 β”‚  
 └─ Streams:
        64. GNOME Settings                                              
             96. input_FR        < ALC257 Analog:capture_FR
            114. monitor_FR     
            120. input_FL        < ALC257 Analog:capture_FL
            130. monitor_FL     
        85. GNOME Settings                                              
            119. monitor_FL     
            122. input_FL        < ALC257 Analog:monitor_FL
            129. monitor_FR     
            136. input_FR        < ALC257 Analog:monitor_FR
        95. speech-dispatcher-dummy                                     
             89. output_FL       > PX7 Bowers & Wilkins:playback_FL
            102. output_FR       > PX7 Bowers & Wilkins:playback_FR
       104. GNOME Settings                                              
             60. input_FL        < PX7 Bowers & Wilkins:monitor_FL
             66. monitor_FL     
             76. monitor_FR     
            115. input_FR        < PX7 Bowers & Wilkins:monitor_FR
       109. GNOME Settings                                              
             68. monitor_FL     
             70. input_FR        < ALC257 Analog:monitor_FR
             74. input_FL        < ALC257 Analog:monitor_FL
             75. monitor_FR     
       128. GNOME Settings                                              
             61. input_FR        < ALC257 Analog:monitor_FR
            113. monitor_FR     
            116. monitor_FL     
            133. input_FL        < ALC257 Analog:monitor_FL

Video
 β”œβ”€ Devices:
 β”‚      39. Integrated Camera                   [v4l2]
 β”‚      40. Integrated Camera                   [v4l2]
 β”‚  
 β”œβ”€ Sinks:
 β”‚  
 β”œβ”€ Sink endpoints:
 β”‚  
 β”œβ”€ Sources:
 β”‚  *   43. Integrated Camera                  
 β”‚  
 β”œβ”€ Source endpoints:
 β”‚  
 └─ Streams:

Settings
 └─ Default Configured Node Names:
         0. Audio/Sink    bluez_output.B0_67_2F_1B_E4_74.a2dp-sink
         1. Audio/Source  bluez_input.B0_67_2F_1B_E4_74.headset-head-unit

More details

When connected in broken state (126 = 96 above):

$ wpctl inspect 126
id 126, type PipeWire:Interface:Device
    api.bluez5.address = "B0:67:2F:1B:E4:74"
    api.bluez5.class = "0x240418"
    api.bluez5.connection = "disconnected"
    api.bluez5.device = ""
    api.bluez5.icon = "audio-headphones"
    api.bluez5.path = "/org/bluez/hci0/dev_B0_67_2F_1B_E4_74"
    bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink ]"
    bluez5.profile = "off"
  * client.id = "33"
    device.alias = "PX7 Bowers & Wilkins"
  * device.api = "bluez5"
    device.bus = "bluetooth"
  * device.description = "PX7 Bowers & Wilkins"
    device.form-factor = "headphone"
    device.icon-name = "audio-headphones-bluetooth"
  * device.name = "bluez_card.B0_67_2F_1B_E4_74"
    device.product.id = "0x0024"
    device.string = "B0:67:2F:1B:E4:74"
    device.vendor.id = "usb:19b5"
  * factory.id = "14"
  * media.class = "Audio/Device"
  * object.serial = "608"

When not in broken state/likely always accessible:

$ wpctl inspect 126
id 126, type PipeWire:Interface:Device
    api.bluez5.address = "B0:67:2F:1B:E4:74"
    api.bluez5.class = "0x240418"
    api.bluez5.connection = "disconnected"
    api.bluez5.device = ""
    api.bluez5.icon = "audio-headphones"
    api.bluez5.path = "/org/bluez/hci0/dev_B0_67_2F_1B_E4_74"
    bluez5.auto-connect = "[ hfp_hf hsp_hs a2dp_sink ]"
    bluez5.profile = "off"
  * client.id = "33"
    device.alias = "PX7 Bowers & Wilkins"
  * device.api = "bluez5"
    device.bus = "bluetooth"
  * device.description = "PX7 Bowers & Wilkins"
    device.form-factor = "headphone"
    device.icon-name = "audio-headphones-bluetooth"
  * device.name = "bluez_card.B0_67_2F_1B_E4_74"
    device.product.id = "0x0024"
    device.string = "B0:67:2F:1B:E4:74"
    device.vendor.id = "usb:19b5"
  * factory.id = "14"
  * media.class = "Audio/Device"
  * object.serial = "608"

Already also gone ahead and reported it as a bug to rpmfusion’s pipewire-codec-aptx, given it may then be a cause/related to there or they can also join and have some ideas here:
https://bugzilla.rpmfusion.org/show_bug.cgi?id=6300

1 Like