如果我使用蓝牙,声音质量很差,或者麦克风无法工作。如果我尝试在声音设置的输入和输出选项卡中选择“耳机”选项,它们会同时禁用。
在输出选项卡中,我使用的是“高音质A2DP”,因为它可以改善声音质量。
我该如何让我的麦克风工作?声音输出正常。
正如之前指出的,A2DP是单向的,每次需要使用麦克风时,您必须切换到HSP配置文件。但是手动操作并不理想,并且除非应用程序为流设置media.role=phone
(大多数非VoIP应用都没有这样做),否则pulseaudio默认不会自动切换。
但是从Pulseaudio v. 11.0开始,可以在应用程序请求麦克风访问时自动切换配置文件,但默认情况下是禁用的。
/etc/pulse/default.pa
中找到load-module module-bluetooth-policy
行load-module module-bluetooth-policy auto_switch=2
现在,每当应用程序请求麦克风访问时,pulseaudio将自动将设备配置文件切换为HSP,并在关闭流后将其切换回A2DP。
您需要重新加载pulseaudio模块以使更改生效:
pulseaudio -D
时,出现了“E:[pulseaudio] main.c:Daemon启动失败。”错误。 - Yogi Katbasystemctl --user restart pulseaudio
。 - backslashNsystemctl --user restart pulseaudio
失败,显示 无法重新启动 pulseaudio.service: 单元 pulseaudio.service 被屏蔽。
- Peter虽然它不像安卓那样自动切换,但还是比待在巨无霸飞机仓库里要好一些!
/etc/pulse/default.pa
中找到load-module module-bluetooth-policy
行load-module module-bluetooth-policy auto_switch=2
mv ~/.config/pulse/ ~/.config/pulse.old
systemctl --user restart pulseaudio
The necessity to provide a modem to oFono makes the headset setup rather cumbersome. If you do not have a GSM/UMTS modem connected to your system (like in most desktop environments), you need a modem emulator. Unfortunately oFono does not allow to use a mobile (hfp modem, see below) as a modem to support headsets.
The best emulator choice is "phonesim" because there is a version that is maintained together with ofono. Most distributions contain a package ofono-phonesim or similar while the git version can be found at git://git.kernel.org/pub/scm/network/ofono/phonesim.git.
To set up phonesim, first create or edit the file phonesim.conf in /etc/ofono. It should contain the following lines:
[phonesim] Driver=phonesim Address=127.0.0.1 Port=12345
Restart oFono and check with list-modems if the phonesim modem was found. Start phonesim with
ofono-phonesim -p 12345 /usr/share/phonesim/default.xml&
The paths to phonesim.conf and default.xml might be different if you compiled ofono and/or phonesim from source. Now you can enable the modem either by using the enable-modem script or by issuing the following command:
dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"
list-modems should show that the modem is powered and online. If you want to play with the modem emulator, you can add the -gui option to the phonesim command. Then a GUI will pop up as soon as you enable the modem.
Once the modem is set up properly, you can connect your headset and the "Headset Head Unit (HSP/HFP)" profile should be available in pulseaudio.
apt-get
来安装,但是没有成功... - Arxeissqtdeclarative5-dev,qt5-default
。#!/bin/bash
# https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#index5h2
# https://git.kernel.org/pub/scm/network/ofono/phonesim.git
# to compile phonesim project, install these packages 'qtdeclarative5-dev,qt5-default'
# enable job control
set -m
# retrieve process in the form "7260/phonesim"
PHONESIM=$(netstat -antp 2>/dev/null | grep phonesim | awk '{print $7}')
# extract process id
PHONESIM="${PHONESIM/\/phonesim/}"
if [ -n "$PHONESIM" ]; then
echo killing old phonesim process [$PHONESIM]
kill -9 $PHONESIM
fi
echo "starting phonesim on port 12345"
phonesim -p 12345 /usr/share/phonesim/default.xml&
echo "enable modem"
exit_status=1
while [ $exit_status -ne 0 ]; do
sudo dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"
exit_status=$?
done
echo "restart bluetooth"
sudo service bluetooth restart
# MAC_ADDRESS=$(hcitool scan | grep "Galaxy Buds" | awk '{print $1}')
MAC_ADDRESS=D8:55:75:67:D1:68
while [ -z $MAC_ADDRESS ]; do
MAC_ADDRESS=$(hcitool scan | grep "Galaxy Buds" | awk '{print $1}')
done
sleep 5
echo "connect to Galaxy Buds [$MAC_ADDRESS]"
bluetoothctl <<< "connect $MAC_ADDRESS
quit"
echo "reattach to phonesim process"
fg
/lib/firmware/brcm/
中(正确命名),问题就解决了。sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
sudo apt-get update
sudo apt install pipewire pipewire-pulse \
pipewire-tests pipewire-locales gstreamer1.0-pipewire libspa-0.2-bluetooth \
libspa-0.2-jack pipewire-audio-client-libraries
sudo systemctl disable --global pulseaudio
sudo systemctl enable --global pipewire-pulse
$ pactl info | grep "Server Name"
Server Name: PulseAudio (on Pipewire 0.3.35)
blueman
:sudo apt-get install blueman