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

A bash-script-based streaming audio system client controller for gstreamer
A bash-script-based streaming audio system client controller for gstreamer
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 22nd June 2016, 06:57 PM   #1
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: California
Default A bash-script-based streaming audio system client controller for gstreamer

UPDATE:
The latest GSASysCon version is 1.01 and can be downloaded at the GSASysCon web page:
GSASysCon - A bash-script-based streaming audio system controller



Intro:
After being fortunate enough to find a few solid days of uninterrupted development time I have managed to create a system for controlling all my loudspeaker systems. At this point I have some code working and the concept seems feasible but I am still building everything out. I will update this thread with info on my progress, and the scripts, when they are working.

Concept:
A number of loudspeaker system receive streaming audio over WiFi. Audio sources are played by and streamed from a single computer, the "audio server". Loudspeaker systems are comprised of one or more "audio client" computers. The client computers receive the streaming audio, perform some processing (e.g. implement a DSP crossover) and then pass the audio to on-board amplifiers in the loudspeaker. On the audio server, audio is sourced by a player (MPD on my system). For each loudspeaker system a separate gstreamer pipeline is used to stream audio from the output of the player to audio clients. Launching or terminating the gstreamer pipeline for any loudspeaker system will cause it to turn on and begin playing (pipeline launched) or stop playing and then automatically turn off the amplifiers after a preset time (pipeline terminated).

A text-only, command line interface is used to allow the user to control the on/off behavior of each system and to see the current status of all available systems. This system will accommodate multiple concurrent users and remote clients - script can be run on multiple terminals simultaneously as there is not exclusive use of any resource.

Reducing Disk Usage:
To reduce actual disk usage, the contents of the system information sub-directories are copied to the tmp filesystem (that actually resides in memory) and all PID tracking and system control read/writes are done there. Only changes to the ip_list and system description files need to be written to the hard disk (e.g. when editing systems) and then copied over to the /tmp filesystem to show up in the control system interface.


Identification of System Clients:
Each loudspeaker system is controlled by 1 or more client computers (e.g. Raspberry Pi) that receive the streaming audio, implement the crossover, and control the on/off state of the amplifier(s) in the system. All client computers are always up (running) and have separate, fixed IP addresses and hostnames. The IP addresses are used by gstreamer to send audio from the server to the client over WiFi. Therefore, a list of system client IPs can be used to define and identify the clients that comprise each system. New systems can be created/added by specifying the client IP addresses in the system using the system editor.

Run Modes:
There are three run modes, single-shot, continuous, and autonomous.
Single Shot Mode: The system control is invoked and, after a system is toggled on or off, it exits.
Continuous Mode: The system control is invoked and the system status will update after a change (e.g. a system is turned on or off) or after a user-defined interval of N seconds even without user interaction. This continues until the user actively terminates the control interface. Using continuous mode, the user can be regularly appraised of system status no matter which terminal makes a change to the system.
Autonomous Mode: The desired change is made without displaying any system status info, and then the program exits. This allows GSASysCon to act as a back end for another program, or to be run by the operating system, eg. a cron job.



Motivation - Why Do I Want/Need This Control System?
In my home I want to control a number of audio (only) system. I use an MPD client to run MPD (which is actually running on the audio server) and control playback. The MPD client GUI interface is actually running on a 10" Android tablet that I can conveniently carry around with me. This lets me choose what I am hearing, but there isn't a great way to turn a system on or off without walking up to it and operating multiple physical switches - unfortunately MPD's output switching is not up to the task, and output switching is not available on my preferred MPD client anyway.

I found that I can easily open an SSH session on the audio server from my Android computer. This can be done using an SSH terminal app or even via an HTML browser using the Shellinabox software. Given that a text-based command-line control system would allow me to turn systems on and off from my tablet, in true DIY fashion I hacked one together. I think this approach might be useful to other DIYers even if they do not have multiple systems to control.


.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins

Last edited by CharlieLaub; 14th August 2016 at 03:04 AM.
  Reply With Quote
Old 22nd June 2016, 07:10 PM   #2
pcgab is online now pcgab  United States
diyAudio Member
 
Join Date: Dec 2014
Location: San Marcos, Texas
A bash-script-based streaming audio system client controller for gstreamer
This sounds awesome Charlie, can't wait to see what you come up with.
  Reply With Quote
Old 22nd June 2016, 07:18 PM   #3
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: California
Yeah this should be pretty cool! It has been both challenging and fun to develop so far. I more or less went into my programming man cave for a few days while my wife was traveling and went at it.

Also, Kudos for not re-posting my long opening-post in your reply!
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 22nd June 2016, 07:45 PM   #4
pcgab is online now pcgab  United States
diyAudio Member
 
Join Date: Dec 2014
Location: San Marcos, Texas
A bash-script-based streaming audio system client controller for gstreamer
Haha, from years on mailing lists I guess I've learned to not over quote the thread.

I've got some pi zero's and have been wanting to try setting up the following:

