Bluetooth: Difference between revisions
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
* https://blog.oblivioncoding.pro/sony-wh-1000mx3-linux-fix/ |
* https://blog.oblivioncoding.pro/sony-wh-1000mx3-linux-fix/ |
||
:* However tip on headset-roles seems outdated (does not seem necessary). |
:* However tip on headset-roles seems outdated (does not seem necessary). |
||
* https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/604 |
|||
* See also [[Pipewire]]. |
* See also [[Pipewire]]. |
||
Line 46: | Line 47: | ||
# |
# |
||
sudo systemctl restart bluetooth.service |
sudo systemctl restart bluetooth.service |
||
</source> |
|||
;Media control |
|||
* [https://wiki.archlinux.org/title/MPRIS#Bluetooth MPRIS - archlinux] Here they say that WH-1000XM3 supports AVRCP, and that MPRIS-bluetooth is not required. It only requires to setup keyboard shortcuts. |
|||
:* Key is detected by <code>xev</code>. |
|||
:* In Gnome Settings - Keyboard, we can indeed register a custom shortcut with the headset tap as event (key is called '''Audio play'''). |
|||
:* ... however eventhough we can register an event, this event is never triggered (we still see an icon with circle + cross being displayed) |
|||
:* See [https://askubuntu.com/questions/1212823/media-keys-not-recognized-properly-or-consistently AskUbuntu] User reports various findings. Also one fix could be that some applications (Chrome...) were grabbing the event already. |
|||
* Volume control (swipe up / down), only works while Gnome Settings is opened. |
|||
* Tapping event. |
|||
: We start <code>dbus-monitor</code>, and tap on the right headset. We see: |
|||
<source lang="bash"> |
|||
dbus-monitor |
|||
# ... |
|||
# signal time=1651003988.635770 sender=:1.41 -> destination=:1.76 serial=3196 path=/org/gnome/Shell; interface=org.gnome.Shell; member=AcceleratorActivated |
|||
# uint32 121 |
|||
# array [ |
|||
# dict entry( |
|||
# string "timestamp" |
|||
# variant uint32 6735577 |
|||
# ) |
|||
# dict entry( |
|||
# string "action-mode" |
|||
# variant uint32 1 |
|||
# ) |
|||
# dict entry( |
|||
# string "device-node" |
|||
# variant string "/dev/input/event13" |
|||
# ) |
|||
# ] |
|||
# ... |
|||
</source> |
|||
:If we connect to given device, we get a string whenever we tap on the headset: |
|||
<source lang="bash"> |
|||
sudo cat /dev/input/event13 | xxd |
|||
# 00000000: 8653 6862 0000 0000 9822 0e00 0000 0000 .Shb....."...... |
|||
# 00000010: 0100 c800 0100 0000 8653 6862 0000 0000 .........Shb.... |
|||
# 00000020: 9822 0e00 0000 0000 0000 0000 0000 0000 .".............. |
|||
# 00000030: 8653 6862 0000 0000 ec4d 0e00 0000 0000 .Shb.....M...... |
|||
# 00000040: 0100 c800 0000 0000 8653 6862 0000 0000 .........Shb.... |
|||
# 00000050: ec4d 0e00 0000 0000 0000 0000 0000 0000 .M.............. |
|||
# ... |
|||
</source> |
</source> |
Latest revision as of 20:36, 26 April 2022
Bluetooth on Linux
- Lot of detailed information.
Bluetooth codecs
Some detailed information:
- Understanding Bluetooth codecs - SOUNDGUYS.
- The ultimate guide to Bluetooth headphones: Wired is still king for quality - SOUNDGUYS
- Mention the new SONY WH-1000XM3 !
- Including a long discussion on the support of SBC_XQ on PulseAudio, available patches, and faulty devices.
Tips
Sony WH-1000XM3
- Reference
- https://www.redpill-linpro.com/techblog/2021/05/31/better-bluetooth-headset-audio-with-msbc.html
- https://blog.oblivioncoding.pro/sony-wh-1000mx3-linux-fix/
- However tip on headset-roles seems outdated (does not seem necessary).
- Troubleshooting
bluetoothctl info 38:18:4C:4B:6A:3A
bluetoothctl info 38:18:4C:4B:6A:3A | grep -i battery
- Tips
- For better support, install latest pipewire wireplumber package.
- Best playback codec is SBC_XQ. Select it in Gnome setting - Sound, or through
pactl
:
pactl set-card-profile bluez_card.38_18_4C_4B_6A_3A a2dp-sink-sbc_xq
- For confcall, use the mSBC codec. Again select it Gnome settings - Sound, or:
pactl set-card-profile bluez_card.38_18_4C_4B_6A_3A headset-head-unit-msbc
- View headset battery level in Gnome settings - Power. This requires enabling the bluetooth expiremental API [1]:
sudo systemctl edit bluetooth.service
# Edit file as:
# (file is /etc/systemd/system/bluetooth.service.d/override.conf)
#
# [Service]
# ExecStart=
# ExecStart=/usr/libexec/bluetooth/bluetoothd --experimental
#
sudo systemctl restart bluetooth.service
- Media control
- MPRIS - archlinux Here they say that WH-1000XM3 supports AVRCP, and that MPRIS-bluetooth is not required. It only requires to setup keyboard shortcuts.
- Key is detected by
xev
. - In Gnome Settings - Keyboard, we can indeed register a custom shortcut with the headset tap as event (key is called Audio play).
- ... however eventhough we can register an event, this event is never triggered (we still see an icon with circle + cross being displayed)
- See AskUbuntu User reports various findings. Also one fix could be that some applications (Chrome...) were grabbing the event already.
- Key is detected by
- Volume control (swipe up / down), only works while Gnome Settings is opened.
- Tapping event.
- We start
dbus-monitor
, and tap on the right headset. We see:
dbus-monitor
# ...
# signal time=1651003988.635770 sender=:1.41 -> destination=:1.76 serial=3196 path=/org/gnome/Shell; interface=org.gnome.Shell; member=AcceleratorActivated
# uint32 121
# array [
# dict entry(
# string "timestamp"
# variant uint32 6735577
# )
# dict entry(
# string "action-mode"
# variant uint32 1
# )
# dict entry(
# string "device-node"
# variant string "/dev/input/event13"
# )
# ]
# ...
- If we connect to given device, we get a string whenever we tap on the headset:
sudo cat /dev/input/event13 | xxd
# 00000000: 8653 6862 0000 0000 9822 0e00 0000 0000 .Shb....."......
# 00000010: 0100 c800 0100 0000 8653 6862 0000 0000 .........Shb....
# 00000020: 9822 0e00 0000 0000 0000 0000 0000 0000 ."..............
# 00000030: 8653 6862 0000 0000 ec4d 0e00 0000 0000 .Shb.....M......
# 00000040: 0100 c800 0000 0000 8653 6862 0000 0000 .........Shb....
# 00000050: ec4d 0e00 0000 0000 0000 0000 0000 0000 .M..............
# ...