Ubuntu 16.04 蓝牙耳机 - 无法将配置文件更改为 a2dp_sink [已关闭]

问题描述 投票:0回答:3

我有蓝牙耳机Sony WH-1000XM3和Ubuntu 16.04。 我已成功配对设备,但无法将配置文件更改为 a2dp。 无论我做什么,它都会失败,并显示消息“无法将配置文件更改为 a2dp_sink”。

我已经尝试过:

没有任何作用。 请帮忙。

一些信息:

  • bluez 5.37-0ubuntu5.1
  • pulseaudio 1:8.0-0ubuntu3.10

/etc/bluetooth/audio.conf

# Configuration file for the audio service
# This section contains options which are not specific to any
# particular interface
[General]
Enable=Gateway,Source

# Switch to master role for incoming connections (defaults to true)
Master=true

# If we want to disable support for specific services
# Defaults to supporting all implemented services
#Disable=Gateway,Source,Socket
Disable=Socket,Headset

# SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
# Defaults to HCI
#SCORouting=HCI

# Automatically connect both A2DP and HFP/HSP profiles for incoming
# connections. Some headsets that support both profiles will only connect the
# other one automatically so the default setting of true is usually a good
# idea.
AutoConnect=true

# Headset interface specific options (i.e. options which affect how the audio
# service interacts with remote headset devices)
[Headset]

# Set to true to support HFP, false means only HSP is supported
# Defaults to true
HFP=true

# Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
MaxConnected=2

# Set to true to enable use of fast connectable mode (faster page scanning)
# for HFP when incoming call starts. Default settings are restored after
# call is answered or rejected. Page scan interval is much shorter and page
# scan type changed to interlaced. Such allows faster connection initiated
# by a headset.
FastConnectable=true

# Just an example of potential config options for the other interfaces
#[A2DP]
#SBCSources=1
#MPEG12Sources=0

/etc/pulse/default.pa

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.nofail

### Load something into the sample cache
#load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/bell.oga
#load-sample-lazy pulse-hotplug /usr/share/sounds/freedesktop/stereo/device-added.oga
#load-sample-lazy pulse-coldplug /usr/share/sounds/freedesktop/stereo/device-added.oga
#load-sample-lazy pulse-access



/usr/share/sounds/freedesktop/stereo/message.oga

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available Matt remove tsched below
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
#load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
# Disable below if problems Matt
load-module module-suspend-on-idle timeout=30

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
#load-module module-role-cork

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

# X11 modules should not be started from default.pa so that one daemon
# can be shared by multiple sessions.

### Load X11 bell module
#load-module module-x11-bell sample=x11-bell

### Register ourselves in the X11 session manager
#load-module module-x11-xsmp

### Publish connection data in the X11 root window
#.ifexists module-x11-publish.so
#.nofail
#load-module module-x11-publish
#.fail
#.endif

### Make some devices default
#set-default-sink output
#set-default-source input

# automatically switch to newly-connected devices
load-module module-switch-on-connect

/usr/bin/start-pulseaudio-x11

#!/bin/sh

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

set -e

if [ x"$DISPLAY" != x ] ; then

    /usr/bin/pactl load-module module-x11-publish "display=$DISPLAY" > /dev/null
    /usr/bin/pactl load-module module-x11-bell "display=$DISPLAY" "sample=bell.ogg" > /dev/null
    /usr/bin/pactl load-module module-x11-cork-request "display=$DISPLAY" > /dev/null

    if [ x"$KDE_FULL_SESSION" = x"true" ]; then
       /usr/bin/pactl load-module module-device-manager "do_routing=1" > /dev/null
    fi

    if [ x"$SESSION_MANAGER" != x ] ; then
        /usr/bin/pactl load-module module-x11-xsmp "display=$DISPLAY session_manager=$SESSION_MANAGER" > /dev/null
        /usr/bin/pactl load-module module-bluetooth-discover
    fi
fi

/etc/bluetooth/main.conf

# Configuration file for the audio service
# This section contains options which are not specific to any
# particular interface
[General]
Enable=Gateway,Source

# Switch to master role for incoming connections (defaults to true)
Master=true

# If we want to disable support for specific services
# Defaults to supporting all implemented services
#Disable=Gateway,Source,Socket
Disable=Socket

# SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
# Defaults to HCI
#SCORouting=HCI

# Automatically connect both A2DP and HFP/HSP profiles for incoming
# connections. Some headsets that support both profiles will only connect the
# other one automatically so the default setting of true is usually a good
# idea.
AutoConnect=true

# Headset interface specific options (i.e. options which affect how the audio
# service interacts with remote headset devices)
[Headset]

