Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

synchonized streaming to multiple clients/loudspeakers
synchonized streaming to multiple clients/loudspeakers
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 4th August 2020, 10:02 PM   #1
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Default synchonized streaming to multiple clients/loudspeakers

I wanted to start a thread on this topic. I'm curious if people know of software that can keep two or more streams very tightly synchronized. I do not mean "multiroom streaming" - that just needs to be approximately synchronized, e.g. below 1 second difference. I am talking about 1 millisecond (!) or less difference between the playback on two or more clients.

Why have such a strict requirement for synchronicity? For example, it is to send audio separately to playback systems in the left speaker and the right speaker. In order for the stereo image to stay in the middle and not wander from side to side, the time difference must stay well below 1 msec.

Another reason I am asking is that I just made some changes to the Gstreamer based app I wrote and that I use to stream audio around my home. I now seem to be able to stream to multiple clients and keep the stereo image centered. This means that I will be able to build two completely self-contained, independent active speakers and deploy them as a left+right pair anywhere in my home, with just an AC mains connection/plug and no other external wiring.

If there is enough interest in this from others I will be happy to share my app with everyone. It's a much improved version of my GSASysCon app that I first described a few years ago. It can stream and implement DSP on the clients. Add multichannel DACs at the clients and you have a streaming, DSP crossover audio system that can be reconfigured at will. In the past, it has been the documentation that has prevented me from releasing versions as I make improvements because it is very tedious and complicated to explain everything in sufficient detail. It would be great if I could get some "testers" signed up to do some test runs and give me feedback on everything.

NOTE: when I say "app" I do not mean something that you install on your phone. This is a Linux based bash script with a Gstreamer backend doing all the heavy lifting. You must be able to have multiple Linux computers (R-Pi 3 or 4 or similar, minimum) and DACs to implement this system. Experience setting up and maintaining headless systems and using SSH is useful.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 7th August 2020, 08:06 PM   #2
wealas is offline wealas
diyAudio Member
 
Join Date: Apr 2017
I'm planning on using Ravenna by Merging for this. But it doesn't support WiFi and it claims 5ms sync. It does support DSD, though.
I'd be curious to see how you maintain sub ms clock sync over WiFi.
  Reply With Quote
Old 8th August 2020, 12:28 AM   #3
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Quote:
Originally Posted by wealas View Post
I'm planning on using Ravenna by Merging for this. But it doesn't support WiFi and it claims 5ms sync. It does support DSD, though.
I'd be curious to see how you maintain sub ms clock sync over WiFi.
5msec will disappoint you.
Ravenna has a pro audio streaming platform but it requires PTP hardware support, which is not supported over WiFi.

Gstreamer is the engine that handles all the streaming, routing, DSP, etc. It uses RTP+RTCP to keep synchronization very tight. My code is built around it. I have the computers synchronized via NTP to a single NTP server computer I set up in my home using a spare linux box. This keeps all clocks within about 100 usec or less of each other. I am about to test a non-NTP synchronized R-Pi based 2 client system to see how that goes.

More info in this presentation:
Synchronised multi-room media playback and distributed live media processing and mixing with GStreamer - GStreamer conferences
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins

Last edited by CharlieLaub; 8th August 2020 at 12:37 AM.
  Reply With Quote
Old 8th August 2020, 01:05 AM   #4
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Gstreamer has a built in NTP-like time synchronization mechanism that is used to bring all pipeline clocks (on sender and receivers) onto the same time basis.

From the presentation in the last post, slide 13:

GStreamer Net & NTPv4 Clock
  • Gstreamer's NetClock existing since around 2005
  • Uses a custom protocol similar to NTPv4
  • UDP messages sent between client and server:
    1. Client “asks” the server for the current time & estimates the round-trip-time
    2. Uses both the estimate the current time at packet receival
  • NTPv4 (RFC4330) client clock since version 1.6 – Shares most of the code with the NetClock
  • Tricky part: Filtering to handle networks with fluctuating RTTs
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 8th August 2020, 01:30 AM   #5
Pano is offline Pano  United States
diyAudio Moderator
 
Pano's Avatar
 
Join Date: Oct 2004
Location: SW Florida
synchonized streaming to multiple clients/loudspeakers
DANTE works on Linux. But it's not wireless as far as I know.
  Reply With Quote
Old 8th August 2020, 01:35 AM   #6
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Right. Just to clarify, I am talking about clients that use regular old WiFi connections. Nothing special in terms of WiFi hardware.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 13th August 2020, 12:27 AM   #7
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
I have started to create a new, independent group of three Raspberry Pi 4B computers to test out the synchronization in the absence of NTP.

