We have moved at community.getvera.com

Author Topic: How to get multiple speakers to play in sync (ie, Pandora or MP3)  (Read 3659 times)

Offline TheSaint

  • Full Member
  • ***
  • Posts: 124
  • Karma: +1/-1
  • I am me, and me is I!
Ok! So I set a test scene with the following luup:

Code: [Select]
socket=require('socket')
local client = socket.connect('192.168.1.5', 9001)
client:send("00:04:XX:XX:XX:XX:01 playlist play pandora://3292813334574865065.mp3\n")
client:send("00:04:XX:XX:XX:XX:02 playlist play pandora://3292813334574865065.mp3\n")
local result=client:receive()

(I censored the MAC addresses in my post)

This triggers two radios in my home to start playing a Pandora playlist. Of course, they don't both turn on at the same time, and the track is different on each. So how can I trigger the radios to all play at once, and to play the same source in sync so that you aren't getting different tracks or out of sync music as you walk around?

This is my signature :)

Offline Mike Yeager

  • Hero Member
  • *****
  • Posts: 603
  • Karma: +11/-12
Re: How to get multiple speakers to play in sync (ie, Pandora or MP3)
« Reply #1 on: August 29, 2016, 03:25:38 pm »
Syncing 2 devices to Pandora is an exercise in the impossible.

Offline mvader

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: +29/-75
Re: How to get multiple speakers to play in sync (ie, Pandora or MP3)
« Reply #2 on: August 29, 2016, 04:05:37 pm »
. Of course, they don't both turn on at the same time, and the track is different on each. 

can you expand on this? what are the devices? how much difference is there?

Offline TheSaint

  • Full Member
  • ***
  • Posts: 124
  • Karma: +1/-1
  • I am me, and me is I!
Re: How to get multiple speakers to play in sync (ie, Pandora or MP3)
« Reply #3 on: August 29, 2016, 10:25:10 pm »
. Of course, they don't both turn on at the same time, and the track is different on each. 

can you expand on this? what are the devices? how much difference is there?

Apologies. I was quite tired last night.

Speakers == Logitech Squeezebox Radios

When the script is ran, one will turn on and the other will come up maybe a few seconds later. As each one loads up Pandora separately, it doesn't even land on the same track. To replicate this, grab a laptop and your phone and sit them side by side. Then load Pandora on each and click on the same station. Each will be fed a unique playlist as Pandora doesn't stream the tracks in real time. So when any gadget logs in, it starts randomly in the playlist somewhere for that station.

So the idea would be to maybe sync the speakers during the session, like Logitech's Media Server can do (running on a PC on the network) so that they'd play the same tunes at once maybe? Then unsync them with another scene when you are done with listening. This way they are back to being independent from each other (so one person doesn't come back later to turn on one speaker causing them all to go on and bother anyone).

In the end, it doesn't have to be Pandora. It can be a local playlist.
« Last Edit: August 29, 2016, 11:37:26 pm by TheSaint »
This is my signature :)

Offline mvader

  • Sr. Member
  • ****
  • Posts: 397
  • Karma: +29/-75
Re: How to get multiple speakers to play in sync (ie, Pandora or MP3)
« Reply #4 on: August 30, 2016, 09:50:32 am »
. Of course, they don't both turn on at the same time, and the track is different on each. 

can you expand on this? what are the devices? how much difference is there?

Apologies. I was quite tired last night.

Speakers == Logitech Squeezebox Radios

When the script is ran, one will turn on and the other will come up maybe a few seconds later. As each one loads up Pandora separately, it doesn't even land on the same track. To replicate this, grab a laptop and your phone and sit them side by side. Then load Pandora on each and click on the same station. Each will be fed a unique playlist as Pandora doesn't stream the tracks in real time. So when any gadget logs in, it starts randomly in the playlist somewhere for that station.

So the idea would be to maybe sync the speakers during the session, like Logitech's Media Server can do (running on a PC on the network) so that they'd play the same tunes at once maybe? Then unsync them with another scene when you are done with listening. This way they are back to being independent from each other (so one person doesn't come back later to turn on one speaker causing them all to go on and bother anyone).

In the end, it doesn't have to be Pandora. It can be a local playlist.

 when you say "When the script is ran, one will turn on"
does this mean from a powered off / sleep state, or just that it's already on and you mean outputting music?
What i was thinking was if you could perhaps send something (test mp3 or something) to pre-power it up, so start and stop and then launch into whatever you want.
that way they are both powered up and ready.
although, if you say when running pandora they land on different tracks.
that seems to me like a pandora thing. i don't know that you can code around that.

here are a few links that may help you with some ideas
http://www.danplanet.com/blog/2014/11/26/multi-room-audio-with-multicast-rtp/
http://www.hackerposse.com/~rozzin/journal/whole-home-pulseaudio.html

Offline Mike Yeager

  • Hero Member
  • *****
  • Posts: 603
  • Karma: +11/-12
Re: How to get multiple speakers to play in sync (ie, Pandora or MP3)
« Reply #5 on: August 30, 2016, 09:21:26 pm »
You can't. It's a Pandora problem...

Offline TheSaint

  • Full Member
  • ***
  • Posts: 124
  • Karma: +1/-1
  • I am me, and me is I!
Re: How to get multiple speakers to play in sync (ie, Pandora or MP3)
« Reply #6 on: August 31, 2016, 09:38:49 pm »
That's correct mvader. I'm ok with the radios not turning on at the exact same time. Just being able to play the same content in sync of each other. It doesn't have to be Pandora. I just used that as the example since that was what I was trying to do at the time. It can be a playlist or anything else, as long as I can make them both playback the same media in sync.

to answer your other question, they turn on once the command to play something is sent. So they are beginning in an off state.
This is my signature :)