#exhibition #Linux #rpi #stream #loop
* * Tech Challenge * *
For an installation I want a speaker to come out of the cellar towards the street. That means the sound source is in the cellar, coming out of a Raspberry Pi.
If I want to play a video in the window (on the ground floor), that's a a problem, because the amplifier and speaker are not on the same floor as the sound amplifier...). Sound and image must be in sync! meh!
I thought of streaming a video and sound on Rapsberry's, on to the other. It needs to be good audio quality. But then I have the problem of looping the video, putting strain on the network, what software to use..
Fediverse, have you encountered similar problems? Solutions?
@wendy short-range low power FM radio transmitter and receiver maybe?
@mathr yes I did that a few years ago, with pifm. But it's a dirty transmitter, the pi...
@wendy I meant a standalone off-the-shelf gadget (eg oldschool "listen to your discman on your car system"), not a pi, for that - or build a better filter for the pifm?
@mathr we actually bought one a few years ago that didn't work. Also, emitting in Belgium is illegal. ¯\_ಠ_ಠ_/¯ But true, an option. Additional poblem is budget. Pi's I have. Emitter not.
Keeping time for audio across networks is not easy. If the video loop is not terribly long, I'd use some OSC messages-> Have the computers send each other a bunch of messages about how much time has elapsed to figure out latency. If one of the computers is running the network and other services are disabled, this should be close enough.
Then, the master computer says to start audio and video at X future time. Both start then.
@wendy Sound travels at 240 m/s, so you may need to slightly delay the audio.
Don't just loop, but keep monitoring latency and at the end, send a new start command with the latency within it.
SPECIFICALLY, how I would do this with minimal fuss:
I'd control everything from sclang on the video computer. I'd play the video using a little processing program that understood OSC commands asking for a delayed film start.
The other computer would run the SuperCollider server. sclang will automatically track the latency.
I'd use that to tell both to start together.
Obviously, this would be at risk for crashing, so both sclang and processing would be touching files in /tmp. If they stop doing that, a bash file will notice and reboot.
The scserver computer would be monitoring it's audio oputput for long silences and would reboot if that happened or if there's too long network silence.
Depending on your deadline, budget and how good this would look on my CV, I may be available to write and deploy this for you.
@celesteh Hi, Charles. Impressive!
Budget unfortunately I don't have..
@mathr I did find some code describing a way to limit the frequencies the Pi uses to transmit --> https://github.com/CodyJHeiser/PiStation
But I'll have to see how I can jumble this all together, probably using a Pi1 (yes!)
Hoorays will be shared on the fediverse!
@ptr_here Impressive!! I did a little whistle - pfieww..
(terminology stumble of very currently used words: just change master into followed and slave into follower ;-))
interesting indeed ...
in case of, I also did that some times ago, to control a OMXplayer with OSC (and a servo motor, from pure-data in another computer on the network)
it's pretty precise/fast to jump to frame, but currently only use one file (plan is to have a playlist too ... )
One video file is not a problem - Glue stuff together if necessary.
Osc is unfamiliar territory for me though. Funny that fm is not ;-)
The problem potentially is the cable - I need to go from the cellar to the ground floor. That's 30 to 40 meters of cable..
@wendy mplayer has a nifty feature to sync playback of multiple players for video walls (long live the 80s ;) ... see https://mplayerhq.hu/DOCS/HTML/en/networksync.html
@automatist hahaha, excellent!!! w(°ｏ°)w I'll check it out
@automatist Hey. for the moment I have chosen fm to transmit in the cellar, because mplayer does not handle the video acceleration very well 😕
Could be because it was a .mov?
Anyway, the fm solution is nice, but fragile... I'll see if can take about this one or the other moment.
@wendy Can't run a speaker wire out the window? (Sorry if that was obvious).
Could use BT speaker/sender/receiver?
I recently saw this which looks usable: https://github.com/turingmachine/omxplayer-sync
This supposedly works but triggers some hacky-alarms for me: https://github.com/bmoren/node-omxplayer-sync
Sync is usually very low network strain since the vids are already copied to the player-clients.
I have some hacky scripts similar to above, which I can share if you need em.
@KnowPresent hey, I tried the node-omxplayer. The problem is the cable --> it has to run for about 30 metres, I think, from one floor to the other, via the staircase through the Constant office. And honestly, I did not get it to work (I did use two very old raspberry's)
--> I would like to use the wifi.
Tips and tricks are welcome. Michael pointed out that Mplayer does the job beautifully, but the video with mplayer does not run smoothly on the pi because of the proprietary bla.
--> Here's an image of the current set-up, the wired (made in Berlin) Plux Molitor speaker comes from the Cellar ventilation holes:
We can't do bluetooth, or people will run away with it 🙂
--> I ended up using the Adafruit Stereo FM Transmitterhttps://www.adafruit.com/product/1958
because you can scan for emptier frequencies
::You know this head, I think ;-)::
and these peeps!
@wendy Oh now I see, you can't run cables down the facade of the building. Well if the sound is ok then maybe the FM module is a good hack. For BT I was not thinking of a bluetooth speaker but using your (very nice looking) wired speaker and just sending the audio over something like this:
Those are some familiar, nice-looking people. See you next week in Saarbrücken?
Mplayer should run ok on a pi if you're just playing back audio. You could try something like run mplayer on an old laptop for the video and sync a WAV or mp3 on the old pi in the cellar? Just spitting ideas.
And in theory, you can run (extra THIC) speaker wire or a shielded (maybe boosted) audio signal 30m. (But maybe you tried and it was borked.)
Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.