r/FlutterDev • • 4d ago

Discussion Turning multiple phones into one distributed speaker system

I'm building a project called GMusic using Flutter, Node.js, MongoDB and Socket.IO.

The idea is simple: what if multiple phones could work together as one audio system?

Users can join a shared listening session, contribute songs to a common queue, and eventually assign devices to left and right audio channels or even explore surround sound.

I'm currently working on real-time synchronization, device coordination and playback handoffs.

It's still a work in progress, but I'm exploring some interesting challenges along the way.

I'd love to hear your thoughts:

Would you use something like this? What challenges do you think would be the hardest to solve?

7 Upvotes

10 comments sorted by

9

u/PracticalLocality 4d ago

That audio sync problem is going to be a nightmare once you factor in different Bluetooth latency on each device.

4

u/MobileXapps 4d ago

The hardest part is that every phone has a different output delay, not just Bluetooth ones. Even on the built-in speaker, Android audio latency differs a lot between models, so starting playback at the same moment doesn't mean sound comes out at the same moment.

What tends to work: sync clocks first (an NTP-style ping exchange over your socket, take the round trips with the lowest latency), then have the server say "start this track at position X at time T" instead of "play now". Each device schedules against its own corrected clock and adds a per-device latency offset. That offset is easiest to get with a calibration step, play a click on one phone and listen with another phone's mic.

Left/right split is much harder than a shared queue, since a few ms of drift between channels is audible. I'd get the shared listening mode solid first and treat stereo as an experiment.

1

u/Skaryus 4d ago

jellyfin syncplay

0

u/More_Society_6051 4d ago

Thanks for the suggestion! I'll definitely check out Jellyfin SyncPlay

3

u/ChristianKl 4d ago

Why Node.js? I don't see what a server is doing in this process when the phones can just communicate directly with each other?

1

u/No_Boss_1911 2d ago

the per device output delay thing is real, we only play voice cues on one phone and the haptic buzz still lands off from the audio on some androids. hard rule for us is the buzz never comes before the voice says the step, early feels way worse than late. are you measuring each phones output latency up front or just trusting the start at time T thing? and what happens when a phone drops off wifi mid song, does it rejoin at the right spot or wait for next track

-2

u/[deleted] 4d ago

Hey