41

So I have Ubuntu 18.04 installed on both my personal and work laptops and I am experiencing the same issue on both of them.

I have Sony WH-1000XM3 noise-canceling headphones and they are paired, everything is fine and working, the only problem is that whenever I turn them on and the auto-connect of the Bluetooth on Ubuntu kicks in and connects to them, they start sounding weird.

By weird I mean it's like Ambient sound is turned on, although the headphones are on Noise cancellation and the sound is really bad and quite.

The Issue, however, disappears when I disconnect and reconnect them manually.

Thanks in advance!

Update:

  • Using the solution that switches to A2DP solved nothing. The headphones do connect, but then it doesn't switch to them, the sound keeps playing on the speakers of the laptop. Trying to switch from and to the headphones couple of times also doesn't solve the problem.

  • Using the other solution with editing the /etc/bluetooth/main.conf results to the same issue. I did try even removing the device and pairing it again.

Relative SOLUTION:

  1. I had to install some other packages: sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev
  2. Install bluez-5.52 by building it from source. For details see the README + you have to run sudo make install http://www.bluez.org/release-of-bluez-5-54-and-5-53/
  3. systemctl daemon-reload
  4. sudo service bluetooth restart

Also note that this was on re-freshed Ubuntu 18.04, I kinda screwed up some dependencies and had to fix my OS by installing it fresh on top of the old one, before that I had some other old dependencies that didn't allow me to install bluez-5.52

Moop
  • 103
