Choose style:

Author Topic: Bluetooth problem : trying to adapt a debian solution  (Read 6140 times)

0 Members and 1 Guest are viewing this topic.

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #15 on: July 11, 2016, 09:40:10 am »
File was uploaded successfuly on TinyUpload.com server.

« Last Edit: July 12, 2016, 03:26:51 pm by pchan »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25708
  • Karma: 2821
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #16 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.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #17 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 ?

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #18 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.
« Last Edit: July 12, 2016, 11:31:20 am by pchan »

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #19 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.
« Last Edit: July 12, 2016, 11:49:55 am by pchan »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25708
  • Karma: 2821
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #20 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 ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #21 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 ....

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25708
  • Karma: 2821
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #22 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 :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #23 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.

« Last Edit: July 13, 2016, 08:48:12 am by pchan »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25708
  • Karma: 2821
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #24 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.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #25 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.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25708
  • Karma: 2821
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #26 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
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline pchan

  • nOOb
  • *
  • Posts: 14
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 7, peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #27 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!

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25708
  • Karma: 2821
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #28 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 :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline NomNomNom

  • nOOb
  • *
  • Posts: 4
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): peppermint 6
Re: Bluetooth problem : trying to adapt a debian solution
« Reply #29 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 and it worked.