Output Bluetooth Audio


sparkymark79

Member
Joined
Jun 10, 2009
Messages
185
So I apologise if this has been answered elsewhere but I could never find a definitive answer. I REALLY REALLY REALLY REALLY REALLY want to output bluetooth audio via my Pandora. Has anybody achieved this yet and is there an 'easyish' way to do this.


I use ncmpcpp4P as the player which is awesome by the way, thanks to Remogatto for getting it working. Once you know the keyboard shortcuts it is very quick and easy to use. In fact the only thing it is missing for me (apart from a way to scroll through the directories quicker) is bluetooth audio.


Has anybody written a script or something I can click on via mini menu/XFCE prior to opening ncmpcpp4P which will allow the audio to output via bluetooth, and then when I have finished click it again to set the audio back to internal speakers/headphones? Or any other way of getting it working?


Fingers crossed!
 
I can output BT audio to a Creative D100 speaker via only Exaile, Mplayer and Panplayer. the latter 2 suffer from an inability to make any playback adjustments without the audio stalling completely, whereas Exaile will at least let you change tracks but lacks forward/reverse etc. To my limited knowledge no other applications currently allow for BT playback (although I havent managed to get OMMPC player to work). No games/emus etc offer Bt output to my knowledge either.


The problem should be cured in the next version of the OS called Yars rather than Zaxxon or any of its HF's. Correct me here folk but iirc, they are incorporating Bluez or something, which will give far better control of BT protocols, and playback, rather than Alsa/Pulseaudio iirc which is why there can also be issues with even pairing various BT devices. For example I can pair but not connect to a set of BT headphones and several other people who even bought very expensive audiophile BT headphones cannot get them to connect correctly at present.


In time this will be sorted out hopefully :)


edit : MinAmp also gives BT output (because its Mplayer frontend based again) but any attempt to use any controls completely locks it up. Which reminds me I must post pnd-run-output files to the author about that.


Edit2 : Anyway, after much messing about of what should be simple via Pandora or Windows (plus baby feeding and holiday chaos :) ) here is the file you need http://www.megaupload.com/?d=K9TLY4AH


Download this and goto your 'Home' username folder in Thunar.


Press Ctrl+H to see Hidden files.


You'll see a .asoundrc file.


Rename that to .asoundrcDEF


Paste in my file (.asoundrcBT) and rename it to .asoundrc whenever you want to use BT audio.


Swap the names when you want normal audio to be used.


Note: most apps will ignore the BT version of the file and simply output normal audio via the Pandoras speakers if they dont support BT audio at this time. If they dont accept the modified sound file, they will simply outpout no audio via speakers or your BT device at all.


To get your BT audio working:


Swap to the BT version of the .asoundrc file.


Enable BT


Pair your device by add new device from the BT panel icon.


Then connect to the device and ensure it stays in bold text, as connected. If it doesn't then like my/others headphones, it simply wont work.


Then start up Exaile as a test and see if it outputs to your BT device.


If that works, give the other players a try like ncmpcpp4P.





Hope that helps :)
 
Last edited by a moderator:
i say close this one up, MarioPandio put the nail in the coffin with his reply, nothing more needs to be added, everything is accurate as of today
 
wow, thanks for the detailed response, I shall give it a try when I leave work this evening. Many thanks!!
 
I also set up a very simple script which I can execute with a key combo (ctrl-alt-b I think) it renames the files for me and then gives me a notification as to which one is on. Makes switching back and forth a breeze.
 
Did this actually work as DaMummy suggests?





If so.....


wrld-undertaker02-1.jpg

I also set up a very simple script which I can execute with a key combo (ctrl-alt-b I think) it renames the files for me and then gives me a notification as to which one is on. Makes switching back and forth a breeze.

Oooooh......the Claw!


This sounds awesome
wub.gif
(I just love the inventions of folks who know Linux on Pandora)


Any chance of a copy of said script, pretty please :) There's Cake
tongue.gif



cake-708421.jpg
 
I didn't get a chance to try :angry: the lady of the house intervened and stopped me playing with my "toy" as she wanted me to watch The Office with her and I can't do two things at once! grrr (I love her really and she is unfortunately right, I am not a dual-core)