elpiel
  • 523
  • 2
  • 5
  • 15
  • I am experiencing exactly the same on Ubuntu MATE 18.04 with the 1000XM2 headphones. – marosg Apr 30 '19 at 13:51
  • 2
  • I have the exact same issue, unfortunately. – Gianluca Jun 24 '19 at 18:43
  • yeah, I am dealing with the same issue just like that — by removing the device (which is by default recognized as a headset) and then connecting it (it's recognized as "Bluetooth output" then). Quite a nuisance to do it every time when the headphones were powered off, but at least that works. Not sure I want to risk breaking my Ubuntu. I wonder, though, maybe it is possible to automate that remove-reconnect routine. – Passiday Feb 04 '20 at 18:25
  • 1
    I had the same problem on Ubuntu 20.04, switching to A2DP sink solved it – rivu Sep 11 '20 at 12:36
  • I have exactly the opposite issue. I'm on Ubuntu 20 and I can't switch to HSP/HFP, when I try it it just reverts back to some other configuration. – Arkanoid Sep 24 '20 at 13:33
  • This worked for me on Ubuntu 20.10 with a newer version of bluez as well. I originally had a 5.5x (I think 5.58) version installed. With that version, I was unable to switch to ad2p. Ofteh, my WH-1000XM3 didn't even show up as a headset unit (HSP/HFP) either. I followed the steps above, but for the latest bluez (http://www.bluez.org/release-of-bluez-5-60/). This has solved both issues :) – tjalling Jul 08 '21 at 09:27
  • I installed that "Bluetooth Manager" on ubuntu 21.10. It does not offer a "setup" menu item when you right click. And I could not see any other way to influence how any device gets recognised and categorized. The 1000XM3 are always an "unknown" device and hence do not appear in the ubuntu sound setup for selection. – hleg Feb 12 '22 at 17:52
  • Switching A2DP only works if your Sound Quality Mode for your headphones is set to Prioritize Sound Quality (Not Priority on Stable Connection). This is changed in the Sony Headphones android app under Sound. – Tvartom Jan 22 '24 at 14:51

9 Answers9

20

The "ambient noise" you're hearing is a loopback from your computer's mic coming out through your headphones.

This is apparently due to a bug with A2DP's implementation.

I fixed this in Ubuntu 19.04 by installing Blueman and pairing my headphones as an Audio Sink rather than a headset:

  • Unpair your headphones, if they're currently paired.
  • sudo apt install blueman
  • Open Blueman, click on "search".
  • Select your headphones, right click, select "Setup"
  • Make sure they're paired as an Audio Sink rather than a Headset
  • Select your headphones as an audio output in your sound settings

If you have Spotify open throughout the process you have to restart it.

  • Worked for me on 18.04 as well. – Kay Lamerigts Aug 16 '19 at 11:32
  • For me it didn't (18.04). It still autoconnects as headset... Is there anything else I need to disable as a service once I've installed Blueman? – elpiel Aug 23 '19 at 11:13
  • @elpiel disconnect through blueman, right click then click on a"connect - audio sink". Make sure A2DP is selected as the audio profile as well. – Pedro Palhares Aug 24 '19 at 12:18
  • 2
    @PedroPalhares still doesn't work. The first time I set it up it connects as audio sink, but then when I restart the headphones it gets recognised as Headset and "Bluetooth authentication" to accept it as headphones. I tried multiple times to set it up as Audio Sink, but this works only initially once I restart them it goes back to Headset and acts like no headphones are connected (Same as just using the Bluetooth setting from Ubuntu and setting it up with A2DP) – elpiel Aug 28 '19 at 15:16
  • Thanks, it worked for 18.04 with Sony wh-h900n – Suraj Oct 08 '19 at 06:18
  • This does not work for me, Sony WH1000XM4 auto detects as headphones and I cannot change it. – Vineeth Sai Apr 01 '21 at 06:22
16

I had exactly the same issue in Ubuntu 18.04 with Sony WH-CH700w. I used the solution offered by @Luiz: I installed bluez-5.52. Since I didn't want to spend my time on resolving dependencies, I just compiled it from scratch.

Step-by-step solution:

  1. download bluez-5.52 (or later) from here;
  2. unpack: tar -xf bluez-5.52.tar.xz
  3. go there: cd bluez-5.52
  4. configure: ./configure
  5. here I had libical missing. I installed it via sudo apt-get install libical-dev
  6. since my previous configuration failed, I did it again: ./configure
  7. compile: make
  8. install: sudo make install
  9. restart bluetooth machinery: sudo service bluetooth restart or just reboot your computer if you have a possibility: sudo reboot

That's it!

Important note: before restarting I returned my /etc/bluetooth/main.conf into the initial state, i.e. I commented out everything I've ever added there. In fact, I commented out everything.

Yury Kirienko
  • 326
  • 3
  • 10
  • Sadly since I use Ubuntu 18.04 there are dependency issues. I tried to fixed them and it ended up in breaking Ubuntu. – elpiel Jan 22 '20 at 06:28
  • As I mentioned in the other comment, after my re-fresh/install of ubuntu over the old one (after screwing dependencies) I managed to install bluez-5.52 by compiling it! I did have to install other dependencies though. This is not a full answer, but I will still mark it as solved! I installed: sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev In order to be able to compile bluez-5.52 from source. – elpiel Jan 22 '20 at 08:02
  • 1
    Also useful to run dmesg | grep -i bluetooth | grep -i firmware to check for firmware issues and install any missing firmware if that is part of the problem. – richardr Mar 28 '20 at 18:32
  • A question for Yury, I'm using Kubuntu 18.04 with the WF-1000XM3 and have installed that version of bluez but I have the problem where the audio is fine but the microphone is unusuable especially when trying to use it with Skype. – Steve Mapes May 14 '20 at 12:33
  • @SteveMapes unfortunately, I cannot recheck right now because of coronavirus (WFH, you know :-) But I cannot remember any issues with the microphone. – Yury Kirienko May 14 '20 at 14:10
  • Also worked on 20.04 and fixed a stranger bug where the sound was only mono on the left side. – David Beauchemin Jun 15 '21 at 17:40
  • Thank you so much! My last fight with Ubuntu 20.04 is months ago. Now I was motivated to try it again. Following this and installing another dependency missing for 20.04 with sudo apt install python-docutils it's connecting via bluetooth settings GUI and the sound is clear! Great! – Matthis Kohli Sep 21 '21 at 17:46
5

I had a similar issue. I had to disconnect the Headphones, remove the headset, redo the setup and than switch to A2DP in the sound setting. Disconnecting and reconnecting them was the crucial part - just switching the profile didn't change anything. I had to do this twice until it eventually worked.

Note that apparently A2DP is unidirectional, so you can't use the microphones with A2DP - if you need to use the microphone as well, you are stuck to crappy sound.

Mohl
  • 153
  • 1
  • 5
5

No workarounds needed

This problem is related to BlueZ and was fixed at version 5.52

Create a temporary folder, then download and install the updated packages using the following commands:

wget https://launchpad.net/ubuntu/+source/bluez/5.52-0ubuntu2/+build/18277594/+files/bluez_5.52-0ubuntu2_amd64.deb
wget https://launchpad.net/ubuntu/+source/bluez/5.52-0ubuntu2/+build/18277594/+files/libbluetooth3_5.52-0ubuntu2_amd64.deb
wget https://launchpad.net/ubuntu/+source/bluez/5.52-0ubuntu2/+build/18277594/+files/bluez-cups_5.52-0ubuntu2_amd64.deb
wget https://launchpad.net/ubuntu/+source/bluez/5.52-0ubuntu2/+build/18277594/+files/bluez-obexd_5.52-0ubuntu2_amd64.deb 
sudo dpkg -i *.deb

Worked just fine with my wh-1000xm2 at ubuntu 19.04.

For further information about the bug, see here

  • Do you know how to fix it on ubuntu 18.04, because I get dependency issues bluez-obexd depends on libc6 (>= 2.28); Version of libc6:amd64 on system is 2.27-3ubuntu1. bluez depends on libreadline8 (>= 6.0); Package libreadline8 is not installed. – elpiel Jan 13 '20 at 18:11
  • Thanks to @Luiz, problem kinda solved (in Ubuntu you never know what the next update will bring). In Ubuntu18, I downloaded the latest blues (5.52) and compiled and installed it. – Yury Kirienko Jan 14 '20 at 12:56
  • @YuryKirienko I tried, but I have those deps. problems that I don't know how to fix.... Any clue? – elpiel Jan 22 '20 at 06:29
  • Ok.... I tried compiling it myself after fixing dependency issues. I actually screwed up my whole Ubuntu last week in order to try and install it, now though, it worked (probably because of the reinstalled/fixed Ubuntu I didn't have the same dependency issues as last week) – elpiel Jan 22 '20 at 08:01
3

I recently bought a pair of sony wh1000xm3 and had similar issues, where either the sound was bad , or the sound in a2dp was in mono, coming through the left earpad only. Disconneting and Reconnecting did not worked for me.

this are the 2 things that i did that helped

1) ive disabled the touch controls through the mobile app, it did improve the chances of not going in low quality mode

2) install blueman via apt and set the device to connect to the a2dp sink

