LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-10-2015, 04:14 PM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Rep: Reputation: 110Reputation: 110
Bluetooth on Audacious


I've been trying to have sound play on an external Bluetooth speaker. Without Pulseaudio. I most definitely do not want to mess with Pulseaudio.

After googling around, I settled on a sort of combination of these pages:

https://wiki.debian.org/Bluetooth/Alsa

http://linuxcommando.blogspot.com.br...bluetooth.html

http://linuxpixies.blogspot.com.br/2...s-without.html

http://stackoverflow.com/questions/1...out-pulseaudio

It wasn't very easy, but it finally works... on mplayer only:

$ mplayer -ao alsa:device=bluetooth "/path/to/file.mp3"
(music plays)

At least I know that Bluetooth works. It sounds great, too.

But I don't use mplayer for music, I use Audacious. Audacious was still playing through the notebook's built-in speakers so I opened File > Preferences > Output Settings > Output plugin: Preferences > PCM Device: and selected bt_audio.

I thought it would work, but when I try to play an mp3, Audacious complains:

snd_pcm_open failed: No such file or directory.

I've been googling a lot with no success. Everything I find is convoluted and doesn't seem to take my specific situation into account, i.e. Bluetooth works fine on mplayer, but not on Audacious.

In fact, I wish I could redirect ALL sound to the Bluetooth speaker. I just tried YouTube on the browser, and it uses the notebook's built-in speakers.

Any ideas?

Last edited by lucmove; 02-10-2015 at 04:20 PM.
 
Old 06-19-2016, 07:07 AM   #2
Gew
LQ Newbie
 
Registered: Nov 2009
Location: Kingston, Jamaica.
Posts: 24

Rep: Reputation: 6
Any updates on this?

I'm running Slackware 14.0 with ALSA. I hoped I could get my Bluetooth headphones working without Pulseaudio but most forum posts conclude I won't be able to, so now I've installed Pulseaudio as well as all deps. In blueman-manager, I manage to pair and connect to my headphones, but the default sound keeps coming from the laptop itself. Using pavucontrol, I select the Bluetooth headphones (listed) as fallback device, but then I get some snd_ related error from all major players, except for GUI Mplayer, that plays my video/audio just fine, with sound flowing through earphones. When running it from xterm for debugging, however, I get the same error codes, but this app somehow seems to fallback on something that works, whereas VLC, Audacious, XMMS (etc) won't. Now, I have managed to get sound in VLC too, just by adding "alsa-audio-device=bluetooth" to my ~/.config/vlc/vlcrc which was made in second. Feels like I'm pulling the stunt the wrong way, though, i.e. not even using Pulse, as intended. I still havn't gotten Audicious to work, which is my main goal. Please, help?!
 
Old 06-19-2016, 07:23 AM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Sorry, I can't help. I never found a solution. I've given up on Bluetooth completely.
 
Old 06-21-2016, 09:44 AM   #4
Gew
LQ Newbie
 
Registered: Nov 2009
Location: Kingston, Jamaica.
Posts: 24

Rep: Reputation: 6
Lightbulb

Hey, I finally made some progress!

It isn't by all means ideal, but at least it works.

Like I said, first, by putting a file called .asoundrc in ~/ containing the following...

pcm.bluetooth {
type bluetooth
device "xx:xx:xx:xx:xx:xx"
profile "auto"
}


..you get a ALSA device "bluetooth" that you can let certain players use e.g. VLC by commandline switch "vlc --alsa-audio-device bluetooth" but this is for VLC and I believe the problem lies in that the device is created first when you hook it up to Auda sink through blueman-applet and the device list in e.g. Audacious ALSA config does not automatically get repopulated. VLC allows one to chose device by CLI (entering it's name) rather than a GUI pulldown-menu like in Audacious.

Now, first I was happy, I thought that the moments I wish to use my Bluetooth headphones I might as well use VLC. But today I kept on experimenting with configuration. So, I tried another approach. I changed "pcm.bluetooth" -> "pcm.!default" in the .asoundrc file. Didn't even reboot or reinitialize ALSA afterwards, I just opened Audacious, and voila, sound suddenly came from my bluetooth headphones. In fact, all media playing apps now sends sound to my Bluetooth headphones. Games do too, everything do.

Now, since audio works fine on my laptop, playing from internal speakers or jack, both fully functional through ALSA Mixer without further config, I concluded that when I want audio through my Bluetooth headphones, I need that file, else not.

So, I'm no scripter but I assume that it would be a simple thing to write some BASH/SH lines that simply "name-toggles" back and forth .asoundrc <-> .asoundrc.disabled whereas needed.

Just though you could give this a try, since it's probably the same approach in your Debian system as in my Slackware. Of course, xx:xx:xx:xx:xx:xx shall be the address of your Bluetooth headphones. All your need for preparation is your headphones connected through blueman-applet, afterwards right-click your headphones to make sure "Audio sink" is enabled. I have a cheap BT dongle that I got off eBay, sometimes it fails to attach the Audio sink and I get error messages, then I just try again, sometimes I need to do it a couple of times before it actually connects, not really sure why. However, most of the times, it just connects and everything is in check.

So, simply (TL;DR) told:

If you're willing to give it a last try, just create ~/.asoundrc with the following (where xx:xx.. is your BD_ADDR) text inside, and launch Audacious. No need for Pulse audio whatsoever. I'm fairly convinced that it will work!

Code:
pcm.!default {
        type bluetooth
        device "00:02:5B:01:CF:F5"
        profile "auto"
}
Hope this will help someone else out there. I actually snatched this from Debian Wiki.
Attached Thumbnails
Click image for larger version

Name:	blueman-applet_bluetooth_headphones.png
Views:	108
Size:	55.0 KB
ID:	22163  
 
  


Reply

Tags
alsa, audacious, bluetooth



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No Bluetooth Tray Icon in lxde debian after installing gnome-bluetooth etc noalternative Linux - Software 2 05-11-2014 11:03 AM
Connecting Android device Bluetooth with external Bluetooth module . TheChronicScribbler Linux - Mobile 1 04-21-2014 04:01 AM
pithos - gstreamer trying to use bluetooth when no bluetooth device is installed shadowsnipes Slackware 0 10-30-2010 11:11 AM
Alternative to Audacious for eac cuesheets, midi playback (hardware)? Fix audacious? Holering Linux - Software 0 10-02-2010 11:19 PM
Bluetooth not working on FC6 with Targus USB bluetooth adapter mikevicious Linux - Software 1 12-11-2009 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration