Using Audacious as audio player and controlling from VC

This is a place for sharing with the community the results you achieved with QLC+, as a sort of use case collection.
You can share photos, videos, personal hardware/software projects, interesting HOWTO that might help other users to achieve great results.
Post Reply
iamchrislaurie
Posts: 58
Joined: Mon Apr 27, 2015 11:27 am
Real Name: Chris Laurie

Hi All

I have just started using Audacious as the audio player with my QLC+ set-up and this post is there to document my experiences.

WARNING and caveat: This method uses external 3rd party software that is not part of QLC+ so know that you cannot expect any sort of support from the normal QLC+ gurus/devs in using this. I will monitor this thread infrequently to answer any queries. Also note that my usage includes me building QLC+ and Audacious from source and running QLC+ on the pi in a way that is not currently supported.

Use case: I use QLC+ almost exclusively in a theatre setting, for a community theatre group. Mostly it is for a musical or music concert. We have limited resources in terms of funds but also equipment and space. A typical show would have about 20 pars, 2 moving heads (Chauvet Qspot), some home made LED pixel strings and strips, a dmx smoke machine and a 4 channel dmx mains dimmer. I set up the scenes and then put them in a chaser determining the fade hold settings so that it becomes close to a one button operation. I also do some other funky things like using the moving heads as follow spots and controlling video from another Raspberry Pi via dmx, but that is for another post. In addition to all this there is always audio that needs to be played like backing tracks, dance tracks or sound effects. In addition we also provide front of house music before the show, during interval and afterwards.

When QLC+ started using the Qt media library I was quite excited because I could use that to play my audio. Playing the FOH playlist was not really an option as it begs a UI dedicted to adding, sorting etc of a playlist. With the show audio it mostly worked except when fading in or out on demand and playing a piece in the middle meant massaging the audio files directly. Then I had problems playing the audio on my Raspberry Pi, that I was sure related to Qt libraries.

On the other hand the media player Audacious ticked a lot of boxes for me. It has 2 killer playlist features: remove silence (which automatically truncates the very silent bits at the start and end of a song) and crossfade. Both of which combines to make it seem as if someone is carefully selecting and mixing tracks.

Combining Audacious and QLC+ as separate players proved to be a disaster when they were using the same audio out device on my linux laptop. The first half of the show had to run without any sound, opening night.

While solving that (disaster) I was reading up on Audacious and realised that it has a command line tool that allows control of the player. Couple that with the QLC+ scripting feature where I can send a command line instruction using systemcommand, I now have what I think is the perfect solution for my use case. In addition I can write more complicated scripts as external executable scripts and call them as well. Furthermore I can combine different scripts inside QLC+ chasers and collections and do all sorts of complicated things, automagically.

I am attaching a few screenshots that shows buttons with pre-programmed scripts/controls as well as views of some of the scripts and chasers.

Functionality that I implemented with this - all executable from buttons and cue lists:
  • Starting and killing the Audacious player.
  • Playing the FOH playlist. This will fade in and play the current active song in the playlist. From there onward Audacious plays/mixes the playlist tracks until I stop it.
  • Various volume controls including fade from current volume to 80% or 90%. This prevents a sudden jump in volume.
  • Fade out the FOH playlist, stop the playlist, cue the next song, put the volume back at 90% and turn off crossfade, ready for the first show cue.
  • Play the show cues on demand from buttons and/or a cue list.
  • Other transport controls like prev/next, seek and play/pause.
  • I can also have the same track being used and cued to start in the middle somewhere, fade in/out and then stop. Then later using the same track but a different part of it. This approach also allows the flexibility of starting an audio track and then fading out on demand, when an actor reaches a specific place for example.
The playing is asynchronous, that is, once you have told the player to play something it starts and runs "in the background". This means that QLC+ itself is not aware of the playing, volume etc, so influencing it using the command line is what gives this the power.

I'm running this on a Raspberry Pi 2 with the latest Raspbian (jessie) and have found it to be rock solid in my tests so far with the CPU hovering well below 10%, occasionally spiking up to about 25%. I will be testing the full thing while also using QLC+ to drive lights via the uart very soon.

I can post my test workspace and some the external scripts if anyone is interested.

A final note. I have only tested this on linux but with a bit batch file wizardry I'm pretty sure it could work on Windows as well. At least I know I can control Audacious from the command line tool. You may have to set your path variable.
Showing the virtual console with all the control buttons.
Showing the virtual console with all the control buttons.
Showing the scripts section with one of the many step scripts.
Showing the scripts section with one of the many step scripts.
Showing how the scripts are put in a chaser
Showing how the scripts are put in a chaser
User avatar
mcallegari
Posts: 4480
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Hi Chris, thanks for sharing this.
I just took the liberty to add a link to the Audacious web page.
pade
Posts: 6
Joined: Fri May 13, 2016 9:13 am
Real Name:

