Bluetooth: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Bluetooth on Linux == * [https://wiki.archlinux.org/index.php/Bluetooth_headset Bluetooth headset - Archlinux wiki] : Lot of detailed information.") |
|||
(11 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
* [https://wiki.archlinux.org/index.php/Bluetooth_headset Bluetooth headset - Archlinux wiki] |
* [https://wiki.archlinux.org/index.php/Bluetooth_headset Bluetooth headset - Archlinux wiki] |
||
: Lot of detailed information. |
: Lot of detailed information. |
||
== Bluetooth codecs == |
|||
Some detailed information: |
|||
* [https://www.soundguys.com/understanding-bluetooth-codecs-15352/ Understanding Bluetooth codecs - SOUNDGUYS]. |
|||
* [https://www.soundguys.com/ultimate-guide-to-bluetooth-headphones-20019/ The ultimate guide to Bluetooth headphones: Wired is still king for quality - SOUNDGUYS] |
|||
: Mention the new SONY WH-1000XM3 ! |
|||
* [http://soundexpert.org/articles/-/blogs/audio-quality-of-sbc-xq-bluetooth-audio-codec Audio quality of SBC XQ Bluetooth audio codec - SoundExpert] |
|||
: 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). |
|||
* https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/604 |
|||
* See also [[Pipewire]]. |
|||
;Troubleshooting |
|||
<source lang="bash"> |
|||
bluetoothctl info 38:18:4C:4B:6A:3A |
|||
bluetoothctl info 38:18:4C:4B:6A:3A | grep -i battery |
|||
</source> |
|||
;Tips |
|||
* For better support, install latest {{deb|pipewire}} {{deb|wireplumber}} package. |
|||
* Best playback codec is SBC_XQ. Select it in '''Gnome setting - Sound''', or through <code>pactl</code>: |
|||
<source lang="bash"> |
|||
pactl set-card-profile bluez_card.38_18_4C_4B_6A_3A a2dp-sink-sbc_xq |
|||
</source> |
|||
* For confcall, use the mSBC codec. Again select it '''Gnome settings - Sound''', or: |
|||
<source lang="bash"> |
|||
pactl set-card-profile bluez_card.38_18_4C_4B_6A_3A headset-head-unit-msbc |
|||
</source> |
|||
* View headset battery level in '''Gnome settings - Power'''. This requires enabling the bluetooth expiremental API [https://www.redpill-linpro.com/techblog/2021/05/31/better-bluetooth-headset-audio-with-msbc.html]: |
|||
<source lang="bash"> |
|||
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 |
|||
</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> |
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..............
# ...