eventually the most stable solution was what other documented in this thread which is:

3) install bluez 5.52 which it will be default in ubuntu 20.04 but for the time being you can download it from the website http://www.bluez.org/ and follow the install instructions inside the zip file.

enjoy good quality sound!

1

Sorry... my english ir very bad! First, connect your sony wh1000mx3 to the phone and go to the sony app's (headphones) and put Quality Sound Mode.

This active the quality sound that ubuntu need.

Then, connect the Sony Headpones to the bluetooth and select, in the sound configuration Hight Fidelity Playback (LDAD, aptx, the one you prefer).

This is all. And yotu enjoy the Wh 1000mxx

1

I had a similar issue with my Sony headset. On turning the Computer Bluetooth ON and trying to connect the Headphones I kept seeing the Unable to Connect error. On further investigation, I found that the PulseAudio module and Bluetooth Manager were missing. I performed the following steps and it worked fine for me:

  1. Install the PulseAudio module on Ubuntu - sudo apt install pulseaudio-module-bluetooth
  2. Install Bluetooth Manager - sudo apt install blueman
  3. Start the Bluetooth Manager GUI - blueman-manager
  4. Switch ON your Sony Headphones and enable pairing mode. You will see your Headset listed within the BlueMan GUI
  5. Right click on the device within the BlueMan GUI and say Trust Device
  6. Right click on the device and choose Setup
  7. Go through the 6-step setup wizard to finish pairing your Headset.

All of the above is the initial setup and needs to be done only once. Every subsequent time the bluetooth connects automatically whenever you switch your headset ON.

abbasdgr8
  • 269
0

Regarding the issue of the sound still coming through the speakers - you can select which playback device sound should come from in the sounds settings.

See the screenshot in this question: How do you set a default audio output device in Ubuntu 18.04?

  • The problem with the headphones is that this does not work. It works with a speaker I have, I can just switch the output and it works. The headphones on the other hand seems like when I try to switch nothing happens. Headset is highlighted, but the Profile doesn't change and the sound continues coming from the speakers. – elpiel Dec 18 '19 at 11:19
  • Does it work if you connect it with the cable instead of bluetooth?

    I bought myself a Sony WH-1000XM3 after answering this question actually, and they work perfectly for me on Manjaro over bluetooth.

    I had a Sennheiser PXC 550 before, and couldn't get it to work over bluetooth no matter what I tried, on various distros. I had to resort to using the cable instead.

    – Albert Cloete Dec 19 '19 at 00:08
  • It works using a cable. It also works using Bluetooth as I mentioned, it's just having some issues on the first connection. So it's definitely a bug or some manual configuration needed issue. – elpiel Dec 30 '19 at 08:22
0

The PulseAudio Volume Control software seems to work for me. I am using Ubuntu 22.04 with Sony Wh-1000xm3.

First install the software with sudo apt install pavucontrol.

Then, open PulseAudio Volume Control and switch the Codec from LDAC(High quality) to LDAC(mobile quality).

Screenshot

karel
  • 114,770