Hi,

I'am using QLC+ for theatre and musical comedy i'am very interesting in your experience with audacious.
As you propose, could you share you workspace and your script ?

I have a question: Is there not too much latency between QLC and audacious due to the script ?

Thanks
iamchrislaurie
Posts: 58
Joined: Mon Apr 27, 2015 11:27 am
Real Name: Chris Laurie

Hi pade, sorry for the late response, I only saw your post now.

Attached find a few scripts and a qlc work file. A few notes about the set-up:
  • Audacious playlists are numbered by the tab on which the playlist is, first tab is playlist 1 and second tab is playlist 2 etc. Audacious remembers this when it exits and restarts.
  • The player needs to be started before you can send it any commands. I have put that on a button but a QLC+ script to play a file will invoke it.
  • I set up my front of house playlist on the second tab. This is important as the scripts uses the number 2 playlist to play the FOH music. You can change the tabs and then change the scripts in QLC+.
  • I set up the FOH playlist as a seperate (non QLC+) activity.
  • When QLC+ issues a "play this file" command via a script (playing a single file like a backing track or sfx) to Audacious it will play in the first playlist called "now playing".
  • Be careful with settings like playlist repeat and crossfade - when playing tracks in the show you want them off, while you want them on when providing house music.
  • Paths are important. The paths are hard coded in the QLC+ scripts but stick to a convention. That way I can set up the paths in an empty workspace with tracks named track01.mp3, track02.mp3 etc. All pre-mapped to buttons and a cue list. Then, when I get the show tracks, I can copy them to the correct folder and change the scripts and script names to the track actual file names.
  • One thing I have found useful is to get the length of the track and set the fade-in time on the cue list item for that track to this value and the hold to infinite. If you do this, you get a progress bar on the cue list that will show you more or less where you are in the song. I run QLC+ in full screen mode and then I cannot see what is happening in the player.
  • I have an issue on the pi that the volume ramp is very steep - at 40% the audio is very quiet, almost inaudible. I am still trying to find out if I can set something on the pi to make it more linear and less steep.
With regards to latency. It is there, but very short so not really noticeable for what I needed. The only real issue I have with latency is in my script to fade to a specific volume level in a specific period of time. I currently do this in a loop that calls the command line controller audtool and then waits to spread out the fade over the required time period. For very short fade times over a large range (say from 90% to 0% in 1 second), the repeated fast calls from my shell script loop to audtool to audacious slows the process down and the fade is not how I want it. I have tried to amend the script algorithm but it is not really successful. I intend to try and use d-bus directly from my script for this and not go via audtool. Playing sound effects from a QLC+ button, to a QLC+ script that issue a QLC+ system command to audacious to play the track I was spot on and got no complaints from the performers. My QLC+ fade script that calls the audtool with a 1% volume adjustment 10 times a second is very smooth.

I also have other shell scripts like a shutdown script that shuts down the pi after 10 seconds and another that turns off screen blanking. Included is a small c program that imitates sleep at the microsecond level as this is not available in the bash flavour of Raspbian jessie.

I am just learning bash scripting so my code is not clean, pretty, neat or even optimised - be gentle.

As always your mileage may vary.
Attachments
scripts.zip
(7.59 KiB) Downloaded 157 times
bront
Posts: 2
Joined: Wed Jun 15, 2016 3:26 am
Real Name: Brenton Rowland

Is there a way of doing this with a Windows based Audacious setup?
I don't seem to be able to find any command line information specifically for Windows build.
I tried audtool but had a few problems (possibly just me!) passing parameters. Any good guides out there?
iamchrislaurie
Posts: 58
Joined: Mon Apr 27, 2015 11:27 am
Real Name: Chris Laurie

The external scripts are written in bash, the Linux command line scripting language. I briefly looked at it and thought that Windows batch file scripting would give the same functionality - there certainly was a lot of help on the web.

I currently do not have a Windows use case so I left it there.

A longer term solution would be to port the scripts to python to make it more platform independent.
bront
Posts: 2
Joined: Wed Jun 15, 2016 3:26 am
Real Name: Brenton Rowland

Thanks Chris, I will have a play from batch files.
I have got audtool to mute/unmute OK from a batch file so it will probably do more.
Audtool did not find a running Audacious instance at one point but did after closing and opening Audacious again.
I tried starting Audacious headless and using audtool to start play but could not get a saved playlist invoked at startup.
I'll post back here for other Win 10 users in a few weeks if I find it workable.
I want to be able to cut short an audio clip and continue lighting cues, not wait for audio to complete before stepping on.
So this Audacious/Audtool scripting promises a good solution.
Post Reply