Peppermint OS Community Forum

Support => Networking => Topic started by: NomNomNom on April 04, 2016, 08:33:01 am

Title: Bluetooth problem : trying to adapt a debian solution
Post by: NomNomNom on April 04, 2016, 08:33:01 am
Hi,

I'm having trouble getting my bluetooth headsets to work on Peppermint running on my netbook. I've had the exact same problem on debian on my laptop and managed to fix it using the Troubleshooting part of this tutorial (https://wiki.debian.org/BluetoothUser/a2dp) :

Quote
Troubleshooting

Bluetooth headset is connected, but ALSA/PulseAudio fails to pick up the connected device or there's no device to pick. This happens because GDM captures A2DP sink on session start, as GDM needs pulseaudio in the gdm session for accessibility. For example, the screen reader requires it.

In order to prevent GDM from capturing the A2DP sink on session start, edit /var/lib/gdm3/.config/pulse/client.conf (or create it, if it doesn't exist):

Code: [Select]
autospawn = no
daemon-binary = /bin/true

After that you have to grant access to this file to Debian-gdm user:

Code: [Select]
# chown Debian-gdm:Debian-gdm /var/lib/gdm3/.config/pulse/client.conf

In order to auto-connect a2dp for some devices, add this to /etc/pulse/default.pa:

Code: [Select]
load-module module-switch-on-connect

Reboot.

Now the sound device (bluetooth headset) should be accessible through pavucontrol and standard audio device manager.

I found out that the /var/lib/gdm3/.config/pulse/client.conf file was actually located in /etc/pulse/client.conf in Peppermint but I'm stuck at the second part. The Debian-gdm user doesn't seem to exist or it's name is different in Peppermint. :-\
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on April 04, 2016, 09:15:18 am
We don't have GDM so it's not going to be the same problem

Does running
Code: [Select]
sudo pactl load-module module-bluetooth-discover
then trying to pair the headset work ?
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: NomNomNom on April 04, 2016, 09:41:31 am
Ok. I thought, even thought these are different distros, the problem would have a similar origin. Thank you for the information.

Does running
Code: [Select]
sudo pactl load-module module-bluetooth-discover
then trying to pair the headset work ?
I get this :
Code: [Select]
Failure: Module initialization failed
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 10, 2016, 10:04:43 am


Does running
Code: [Select]
sudo pactl load-module module-bluetooth-discover
then trying to pair the headset work ?

I am also having the same problem with bluetooth audio after peppermint 7 did an update.
before updaing, the audio of my headset worked after doing this :
     
                  sudo pactl load-module module-bluetooth-discover

  after update ..., headset audio stopped working. Bluetooth was connected and volume mixer indicated hi fidelity profile. But vlc , even though set to output via headset, cannot give out any sound.


tried in terminal : sudo pactl load-module module-bluetooth-discover

But,

Failure: Module initialization failed

Hope this can be solved because peppermint 7 is really nice. In peppermint 6, bluetooth headset audio worked without any problem at all.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 10, 2016, 05:12:12 pm
Try the solution with the green tick here
https://askubuntu.com/questions/689281/pulseaudio-can-not-load-bluetooth-module-15-10-16-04
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 11, 2016, 07:16:43 am
PCNetSpec

Thanks for the quick reply.

I have already tried editing ....

" ..... /etc/pulse/default.pa

and comment out (with an # at the beginning of the line) the following line:

#load-module module-bluetooth-discover

now edit the file:

/usr/bin/start-pulseaudio-x11 ..."

Unfortunately, it didn't work for me so I have changed the "default.pa" and "start-pulseaudio-x11" back to their oriiginal state.


In the latest version of Linux lite, they made it work by adding a "audio.conf" file in the "/etc/bluetooth/..."    folder.
Bluetooth pulse aidion was already in the distro.

As for me, I am used to peppermint 6 and I think i like peppermint 7 more than linuxlite. If there is no way to solve the bluetooth problem for peppermint 7, i will most probably reinstall peppermint 6 again. Peppermint 6 is simply amazing and everything works in my 3 laptops. The only complaint is limited features of the lxde start menu. tried cardpio but a bit buggy to my liking.

If possible, I would like to stay with peppermint 7. I just wonder how they managed to make bluetooth pulse audio to work fine in linuxlite. Could it be they are using the older version of bluetooth pulse audio??? hmmmm ...
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 11, 2016, 07:30:39 am
My problem is (for the time being) I don't have anything to test a2dp with, so I don't know how much help I can be :(

I'll download Linux Lite and see if I can make sense out of any changes they've made .. but it may be a day or two.

You're talking about Linux Lite 3.0 right ? .. or 2.8 ?
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 11, 2016, 07:44:25 am
Thanks! Your kind efforts to help itself  is greatly appreciated.

Yes. Linuxlite 3. and in their network support forum, someone posted the solution to solve the bluetooth audio problem. The solution was to create a file called "audio.conf" ..... It worked well when i installed linuxlite 3 just to try out. After testing it, I have removed linuxlite 3 and reinstalled peppermint 7. Hopefully, there is a solution for peppermint 7. I do own a bluetooth headset that is on the cheaper end but the sound is great and i really enjoy using my bluetooth headset.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 11, 2016, 08:07:50 am
Have you seen the posts #35 and #36 here
https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/1438510

there's a script that downloads these files
Code: [Select]
wget http://snapshot.debian.org/archive/debian/20160609T170130Z/pool/main/g/gst-plugins-good1.0/gstreamer1.0-pulseaudio_1.8.2-1_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/j/json-c/libjson-c3_0.12-3_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/p/pulseaudio/libpulse0_8.0-2%2Bb2_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/p/pulseaudio/libpulsedsp_8.0-2%2Bb2_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/p/pulseaudio/libpulse-mainloop-glib0_8.0-2%2Bb2_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/p/pulseaudio/pulseaudio_8.0-2%2Bb2_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/p/pulseaudio/pulseaudio-module-bluetooth_8.0-2%2Bb2_amd64.deb

wget http://snapshot.debian.org/archive/debian/20160419T163343Z/pool/main/p/pulseaudio/pulseaudio-utils_8.0-2%2Bb2_amd64.deb
and suggests installing them over the Ubuntu versions after stopping pulseaudio.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 11, 2016, 08:11:40 am
@NomNomNom

have you installed
Code: [Select]
sudo apt-get install pulseaudio-module-bluetooth
yet ?
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 11, 2016, 08:17:14 am
PCNetSpec

Yes, I have the latest version of pulseaudio-module-bluetooth

I logged off for a moment to try

creating an "audio.conf" file and place it in /etc/bluetooth . After rebooting, i tested my headset but unfortunately it didn't work. I have removed the "audio.conf" file.

I will try  the "https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/1438510" solution and report back.

Thanks
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 11, 2016, 08:45:30 am
Quote
Cyril Humbert (cyril-h5t) wrote on 2016-07-09:    #36

Updated procedure for comment #35, allowing to install more easily
Debian Testinf pulseaudio package on Ubunutu 16.04.

 1. Stop pulseaudio. Then, backup and purge pulseudio user conf files.

 2. Install pulseaudio Debian Testing (June 2016) packages over Ubuntu
    pulseaudio packages. This will appear as a kind of downgrade. See
    get-pulseaudio8-debian-amd64.sh script. If you use
    pulseaudio-module-x11 too, use the corresponding Debian Testing
    version too to satisfy dependencies.

 3. Restart.

 4. A2DP profile should now work as expected with the default
    BlueZ, pulseaudio configuration. Use pavucontrol to select
    A2DP profile if needed.

I have already downloaded the 8 files  from debian using wget ... instead of using the "get-pulseaudio8-debian-amd64.sh" script which i don't know where to find it.

I am not sure how to do this step >  backup and purge pulseudio user conf files.

Stopping pulseaudio is as simple as > killall pulseaudio ... right?

Also, this line, "If you use pulseaudio-module-x11 too, use the corresponding Debian Testing version too to satisfy dependencies" ...  is confusing to me.

Or should I wait a few days before messing up my newly installed peppermint 7. Maybe, you might find something in linuxlite 3. Or could i not simply purge the current version of "pulseaudio-module-bluetooth" and reinstall the version that was used in peppermint 6? Everything was working well in peppermint 6.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 11, 2016, 08:53:12 am
Gimme a day or two and I'll spin up a PM7 VM and test the debian downgrade instructions .. though at the end of the day I can only provide downgrade INSTRUCTIONS, I can't test if they'll give you working a2dp, as I said I've no hardware to test it with.

I doubt if downgrading just pulseaudio-module-bluetooth from peppermint 6 would work.

and IIRC, stopping pulseaudio was a bit more complex than just "killall pulseaudio", you had to disable "respawn" first.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 11, 2016, 09:18:32 am
Thanks PCNetSpec

Please take your time. I can wait a few days. I will just use my plugged in earphones for the moment. The concept of peppermint 7 is the most impressive I have ever come across and I love it. I also love peppermint 6 and will have no problem going back to it and live with the old start menu it the bluetooth audio thing don't work out so well in ubuntu 16.04 based peppermint7 yet. The bluetooth audio worked after an immediate install of peppermint 7 and after installing the

pulseaudio-module-bluetooth

It was after doing an update that the bluetooth audio stoped working. So, it looks like  some updates from ubuntu 16.04  messed up the bluetooth pulse audio. If i didn't do an update, the bluetooth audio will still be working fine. but it will be at the cost of not doing updates.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 11, 2016, 09:29:57 am
That's handy to know.

Can you run:
Code: [Select]
zip -r ~/Desktop/apt.zip /var/log/apt
then host the file called "apt.zip" from your desktop somewhere online such as:
http://www.tinyupload.com/
and post a link to it

So I can get an idea of what's been updated.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 11, 2016, 09:40:10 am
File was uploaded successfuly on TinyUpload.com server.

Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 11, 2016, 02:17:58 pm
Have you tried booting the earlier kernel and seeing if bluetooth works again .. there's always a chance it's simply a kernel regression after you updated your kernel.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 12, 2016, 12:02:12 am
just tried logging in with earlier kernel

uname -a
..... 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Unfortunately, it didn't work.

Tried to ...
pactl load-module module-bluetooth-discover

failed again to load.

Searching around I came across this ...

Quote
I've had the same problem with Jaybird X2 and Bluebuds X, although other Bluetooth audio devices worked without problems. With the headphones, I got this error:

Assertion 'pa_channels_valid(channels)' failed at pulse/volume.c:74, function pa_cvolume_set(). Aborting.

and pulseaudio crashed. What solved it was installing pulseaudio from sources:

    Install all required packages: sudo apt-get build-dep pulseaudio
    Download https://freedesktop.org/software/pulseaudio/releases/pulseaudio-9.0.tar.gz and unpack.
    In the source dir, run: ./bootstrap.sh --prefix=/usr. If you want, you can change the CFLAGS variable to enable compiler optimizations, e.g. use -O2 instead of -O0.
    Then, make and sudo make install




This will overwrite the default system installation, but it will work until packages get updated. To prevent updates, we can put the pulseaudio packages on hold:

sudo apt-mark hold libpulse-dev libpulse0 libpulse-mainloop-glib0 pulseaudio pulseaudio-module-bluetooth pulseaudio-utils libpulsedsp pulseaudio-module-x11

Note that I installed pulseaudio 9.0, but it is not the version that made it work. I tried using the packaged version of pulseaudio 9.0 from the PPA, but it also crashed with the same error.

What interst me was this ....

Quote
.... but it will work until packages get updated. To prevent updates, we can put the pulseaudio packages on hold:

sudo apt-mark hold libpulse-dev libpulse0 libpulse-mainloop-glib0 pulseaudio pulseaudio-module-bluetooth pulseaudio-utils libpulsedsp pulseaudio-module-x11

As a non expert in linux, I don't  have the abilities to follow the compiling instructions yet ...

but I think I don't have problem reinstalling  peppermint 7 and then while Bluetooth audio is working, to issue the command that will prevent updates of pulse audio pakages with

sudo apt-mark hold ......

Any suggestions ?
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 12, 2016, 11:27:49 am
A solution is almost found. Will continue to try out for a few days before confirming that what I did worked.

First of all, I was wrong about saying that the updates from ubuntu 16.04 caused of the problem to bluetooth pulseaudio module.

Why i know. Long story.

But it might help others or the peppermint team so in my unprofessional way, i will try to explain the crazy steps i tried.

I reinstalled peppermint 7. Yes, I wanted to just deal with bluetooth audio issue and nothing else.

So, the first thing i did after peppermint 7 started up clean for the first time ....

connect to the internet ...

sudo apt-get update
sudo apt-get install pulseaudio-module-bluetooth

reboot pc

Although update software was indicating that updates were available ... i did not do the updating ... ( i thought the updating broke my bluetooth audio  but later i found out that I was wrong )

Ok, I then switched on my bluetooth headset and set it to pairing mode. ... Launched bluetooth manager and clicked on setup. Device paired happily and I looked for a music file to do a test. The test was successful and vlc played with sound after configuring vlc to output through the name of my bluetooth headset.


In the volume settings, I could choose either headset (HSP/HFP) or High Fidelity (A2DP sink) or OFF.  I set it to high fidelity.

Then i shutdown laptop. After restarting the laptop and log into peppermint 7, I switched on my BT headset. Automatically, the headset was detected and connected.

I then tried playing a music file using vlc player. To my surprise, no sound no matter what i tried. Ocassionally, by setting it to HSP/HFP, i could get some sound but the sound wasn't smooth. In high fidelity mode, no sound at all. ( I then understood that the problem was not caused by updating because i had not updated anything yet. )

In linuxlite 3 forum, they solved it by creating a file called audio.conf in the /etc/bluetooth directory. I tried creating the file according to the instructons given over at linuxlite forum but unfortunately, it didn't work.

(I tried a few other things ..... but anyway I will just go on to what i finally did to get BT headset to work.)

Okay, what i did was I backed up all the files in /etc/bluetooth directory and i then copied files from peppermint 6 (/etc/bluetooth) over to peppermint 7 /etc/bluetooth. Crazy idea huh!

i then compared the /user/bin/start-pulseaudio-x11 file in peppermint 7 with /user/bin/start-pulseaudio-x11 file in peppermint 6.

in the /user/bin/start-pulseaudio-x11 file of peppermint 7, I deleted

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

because the /user/bin/start-pulseaudio-x11 file in peppermint 6 didn't contain these lines.

In volume settings, I set to OFF mode ....

reboot laptop



Now, something is happening. As i say, i will test it out for few more days .... before confirming that my BT audio problem is solved.

Anyway, this is just my unprfessional attempt. Might or might not be useful i don't know. But I love peppermint 7.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 12, 2016, 11:46:27 am
Wow  ... I just switched off and switched on for the 3rd time to see if it still works. And it works !!

Thanks to peppermint 6. Peppermint 6 was a real winner! .. a very high standard to live up to ...!

At the moment after using bt headset, I still set the volume settings to OFF mode ...

Later on, i will try to keep it in high fidelity mode and see how it goes ... In peppermint 6, no problem with that.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 12, 2016, 01:36:30 pm
I doubt if the bit you removed from "/user/bin/start-pulseaudio-x11" made any difference .. that jwon't do anything unless you're running KDE

But it'd be interesting to see what differences are in /etc/bluetooth between PM6 and PM7

any chance you can archive your working /etc/bluetooth contents and host the archive online somewhere so I can download them and take a looksee ?
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 12, 2016, 03:45:02 pm
Contents from peppermint 6 ...

http://s000.tinyupload.com/index.php?file_id=02904693435717133663

Maybe some of the configuration files already exist in peppermint 7 and are exactly the same ... but anyway i just copied everything over ...

It works i don't know why ....

The method from linuxlite 3 forum worked for linuxlite but could not work for peppermint 7.

actually, the only file that was missing in peppermint 7 was the audio.conf ... rfcomm.conf ... serial.conf ...

I hope i haven't done anything harmful to my peppermint 7 installation....

Like i say, i don't know why or which of the steps made it work.

the copying of the files from peppermint 6 ???

the regular habit of remembering to set the headset mode to OFF  everytime after use ???

As you say, i can rule out the deletion of kde lines in start-pulseaudio-x11 ....

Thanks for checking ....
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 12, 2016, 04:17:57 pm
Thanks for that.

I'm not suggesting you've broken anything .. I just wanted to see the difference for my own curiosity and to see if can help others :)
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 13, 2016, 07:51:01 am
Hi PCNetSpec,,

I have something interesting to report again.

Last night , after finish using bluetooth headset, I forgot to change the bt headset mode to OFF and left it in High Fidelity in the volume setting.

This morning when i logged in, I switched on my BT headset, device connected ... i gave a quick checked on volume settings and it was on High fidelity mode. Started to play a music file using vlc .... surprised to find that there was NO sound coming through the headset.

I then set the bt headset mode to OFF .... switched off headset and shutdown laptop.

Restarted laptop and switch on BT headset. Device was connected successfully as usual. I then went to volume settings and change the bt headset from OFF mode to high fidelity mode. Started playing a music file and .... YES ... sound was coming through headset beautifully.

What do you make of it?

It looks as if it doesn't release something automatically if i don't manually set bt headset to OFF mode in volume settings each time after use .... ??

Well, not a problem for me really ... the result of getting sound if i  followed the right procedures was consistent. It means i don't have to go back to peppermint 6. I can start nstalling favourite programs in peppermint 7 and use peppermint 7 from now onwards.

Just reporting. you might have some idea what is happening and ideas about how to improve on it for next upgrade.

I am happy to live with manually doing the OFF ... for now.

Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 13, 2016, 02:27:57 pm
I've still got to make time to look into this, but it's gonna be hard (impossible ?) unless I can borrow some bluetooth headphones.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 16, 2016, 04:54:15 am
Bluetooth audio continues to work well consistently as long as I manually switch bt headset to off mode in pulse audio volume setting before changing it to high fidelity.

I also found out that there is no need to replace what files there are in /etc/bluetooth folder of peppermint 7. I only need to add in 3 misisng files which are :

audio.conf ...
rfcomm.conf ...
serial.conf ..

In this regard, I consider my Bluetooth audio problem is solved but since i didn't stat this thread i cannot mark it as solved.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on July 16, 2016, 06:17:22 am
Check if you can loose
rfcomm.conf
and
serial.conf

The only one of those  files that has any uncommented lines is:-
audio.conf
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: pchan on July 17, 2016, 03:12:29 am
PCNetSpec,

You're right.

I deleted

rfcomm.conf
and
serial.conf

shutdown and restart ...

My Bluetooth headset  still works ... as long as I manually change back to OFF mode whenever I finish using my BT headset. Then turning it back to high fidelity mode the next time I need to use BT headset.

Nice! Being able to use BT headset in peppermint 7 is no longer an issue to me.

Thanks!
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on August 10, 2016, 01:54:17 pm
Just tested some bluetooth headphones in Peppermint 7 and they worked out of the box (well at least the bluetooth side of things did)...

Well they **nearly** worked out of the box...

a) I had to install
Code: [Select]
sudo apt-get install pulseaudio-module-bleutooth

I then found they would pair but not connect

I later discovered they'd pair and connect if wireless was disabled .. I have a rtl8723be wireless card that doesn't like doing both wireless and bluetooth on the default drivers, so I also had to

b) add a PPA for updated rtl8732be drivers (dkms)
Code: [Select]
sudo add-apt-repository ppa:hanipouspilot/rtlwifi
then
Code: [Select]
sudo apt-get update
then
Code: [Select]
sudo apt-get install rtlwifi-new-dkms linux-firmware
then REBOOT.

Then both wifi and bluetooth would coexist :)
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: NomNomNom on December 21, 2016, 03:20:09 pm
Hi, I started this topic but actually my problem had a much simpler solution than I thought. First off, I have Peppermint 6 installed so it's different from pchan's problem. Anyway, I followed the instructions given in the first answer here (http://askubuntu.com/questions/634382/bluetooth-speaker-pairs-but-wont-connect) and it worked.
Title: Re: Bluetooth problem : trying to adapt a debian solution
Post by: PCNetSpec on December 22, 2016, 12:11:29 pm
Cool, thanks for your solution