gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Pi0W and bluetooth speaker ?

Fri Mar 03, 2017 1:55 pm

How do you get audio out of a BT speaker ?

It appears to pair but then says goto the audio menu. The only menu I can find is the audio device menu, under preferences, which has nothing about BT.

Do I need to install blueman ?

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: Pi0W and bluetooth speaker ?

Fri Mar 03, 2017 2:44 pm

No need for extra software, save a fresh dist-upgrade today with a fix for BT speaker.

Once you've paired it, right click on the taskbar's speaker icon & select your BT audio.

If using omxplayer, use -o alsa to get sound over BT.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Fri Mar 03, 2017 3:51 pm

Thanks.

All appears to connect now BUT I still can't get any audio from it.

Trying omxplayer - o alsa /home/pi/python_games/match4.wav

alsamixer shows PulseAudio as the card

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Sat Mar 04, 2017 4:02 pm

Anyone have any ideas on this ?

The BT speaker is connected and selected.

It doesn't show as a card in aplay -l.

PiGraham
Posts: 3606
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Pi0W and bluetooth speaker ?

Sat Mar 04, 2017 4:08 pm

gregeric wrote:No need for extra software, save a fresh dist-upgrade today with a fix for BT speaker.

Once you've paired it, right click on the taskbar's speaker icon & select your BT audio.

If using omxplayer, use -o alsa to get sound over BT.
Worked for me, Had just done update/upgrade.
I made BT discoverable then add device found BT speaker and I could pair with it. Not sure discoverable is relevant, but first try at add didn't list any devices.
Once paired the BT speaker was listed on speaker right-click menu along with analog and HDMI.
Sound then came out of the speaker. I tried a Python game. 5-block Tetris.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Sat Mar 04, 2017 4:11 pm

Thanks.

I did the update/upgrade and it found the speaker same as you but no luck with any sound.

What BT speaker have you ?

UPDATE !! sounds works with Tetromino.py from python_games !! :D

More testing required with omxplayer.

PiGraham
Posts: 3606
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Pi0W and bluetooth speaker ?

Sat Mar 04, 2017 4:20 pm

gordon77 wrote:Thanks.

I did the update/upgrade and it found the speaker same as you but no luck with any sound.

What BT speaker have you ?

UPDATE !! sounds works with Tetromino.py from python_games !! :D

More testing required with omxplayer.
I didn't try omxplayer. My speaker is a small cube speaker from Sainsbury's.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Sat Mar 04, 2017 5:10 pm

Cheers.

Sadly sound didn't last long, now won't play anything again, and nothing has been changed :roll:

It's a Jam Plus

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Sun Mar 05, 2017 4:15 pm

I can get sound from the BT speaker with:

paplay (WAVs)
speaker-test (tone)

but NOT...
omxplayer
mpg123
pygame.mixer

any thoughts ?

does this show anything ?

Code: Select all

[email protected]:~ $ pacmd list-cards
1 card(s) available.
    index: 0
	name: <bluez_card.F0_13_C3_14_DE_59>
	driver: <module-bluez5-device.c>
	owner module: 24
	properties:
		device.description = "Jam Plus"
		device.string = "F0:13:C3:14:DE:59"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		bluez.path = "/org/bluez/hci0/dev_F0_13_C3_14_DE_59"
		bluez.class = "0x040400"
		bluez.alias = "Jam Plus"
		device.icon_name = "audio-card-bluetooth"
	profiles:
		a2dp: High Fidelity Playback (A2DP Sink) (priority 10, available: unknown)
		off: Off (priority 0, available: yes)
	active profile: <a2dp>
	sinks:
		bluez_sink.F0_13_C3_14_DE_59/#1: Jam Plus
	sources:
		bluez_sink.F0_13_C3_14_DE_59.monitor/#1: Monitor of Jam Plus
	ports:
		unknown-output: Bluetooth Output (priority 0, latency offset 0 usec, available: unknown)
			properties:
				
		unknown-input: Bluetooth Input (priority 0, latency offset 0 usec, available: no)
			properties:

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Mon Mar 06, 2017 5:52 pm

Anyone else used a Jam Plus or recommend a BT speaker that works?

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: Pi0W and bluetooth speaker ?

Mon Mar 06, 2017 6:27 pm

