Page 1 of 1

Pi0W and bluetooth speaker ?

Posted: Fri Mar 03, 2017 1:55 pm
by gordon77
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 ?

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 03, 2017 2:44 pm
by gregeric
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.

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 03, 2017 3:51 pm
by gordon77
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

Re: Pi0W and bluetooth speaker ?

Posted: Sat Mar 04, 2017 4:02 pm
by gordon77
Anyone have any ideas on this ?

The BT speaker is connected and selected.

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

Re: Pi0W and bluetooth speaker ?

Posted: Sat Mar 04, 2017 4:08 pm
by PiGraham
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.

Re: Pi0W and bluetooth speaker ?

Posted: Sat Mar 04, 2017 4:11 pm
by gordon77
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.

Re: Pi0W and bluetooth speaker ?

Posted: Sat Mar 04, 2017 4:20 pm
by PiGraham
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.

Re: Pi0W and bluetooth speaker ?

Posted: Sat Mar 04, 2017 5:10 pm
by gordon77
Cheers.

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

It's a Jam Plus

Re: Pi0W and bluetooth speaker ?

Posted: Sun Mar 05, 2017 4:15 pm
by gordon77
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:

Re: Pi0W and bluetooth speaker ?

Posted: Mon Mar 06, 2017 5:52 pm
by gordon77
Anyone else used a Jam Plus or recommend a BT speaker that works?

Re: Pi0W and bluetooth speaker ?

Posted: Mon Mar 06, 2017 6:27 pm
by gregeric
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.

Re: Pi0W and bluetooth speaker ?

Posted: Mon Mar 06, 2017 7:52 pm
by recklessfb
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.

Re: Pi0W and bluetooth speaker ?

Posted: Mon Mar 06, 2017 8:53 pm
by gordon77
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!

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 10:26 am
by gordon77
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

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 11:49 am
by Douglas6
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.

SOLVED - Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 12:26 pm
by gordon77
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

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 2:26 pm
by gordon77
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 ?

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 2:38 pm
by Douglas6
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)

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 2:46 pm
by gordon77
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 ?

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 3:07 pm
by Douglas6
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.

Re: Pi0W and bluetooth speaker ?

Posted: Fri Mar 24, 2017 3:21 pm
by gordon77
No luck , just the help screen again...

Re: Pi0W and bluetooth speaker ?

Posted: Sat Mar 25, 2017 1:37 pm
by gordon77

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.

Re: Pi0W and bluetooth speaker ?

Posted: Sun Mar 26, 2017 11:13 am
by gordon77
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.

Re: Pi0W and bluetooth speaker ?

Posted: Wed Mar 29, 2017 2:57 am
by gordon77
Anyone got omxplayer or mpg321 to work with bluetooth as a python subprocess?