NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.19k stars 13.48k forks source link

Plasma 5.20.4: bluetooth audio not realiable #108941

Open turboMaCk opened 3 years ago

turboMaCk commented 3 years ago

Describe the bug Bluetooth audio not working with recent version of plasma5

To Reproduce Steps to reproduce the behavior:

  1. login to plasma5 session
  2. connect bluetooth headset
  3. Bluetooth audio is not working

Expected behavior Bluetooth audio should work

Logs

Jan 10 13:44:40 nixos-mainframe pulseaudio[2172]: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSink/SBC
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSink/AAC
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSink/VENDOR/APTX
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSink/VENDOR/APTXHD
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSource/SBC
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSource/AAC
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSource/VENDOR/APTX
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSource/VENDOR/APTXHD
Jan 10 13:44:40 nixos-mainframe bluetoothd[1210]: Endpoint registered: sender=:1.45 path=/MediaEndpoint/A2DPSource/VENDOR/LDAC
Jan 10 13:44:40 nixos-mainframe systemd[2077]: Started Sound Service.
Jan 10 14:02:21 nixos-mainframe kernel: input: HD 450BT (AVRCP) as /devices/virtual/input/input35
Jan 10 14:02:21 nixos-mainframe systemd-logind[1102]: Watching system buttons on /dev/input/event28 (HD 450BT (AVRCP))
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (II) config/udev: Adding input device HD 450BT (AVRCP) (/dev/input/event28)
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) HD 450BT (AVRCP): Applying InputClass "Keyboard catchall"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) HD 450BT (AVRCP): Applying InputClass "evdev keyboard catchall"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (II) Using input driver 'evdev' for 'HD 450BT (AVRCP)'
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) HD 450BT (AVRCP): always reports core events
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) evdev: HD 450BT (AVRCP): Device: "/dev/input/event28"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (--) evdev: HD 450BT (AVRCP): Vendor 0xa Product 0x161
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (--) evdev: HD 450BT (AVRCP): Found keys
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (II) evdev: HD 450BT (AVRCP): Configuring as keyboard
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) Option "config_info" "udev:/sys/devices/virtual/input/input35/event28"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (II) XINPUT: Adding extended input device "HD 450BT (AVRCP)" (type: KEYBOARD, id 20)
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) Option "xkb_rules" "evdev"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) Option "xkb_model" "pc104"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) Option "xkb_layout" "us,cz"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (WW) Option "xkb_variant" requires a string value
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[1254]: (**) Option "xkb_options" "terminate:ctrl_alt_bksp"
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[6234]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[6234]: > Warning:          Unsupported high keycode 372 for name <I372> ignored
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[6234]: >                   X11 cannot support keycodes above 255.
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[6234]: >                   This warning only shows for the first high keycode.
Jan 10 14:02:21 nixos-mainframe xserver-wrapper[6234]: Errors from xkbcomp are not fatal to the X server

Additional Info.

When I log into none/xmonad session I'm able to use bluetoothctl to connect devices with working audio this is why I think the problem is KDE specific.

$ plasmashell --version
plasmashell 5.20.4

Notify maintainers @NixOS/qt-kde

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.87, NixOS, 21.03pre262347.257cbbcd3ab (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.10`
 - channels(marek): `"nixos-21.03pre262020.f211631c1cb"`
 - channels(root): `"nixos-21.03pre262347.257cbbcd3ab, nixos-hardware"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
turboMaCk commented 3 years ago

I'm still experiencing this problem even with the newer plasma version:

plasmashell --version
plasmashell 5.20.5
turboMaCk commented 3 years ago

Seems I managed to fixed by switching to the profile in System Settings:

image

It seems that for some reason the detection of profile under plasma selected the wrong one.

turboMaCk commented 3 years ago

Ok so it turned up this is not the root of the problem. It seems that for some reason under the plasma switching application output to device is simply not reliable. It gets into some sort of super position where it's not possible to play audio from applications to some output device and switching this using pavucontrol or system settings or using stops working. I was unable to identify why exactly or find any reliable workaround other than use other desktop environment. I'm not sure if this is nixpkgs specific or upstream problem so I'm going to reopen this issue for now.

Speaker test is working correctly but applications can't play from the device.

turboMaCk commented 3 years ago

In this instance I managed to fixed it by togging audio devices in configuration

image

It seems to me that this is some state synchronization issue. I'm not sure if it's specific to how plasma is configured under nixos or not though.

zarelit commented 3 years ago

Still happening to me with plasmashell 5.21.5 and system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.3.12, channels(root): "nixos-21.05.1408.9376bf7b342", channels(zarel): "nixpkgs-21.11pre301439.f9e81f7ad87", nixpkgs: /home/zarel/.nix-defexpr/channels/nixpkgs

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info