LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   ALSA and bluetooth audio (https://www.linuxquestions.org/questions/slackware-14/alsa-and-bluetooth-audio-4175667326/)

Panagiotis Nik 01-08-2020 02:18 PM

ALSA and bluetooth audio
 
Hello,

Recently I received as a gift a bluetooth speaker. My Slackware64-current desktop (Xfce) is pure ALSA and when I first tried to connect with my speaker trough blueman-manager I received a “protocol error”.

Searching for a solution I founded that there's a program called "bluez-alsa" that offers integration between BlueZ >= 5 and ALSA.
There’s already a SlackBuild for "bluez-alsa" buit since it was outdated I tweaked it in order to install the latest version of "bluez-alsa" and then I was able to connect with my speaker.

After some changes in my asound.conf I was able to have sound in my speaker although they're some problems:
When I’m in youtube the only way to switch to an other sound source is to close the tab since to stop the player is not enough (I’m using Firefox as my browser.)
Also I need to add the output line in my xfce4-mixer since now is missing and there’s no option to adjust the sound level.

I’m wondering if somebody else using "bluez-alsa" and can share more information.

Didier Spaier 01-08-2020 04:18 PM

Caveat emptor: this post is OT as my setting is not pure-alsa.

Last month I received as gifts from my sons an USB sound board and a bluetooth headset.

As soon as I connect one of these devices it appears in the pavucontrol GUI in both Setup and Output devices tabs, so I can do what I want easily, like mute or unmute one of them, set its volume specifically etc.

I have nothing in /etc/asound.conf (no redirection to pulse) but have this setting in /etc/pulse/default.pa:
Code:

load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop

Just my :twocents:

EDIT. I almost forgot: I can do also many settings with a right click in the mixer applet of Mate Panel choosing Preferences. It has several tab: sound effects (set a sound alert and its volume), hardware (choose of the profile and test of the channels), input (choice of the device and input volume), output (setting of the volumes of the devices) applications (setting of the volume of the sound produced by each application).

Panagiotis Nik 01-09-2020 10:00 PM

Quote:

Originally Posted by Didier Spaier (Post 6076133)
I have nothing in /etc/asound.conf (no redirection to pulse) but have this setting in /etc/pulse/default.pa:
Code:

load-module module-alsa-sink device=dmix
load-module module-alsa-source device=dsnoop


Thanks for the suggestion. I already tried to add dmix in my asoundrc although without luck.

Quote:

Originally Posted by Didier Spaier (Post 6076133)
EDIT. I almost forgot: I can do also many settings with a right click in the mixer applet of Mate Panel choosing Preferences. It has several tab: sound effects (set a sound alert and its volume), hardware (choose of the profile and test of the channels), input (choice of the device and input volume), output (setting of the volumes of the devices) applications (setting of the volume of the sound produced by each application).

For the moment I made a small script to change from my headphones to the bluetooth speaker and vice versa since xfce audio mixer is missing the output.
Any way I'm very happy that I can have bluetooth audio without to use pulse :)

Didier Spaier 01-10-2020 04:02 AM

Quote:

Originally Posted by Panagiotis Nik (Post 6076542)
Thanks for the suggestion. I already tried to add dmix in my asoundrc although without luck.

The goal of these settings in default.pa is have pulse using the dmix alsa mixer so they only make sense if pulse is installed

Quote:

For the moment I made a small script to change from my headphones to the Bluetooth speaker and vice versa since xfce audio mixer is missing the output.
Any way I'm very happy that I can have Bluetooth audio without to use pulse :)
I just checked in XFCE 4.14. Same as in Mate 1.22: as soon as I switch on my Bluetooth headset the xfce4 mixer on the panel can handle it.

But feel free to make your life more complicated just to avoid installing pulse. :)

As an aside, I still didn't find in the many posts from pulse haters in this forum a rationale not to have it installed. I suspect that most just don't know how to properly set alsa + pulseaudio (+ optionally jack) for their use case. To learn it's worthwhile reading PulseAudio under the hood from Victor Gaydov.

Nille_kungen 01-12-2020 07:25 AM

You need pulse audio for bluetooth audio to work in current.
"bluez-alsa" didn't work with any bluetooth headphone or headsets last time that i tried but maybe it works better now.
I had problems with my computer hanging all the time when i tried to use bluetooth audio without pulse audio.

Bluez5 dropped alsa support.
https://git.kernel.org/pub/scm/bluet...328cb0b1ab0818
https://github.com/Arkq/bluez-alsa

Tonus 01-12-2020 09:24 AM

ALSA and bluetooth audio
 
@Didier :
I have pulse installed.
I find it overall complicated and hard to deal with.
I had lot of work to script the switch speakers/bt/jack. Nothing is simple with it and documentation is a pity.

That said, it works.

Panagiotis Nik 01-13-2020 09:12 PM

Quote:

Originally Posted by Nille_kungen (Post 6077449)
You need pulse audio for bluetooth audio to work in current.
"bluez-alsa" didn't work with any bluetooth headphone or headsets last time that i tried but maybe it works better now.
I had problems with my computer hanging all the time when i tried to use bluetooth audio without pulse audio.

Bluez5 dropped alsa support.
https://git.kernel.org/pub/scm/bluet...328cb0b1ab0818
https://github.com/Arkq/bluez-alsa

In my case bluealsa works with my speakers although there're some small glitches like the xfce audio mixer is missing the output line and I can have sound in Firefox in one tab at the time...

In order to load successfully bluealsa in my system (Slackware64-current) I made a script to start-stop bluealsa and restart rc.alsa at the same time instead an entry in rc.local (/usr/bin/bluealsa &) that was suggested by the SlackBuild.
With that way I can switch the sound between my bluetooth speaker and my headphones without a problem.

I believe that bluez-alsa is a project that needs more attention since after bluez dropped support for alsa one in order to have bluetooth audio in Slackare needs to install pulse audio.


All times are GMT -5. The time now is 12:02 AM.