edit: a copy of said script would also be awesome B)
 
Last edited by a moderator:
Did this actually work as DaMummy suggests?





If so.....




wrld-undertaker02-1.jpg

I also set up a very simple script which I can execute with a key combo (ctrl-alt-b I think) it renames the files for me and then gives me a notification as to which one is on. Makes switching back and forth a breeze.

Oooooh......the Claw!


This sounds awesome
wub.gif
(I just love the inventions of folks who know Linux on Pandora)


Any chance of a copy of said script, pretty please :) There's Cake
tongue.gif



cake-708421.jpg



Aww~ And there I thought all along that the cake was a lie. :(
 
I'll post it soon as I get home to my Pandora. It was only a few lines if I remember. I'm sure more experienced coders would be able to spit out such simple stuff without much thought.


They were renamed to .asoundrc1 and .asoundrc2 when not in use, instead of .asoundrcDEF and .asoundrcBT. However, my script can easily be modified to use whatever filenames you choose.
 
Okay, here it is:


Step 1: Make sure your .asoundrcDEF and .asoundrcBT work correctly. Rename .asoundrcDEF to .asoundrc1 and .asoundrcBT to .asoundrc2


Step 2: Rename the file of your choice to .asoundrc (whichever you choose will be active first)


Step 3: Paste the following into mousepad and save it as btswitch.sh in your home folder(EDIT- by home folder, I mean the one with your username. ex: /home/edgex004 for me):



Code:
#!/bin/bash

if [ -f .asoundrc1 ]

then

rename .asoundrc .asoundrc2 .asoundrc

rename .asoundrc1 .asoundrc .asoundrc1

notify-send "Digital Output"

else

rename .asoundrc .asoundrc1 .asoundrc

rename .asoundrc2 .asoundrc .asoundrc2

notify-send "Bluetooth"

fi



Step 4: Open a terminal in you home folder and enter the following commands:





Code:
chmod ugo+rwx btswitch.sh





Code:
chmod +x btswitch.sh





Code:
sudo cp btswitch.sh /usr/bin/btswitch



Make sure to type in your password when sudo requests it.



This should create a switch command in the terminal that can be run by just typing 'btswitch' and pressing enter.



Step 5: In the xfce menu, navigate to settings->keyboard.



Switch to the 'Application Shortcuts' tab. Click add. In the command box enter:





Code:
btswitch


Click 'Ok' and then press the key combo you desire at the next window. I pressed <Control><Alt>comma as it is easy to reach.


Step 6: Test it out! You should get a popup which either says 'Bluetooth' or 'Digital Output' depending on whichever is being turned on. If something doesn't work, just let me know and I'll try to figure out what's going wrong.


I understand that my script could break at some point as I don't have any double-checking written into it, but it works for me and hasn't screwed me up so far.


Lots of credit for this goes to SomeGuy99 as I took my shortcut creation method directly from his screenshot guide.
 
Last edited by a moderator:
dumb question I know but when you say in the home folder, do you mean directly within the home folder, or further down the folder tree within the home folder?


as in


File System> home > btswitch.sh
 
Well, I'm not sure if it matters, but I meant the folder with your username. For me that is filesystem>home>edgex004 or I get there just by clicking the 'edgex004' shortcut on the left bar of thunar.


so it would be


filesystem>home>edgex004>btswitch.sh
 
Last edited by a moderator:
sorry for the gravedig but no use in making another thread


I followed this to a t and it's not working for my Plantronics Backbeat 906 headphones. I feel like I must be doing something wrong though because it doesn't seem to matter if .asoundrc is modified or not, I still get output to the speakers. Shouldn't the bluetooth modified .asoundrc not output to the speakers? The backbeats stay in bold text indicating they are indeed paired. Is there settings in Exaile that need modified? I was using hf6, however I'm now on hf7a3 and still get the same result. Anyone else get the backbeats to work?


When are we getting bluez? Is it something that can be ported prior to an os update?


[edit] that's odd, it's works with mplayer but not exaile. Oh well, is there a list of compatible bt devices floating around I can add backbeat to? Any ideas why mine won't work with exaile?


[edit2] looks like it crashes mplayer after one song. just my luck <_<
 
Last edited by a moderator:
Back
Top