蓝牙扬声器:首选模式“高保真播放”(A2DP)未保存
更新2017年8月:标记为我接受的解决方案已经工作到Ubuntu 15.10。 16.04+选择最新的解决方案之一。
对于16.04+,配置文件是/etc/bluetooth/main.conf
NOT /etc/bluetooth/audio.conf。
我有一个蓝牙音箱,索尼SRS-BTX300,在linux / ubuntu 13.04上工作,但只是在一些摆弄之后。 (2013年12月更新:同样的问题仍然存在于13.10)
每次打开电脑并重新连接扬声器后,我必须将首选带宽模式设置为“高保真播放”(A2DP)。
模式每次都重置为“电话/双工”(=低带宽)。 重置扬声器需要大约20次点击(点击菜单,断开连接,重新连接,选择模式,测试),这些肯定是太多的点击。
如何将“A2DP”模式设为默认模式,以持久的方式进行?
一些屏幕截图将说明。
通过单击Unity顶部面板中的蓝牙图标选择此菜单后…
设置完毕后……
…重新启动/暂停计算机后,首选模式将重置为此模式
在/etc/bluetooth/audio.conf
有一个选项叫做AutoConnect=true
,它被删除了。
sudo nano /etc/bluetooth/audio.conf
删除AutoConnect = true行开头的“#”
我发现启用此选项是通过删除#
并使我的蓝牙耳机正确连接
重新启动蓝牙服务以使更改生效:
sudo service bluetooth restart
/etc/bluetooth/audio.conf
添加到/etc/bluetooth/audio.conf
:
[General] Disable=Headset
然后运行此命令:
sudo service bluetooth restart
线程:( Natty)仅连接蓝牙耳机的A2DP配置文件。
对于那些想知道的人,我在Ubuntu 16.04中发现答案略有不同:
sudo gedit /etc/bluetooth/main.conf
并更新以下行
#AutoEnable=false
至
AutoEnable=true
其次是
sudo service bluetooth restart
对我来说,当连接蓝牙音频设备时,这会将音频配置文件默认为A2DP接收器。
我正在使用Gnome3,过了一段时间我的耳机再也无法连接到A2DP。 我不得不通过创建文件/var/lib/gdm3/.config/pulse/client.conf
(以root身份)并向其添加以下行来停止Gnome创建pulseaudio守护程序:
autospawn = no daemon-binary = /bin/true
然后将所有者设置为gdm:
sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf
然后注销/打开或查找使用ps aux | grep pulse
作为gdm
用户运行的pulseaudio进程 ps aux | grep pulse
(修剪)输出看起来像:
gdm 2943 10616 ? S
然后使用kill
杀死进程,对我来说这是2943
运行bluetoothctl
并再次连接,然后我可以运行pacmd list-cards
并找到我的设备index: 2
并使用pacmd set-card-profile 2 a2dp_sink
切换到pacmd set-card-profile 2 a2dp_sink
。
终于再次工作了!
为了在Ubuntu 14.04中连接时自动将音频切换到A2DP蓝牙设备,我按照https://sandalov.org/blog/2146/的说明完成了它。
修改/etc/pulse/default.pa
以自动将pulseaudio接收器切换到Bluez:
.ifexists module-bluetooth-discover.so load-module module-bluetooth-discover load-module module-switch-on-connect # Add this .endif
修改/etc/bluetooth/audio.conf
以自动选择A2DP配置文件(而不是HSP / HFP):
[General] Disable=Headset # Add this
应用更改:
pulseaudio -k # Restarts pulseaudio sudo service bluetooth restart # Restarts BT
更多信息请访问: https : //wiki.archlinux.org/index.php/Bluetooth_headset