a pi zero, usb sound card, and two monoblocks at each speaker(irs2092 for the lf drivers, tda8932 for full range driver). The pi zeros handling the dsp/xover duties.

a media server on the local network that is managing the streams, linux/freebsd/mac, some *nix.

It could be wireless or wired, ultimately wired for some of the uses I have in my head(garage speakers, garage has multiple pulls of cat6 thanks to me ).

My first use case is for a pair of open baffle speakers I'm building for my dad( http://www.diyaudio.com/forums/multi...ml#post4751489 )


I haven't had time to dive in yet, but I should at some point this summer..hopefully!

Last edited by pcgab; 22nd June 2016 at 07:48 PM.
  Reply With Quote
Old 22nd June 2016, 07:52 PM   #5
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: California
Quote:
Originally Posted by pcgab View Post
Haha, from years on mailing lists I guess I've learned to not over quote the thread.

I've got some pi zero's and have been wanting to try setting up the following:

a pi zero, usb sound card, and two monoblocks at each speaker(irs2092 for the lf drivers, tda8932 for full range driver)

a media server on the local network that is managing the streams, linux/freebsd/mac, some *nix.

It could be wireless or wired, ultimately wired for some of the uses I have in my head(garage speakers, garage has multiple pulls of cat6 thanks to me ).

My first use case is for a pair of open baffle speakers I'm building for my dad( http://www.diyaudio.com/forums/multi...ml#post4751489 )


I haven't had time to dive in yet, but I should at some point this summer..hopefully!
I was able to buy a single Pi Zero a couple of months ago. After giving it a try I was a bit disappointed. First, the computing power is much lower than the Pi 2 for example, because the Pi Zero only has a single core. This will definitely limit what you can do with it vis a vis audio, although I have not done extensive experiments in that regard. Also, because the only real I/O is via the USB OTG port you will need an OTG adapter and a powered USB hub, the latter is not inexpensive. Add those into the total cost and you are approaching or exceeding the Pi 2 or Pi 3 at $35.

I put my Pi Zero on the shelf for awhile and am now using it as an NTP server in my system, for which it is perfectly suitable with only a single ethernet connection via an OTG-to-ethernet adapter dongle.

Not saying the Pi zero can't be used, but when you look at what you really need to make it work for a DSP crossover or streaming audio client it kind of comes up short.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 22nd June 2016, 08:07 PM   #6
pcgab is online now pcgab  United States
diyAudio Member
 
Join Date: Dec 2014
Location: San Marcos, Texas
A bash-script-based streaming audio system client controller for gstreamer
That's good to know. I'm not set on using the zero's, I'll happily order some new pi's as I would rather have a bit more than I need, than just barely enough or too little.
  Reply With Quote
Old 22nd June 2016, 08:23 PM   #7
cacao ambiance is offline cacao ambiance  United Kingdom
diyAudio Member
 
Join Date: Oct 2015
code? im interesting in having a look
  Reply With Quote
Old 22nd June 2016, 11:23 PM   #8
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: California
Quote:
Originally Posted by cacao ambiance View Post
code? im interesting in having a look
Glad you are interested. I will be releasing the "code" (it's done exclusively with bash scripts) when it's working and some testing has been done on all the components.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 22nd June 2016, 11:50 PM   #9
cacao ambiance is offline cacao ambiance  United Kingdom
diyAudio Member
 
Join Date: Oct 2015
Quote:
Originally Posted by CharlieLaub View Post
Glad you are interested. I will be releasing the "code" (it's done exclusively with bash scripts) when it's working and some testing has been done on all the components.
ohh, i miss read, i thought it was working/tested etc. arr ok thank you muchly for working on it. yea Iím looking forward to it because it written in bash, just my kind of language and the only programming one I am familiar with.
  Reply With Quote
Old 23rd June 2016, 01:19 AM   #10
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: California
New Feature!

I realized that it would be nice to be able to automate the system control so that it could be called during startup or as part of another bash script.

To do this I have added an "automated mode". In automated mode the intended action is supplied on the command line as a parameter, along with a flag to indicated that automated mode should be used.

For an example of this kind of usage, you could include the system control script program in your .profile file so that when you log in it automatically takes an action.

This was pretty easy to implement, since it is similar to "one shot" mode. I only had to add some error checking of the parameters to make sure that there is no unintended behavior.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote

Reply


A bash-script-based streaming audio system client controller for gstreamerHide 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
New BeagleBone based Audio System dogrocket Vendor's Bazaar 3 1st April 2016 04:02 AM
XMOS audio streaming controller GB interest heartwinter Group Buys 12 13th July 2015 04:30 PM
USB streaming controller arjunm009 Digital Line Level 2 12th May 2015 04:38 AM
First audio project, Wall controller for room audio system, looking for guidance, Chrisdvip Construction Tips 2 10th June 2013 05:47 AM
Audio System Controller happyboy Analog Line Level 9 12th September 2012 09:12 AM


New To Site? Need Help?

All times are GMT. The time now is 09:28 PM.


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