I'm using this http://www.ebay.co.uk/itm/2x3W-Bluetoot ... SwB09YSwQx. No plug is supplied to fit the onboard speaker socket, but I got lucky in that the speakers I salvaged from Samsung LED TVs have a connector which fits, & is wired appropriately.

recklessfb
Posts: 37
Joined: Wed Jul 06, 2016 12:26 am

Re: Pi0W and bluetooth speaker ?

Mon Mar 06, 2017 7:52 pm

How's the bluetooth speaker on the new pizero? Is the connection stable?
I was never able to get a stable connection on the pi 3. I eneded up disabling the onboard bluetooth and using a bt dongle.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Mon Mar 06, 2017 8:53 pm

recklessfb wrote:How's the bluetooth speaker on the new pizero? Is the connection stable?
I was never able to get a stable connection on the pi 3. I eneded up disabling the onboard bluetooth and using a bt dongle.
Mines stable just no sound with some programmes!

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 10:26 am

I have now tried a different BT speaker, a Juice Sound Square, and same result :(

paplay and speaker-test work but not omxplayer, so I can't play MP3s, anybody got an answer ?

Thanks

User avatar
Douglas6
Posts: 4762
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 11:49 am

It used to be that omxplayer output directly to the hardware, so no chance for Bluetooth. The newer version has an '-o alsa' flag. Not sure if the new one is in the repo yet, but you can get it on github. Also not sure if it works with Bluetooth, but it's worth a try (I obviously haven't).

Or use mpg321 for .mp3s.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

SOLVED - Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 12:26 pm

Cheers. I've got it playing MP3s now :D

I was testing with a .WAV not a MP3 with omxplayer, it plays MP3s but not WAVs, which will do me.

I used omxplayer -o alsa xxx.mp3

Gordon

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 2:26 pm

I am trying to play MP3s from python using omxplayer as a subprocess

If I enter the following in terminal it plays

Code: Select all

omxplayer -o alsa Music/'Athlete'/'Black Swan'/'01 Superhuman Touch.mp3'
if I use the following python it won't play but the response shown in terminal looks identical as if it is playing..

Code: Select all

rpistr = "omxplayer -o alsa Music/'Athlete'/'Black Swan'/'01 Superhuman Touch.mp3'"
p = subprocess.Popen(rpistr, shell=True, preexec_fn=os.setsid)
response in terminal...

Code: Select all

Audio codec mp3 channels 2 samplerate 44100 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
any ideas why ?

User avatar
Douglas6
Posts: 4762
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 2:38 pm

Just a guess, but you might have better luck passing Popen a list, like

Code: Select all

p = subprocess.Popen(rpistr.split(), shell=True, preexec_fn=os.setsid)

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 2:46 pm

Thanks Douglas6,

If I do that omxplayer just gives me the help screen, clearly doesn't like it.

It appears to be taking my command OK but ignoring the -o alsa ?

User avatar
Douglas6
Posts: 4762
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 3:07 pm

OK, I think the spaces in the file names are messing with things. What about

Code: Select all

rpistr = ["omxplayer", "-o", "alsa",  "Music/'Athlete'/'Black Swan'/'01 Superhuman Touch.mp3'"] 
And remove the split(), of course.

Sorry, I don't have a Pi setup to test with.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Fri Mar 24, 2017 3:21 pm

No luck , just the help screen again...

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Sat Mar 25, 2017 1:37 pm

Code: Select all

   rpistr = "omxplayer -o alsa Music/'Athlete'/'Black Swan'/'01 Superhuman Touch.mp3'"
p = subprocess.Popen(rpistr, shell=True, preexec_fn=os.setsid)  
It's baffling, when l use the above code omxplayer seems to acknowledge the -o alsa, and it finds the mp3 and appears to be playing it but it doesn't play it through the BT.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Sun Mar 26, 2017 11:13 am

Douglas6 wrote:It used to be that omxplayer output directly to the hardware, so no chance for Bluetooth. The newer version has an '-o alsa' flag. Not sure if the new one is in the repo yet, but you can get it on github. Also not sure if it works with Bluetooth, but it's worth a try (I obviously haven't).

Or use mpg321 for .mp3s.
Tried mpg321, same issue plays OK from terminal BUT won't play to BT as python subprocess. Appears to be playing but not to BT.

gordon77
Posts: 4168
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi0W and bluetooth speaker ?

Wed Mar 29, 2017 2:57 am

Anyone got omxplayer or mpg321 to work with bluetooth as a python subprocess?

Return to “Troubleshooting”