Last active
April 16, 2024 08:11
-
-
Save mss/73b6630a24d8fda23458af2aaddf890b to your computer and use it in GitHub Desktop.
Make the Ubuntu Zoom client automatically switch Bluetooth headset profiles to HSP/HFP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is a hack to make Bluetooth headests like the jabra Evolve 65 actually | |
# work as a headset with the Linux (Ubuntu/Debian) Zoom client without having | |
# to switch manually from A2DP to the HSP/HFP profile. | |
# | |
# This is done by injecting an environment variable which makes PulseAudio | |
# recognize the application as a telephony/voice application as described | |
# here: | |
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#profiles | |
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/ApplicationProperties/#pa_prop_media_role | |
# | |
# An alternative to this might be to adapt the desktop file instead as | |
# described here | |
# * https://gavv.github.io/articles/pulseaudio-under-the-hood/#autodetecting-properties | |
# | |
set -o errexit | |
set -o pipefail | |
test ! -f /opt/zoom/zoom.distrib | |
# Make sure sudo works and avoid password prompt for the following commands | |
sudo true | |
# Install the zoom wrapper script | |
sudo install -m 0755 /dev/stdin /opt/zoom/zoom.wrapper <<'EOD' | |
#!/bin/bash | |
ZOOM="$(dirname "$0")/zoom.distrib" | |
exec /usr/bin/env PULSE_PROP_media.role=phone "$BASH" -c 'exec -a "${0%.*}" "$0" "$@"' "$ZOOM" "$@" | |
EOD | |
# Move real zoom binary out if the way | |
sudo dpkg-divert --rename --add /opt/zoom/zoom | |
# Symlink zoom wrapper script in place | |
sudo ln -s zoom.wrapper /opt/zoom/zoom |
Thanks much for your help and yes the rollback worked fine.
…On Thu, Jul 29, 2021 at 10:24 AM Malte S. Stretz ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I ran the script successfully with bash. It forces the audio profile of my
bose bluetooth headphones to off. I can manually switch to headset, but it
won't switch to high fidelity even if I try to do it manually.
That's very interesting. Might be either an issue with your Bose headset
or the PulseAudio version on your Kubuntu. I use this on KDE Neon (which is
based on Ubuntu 20.04 bit IIRC has a backported newer PulseAudio package)
with a Jabra Evolve 65. It works mostly fine though sometimes it goes into
a hectic loop where it switches between the two profiles.
I hope the roll-back steps work for you.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/73b6630a24d8fda23458af2aaddf890b#gistcomment-3834617>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADIBH5E7EDA6XG5HBUFAMUTT2D63XANCNFSM5BDXPTUA>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's very interesting. Might be either an issue with your Bose headset or the PulseAudio version on your Kubuntu. I use this on KDE Neon (which is based on Ubuntu 20.04 bit IIRC has a backported newer PulseAudio package) with a Jabra Evolve 65. It works mostly fine though sometimes it goes into a hectic loop where it switches between the two profiles.
I hope the roll-back steps work for you.