# Set to true to support HFP, false means only HSP is supported
# Defaults to true
HFP=true

# Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
MaxConnected=2

# Set to true to enable use of fast connectable mode (faster page scanning)
# for HFP when incoming call starts. Default settings are restored after
# call is answered or rejected. Page scan interval is much shorter and page
# scan type changed to interlaced. Such allows faster connection initiated
# by a headset.
FastConnectable=true

# Just an example of potential config options for the other interfaces
#[A2DP]
#SBCSources=1
#MPEG12Sources=0

/etc/bluetooth/input.conf

# Configuration file for the input service

# This section contains options which are not specific to any
# particular interface
[General]

# Set idle timeout (in minutes) before the connection will
# be disconnect (defaults to 0 for no timeout)
IdleTimeout=0

# Enable HID protocol handling in userspace input profile
# Defaults to false (HIDP handled in HIDP kernel module)
#UserspaceHID=true
ubuntu bluetooth headphones a2dp
3个回答
5
投票

对我来说什么样的作品是以下顺序:

  1. 如果之前已配对,请从蓝牙设备中取出耳机
  2. 启用耳机的配对模式
  3. 打开蓝牙设置并单击添加
  4. 此时您可能已经看到一个名为
    LE_WH-1000XM3
    且类型未知的设备 - 请勿将其配对!
  5. 可以选择从设备类型过滤器下拉列表中选择耳机、耳麦和其他音频设备
  6. 等待,直到出现WH-1000XM3
    类型为
    耳机的设备
  7. 配对
  8. 运行Blueman(如果还没有安装),此时配对的耳机设备名称又以
  9. LE_WH-
    开头
  10. 右键单击设备并选择
  11. 设置
  12. 选择
  13. 音频接收器并单击下一步
  14. 直到此时我的耳机才对我说
  15. 蓝牙已连接,耶!设备名称更改为 WH-
    ,不带 
    LE_
     前缀(尽管您需要关闭并重新打开 Blueman 才能刷新列出的名称,但无论如何您都会在声音设置中看到)
  16. 转到声音设置并确保所选的播放音频设备是耳机(可能不是),并且模式
  17. 高保真播放(A2DP接收器)已选择(应该已经是)
短期内,当耳机以

LE_WH-1000XM3

 连接时,它们不起作用。无法在 Blueman 或声音设置模式中更改音频配置文件,实际上这里根本没有列出它们,即使它们作为音频设备连接(从第 6 点开始等待)。
当以 
WH-1000XM3
 连接时,所有音频功能都可用并且工作正常(就像 Linux 上的蓝牙音频“正常”一样)。仍然可能需要手动选择所需的音频配置文件,但这只是与整个耳机设置问题相比的一个小烦恼。

最糟糕的是,一旦我断开耳机并再次连接它们,无论我做什么,它们都会保持

LE_WH-1000XM3

。所以需要取消配对重新走一遍整个过程(╯°□°)╯︵┻⁄┻

额外信息:

LE

代表
低功耗蓝牙标准。我猜耳机以两种模式宣传连接:常规模式和 LE 模式。可以同时连接两者,但 Ubuntu 16.04 上仅支持一种音频。我想知道如何强制执行常规或完全禁用 LE 模式,因为它似乎总是回退到该模式,并且整个配对必须再次完成。


4
投票
我添加另一个答案,因为我还不确定这种方式的确定性如何。此外,这是一种损害与

低能耗传输设备连接的解决方法。

在我的机器上

/etc/bluetooth/main.conf

有以下属性:

# Restricts all controllers to the specified transport. Default value # is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). # Possible values: "dual", "bredr", "le" #ControllerMode = dual

要禁用低能量传输,我已取消注释并设置值:

ControllerMode = bredr

然后我重新启动蓝牙服务(或重新启动)并在系统蓝牙设置下再次配对我的索尼 WH-1000XM3。它立即起作用,甚至没有使用 Blueman 或我给出的其他答案中的任何其他断颈技巧。 显然,连接到名为

LE_WH-1000XM3

 的设备的问题现在不存在,因为笔记本电脑上的蓝牙主机不侦听任何 LE 设备。我希望这能永远解决这个问题。


0
投票
我也遇到过同样的情况。最终安装bluez-5.52完美解决了这个问题。据说是bluez之前版本的bug导致了这个问题。您只需下载源代码并运行即可

./configure make sudo make install sudo systemctl daemon-reload sudo service bluetooth restart
参考:

https://askubuntu.com/questions/1139404/sony-noise-cancelling-headphones-wh-1000xm2-3-and-bluetooth-initial-autoconnec

© www.soinside.com 2019 - 2024. All rights reserved.