One R-Pi will act as the streaming audio server. It will have an audio input, either spdif or analog (have not decided yet). It serves up a WiFi network to which the clients can connect.

The two client computers will each be incorporated onto the back panel of a small 2-way speaker that I built several years ago. Its an active DSP speaker so there is no existing onboard crossover - that was previous done via outboard components. To implement the crossover and amplification I am using the DSP crossover functionality of my GSASysCon software. For amplification I am using HiFiBerry Amp2 HATs plus a Meanwell LRS100-24 SMPS. These components can all be mounted to the back of the speaker, with an AC power cord providing power to the system. There will be no other physical wiring to the speaker. I am still in the process of setting up the clients, but hopefully I should be able to get them working in the next few days.

This implementation is portable because the server generates its own WiFi network. I could take it to another location like a DIY show and it should work without having to do any changes or setup. I can add more clients, e.g. for a subwoofer, etc. as necessary.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 18th August 2020, 01:58 AM   #8
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
UPDATE:

I finally have the multi-client synchronized streaming test bed up and running, the one described in the last post. It's alive and working well!

I have been streaming 24bit uncompressed audio wirelessly over a private 802.11n network and so far everything seems to work perfectly.

I've attached a pic of the SMPS and Pi+Amp2 HAT bolted on to the back of the speaker. Sorry the lighting was bad and I snapped this with my phone, so the pic quality isnt' all that great.

I will do more listening and testing over the next few days.
Attached Images
File Type: jpg IMG_20200817_214800121.jpg (106.0 KB, 149 views)
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 18th August 2020, 06:53 PM   #9
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
I have done several hours of listening now and the system seems to be working great. Each speaker is running an independent client Pi and the DSP crossover filters are implemented on the clients, in software. While streaming 16/48, 24/48, or 24/96 uncompressed audio the speakers never lost sync and I did not hear any audible glitches or other hiccups. The system can be started from a "power off" state to active playback in about 1 minute.

This is a nice, standalone system when set up this way. But I can also connect the "server" Pi via its ethernet port to my home network and source the audio that way. The onboard WiFi is being used to serve up the 802.11n network for the clients, leaving only the ethernet port for connection to another network leading to the greater internet. I suppose that I could use a WiFi extender box that I own to access my home's WiFi network by using it in access point mode.

I would also like to try to set up the "server" Pi as a DLNA endpoint or Airplay client, etc. so that I could stream audio from my phone to the speaker system.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 19th August 2020, 03:27 PM   #10
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Below are a couple more pics of the system, set up in my basement speaker testing cave: front side and back side of the speaker, and a shot of the Pi with ADC HAT connected to CD player input.

The system is working great and is small enough to be installed right on the speaker. Amp HAT puts out about 30-40 WPC, 2 channels, in a nice and compact package. Temps on the Pis and the amp HAT seem to be quite reasonable, although I have not really pushed the amp to high output levels yet. The Pis are set for a fixed CPU frequency of 1GHz and with no heatsinking run at around 55-60C depending on the ambient temp. I also reduced the CPU core voltage a few notches to keep the heat generation down. The CPU usage on the clients, while receiving the audio stream and doing DSP processing, is only around 35% of one core (on a Pi 4), so the Pi is not really working that hard.

synchonized streaming to multiple clients/loudspeakers-img_20200819_110713829-jpg

synchonized streaming to multiple clients/loudspeakers-img_20200819_110733735-jpg

synchonized streaming to multiple clients/loudspeakers-img_20200819_110855586-jpg
Attached Images
File Type: jpg IMG_20200819_110713829.jpg (99.4 KB, 272 views)
File Type: jpg IMG_20200819_110733735.jpg (123.5 KB, 149 views)
File Type: jpg IMG_20200819_110855586.jpg (129.3 KB, 149 views)
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote

Reply


synchonized streaming to multiple clients/loudspeakersHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple secondaries vs multiple transformers Sadface Power Supplies 10 6th June 2020 10:40 PM
Accuphase MDS (Multiple Delta Sigma), and MMB (Multiple Multi-Bit) D/A conversion hollowman Digital Line Level 0 30th August 2016 02:49 AM
Multiple tweets = Multiple caps? Jonny Hotnuts Multi-Way 3 1st May 2016 05:01 PM
Audio server multiple clients thegreyspark PC Based 6 24th September 2013 08:34 AM
multiple references for multiple opamps sheepydog Everything Else 0 23rd January 2011 08:29 PM


New To Site? Need Help?

All times are GMT. The time now is 05:12 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio
Wiki