[LAD] simple silence detection tool

Jeremy Hansen jeremy at skidrow.la
Sun Feb 10 16:17:10 UTC 2013


I actually got it to work!  Thanks for your help.  I installed the jack example clients package, which is where the jack_lsp utility is.  When I started silentjack like this:

silentjack -c "MPlayer [24538]:out_0" echo "Shit"

as soon as I turned down the levels on the audio source, silentjack did the right thing:

[jeremy at serv ~]$ silentjack -c "MPlayer [24538]:out_0" echo "Shit"
JACK tmpdir identified as [/dev/shm]
JACK client registered as 'silentjack'.
Connecting MPlayer [24538]:out_0 to silentjack:in
**SILENCE**
Shit
**SILENCE**
Shit
**SILENCE**
Shit

When I turned it back up, the echo stopped.

I think all I need for a nagios check is for the command to just exit a non-zero status to trip nagios.

This is great!  Just saved me $400 on a hardware based silence monitor.  What's cool is that since I'm using icecast, I could even have it react to take over the icecast mount with alternative audio stream.

-jeremy

On Feb 10, 2013, at 7:43 AM, Jeremy Hansen <jeremy at skidrow.la> wrote:

> 
> On Feb 10, 2013, at 6:09 AM, Adrian Knoth <adi at drcomp.erfurt.thur.de> wrote:
> 
>> On Sun, Feb 10, 2013 at 05:36:16AM -0800, Jeremy Hansen wrote:
>> 
>>> I saw this but I was missing all the jack info. I rebuilt mplayer with
>>> jack support. I started jackd per your example:
>> 
>>> JACK tmpdir identified as [/dev/shm]
>>> [JACK] cannot open server
>>> Failed to initialize audio driver 'jack'
>>> Could not open/initialize audio device -> no sound.
>>> 
>>> Perhaps I'm missing a step?
>> 
>> Wild guess: You've started jackd as root or under a different userid
>> than mplayer. You must not.
>> 
> 
> Thanks.  This got further.  
> 
>> You can run jack_lsp to verify your jackd is up and running.
> 
> I don't see this utility at all.
> 
>> 
>> If it shows you some ports, mplayer should work, too.
>> 
>> You may also find the "patchage" tool useful, run it after starting
>> jackd, and you can see and manage all your jackd clients.
>> 
> 
> I don't see patchage either.  Using RPMS from the EPEL.
> 
> Here's what I see:
> 
> [jeremy at serv ~]$ jackd -d dummy
> jackd 0.103.0
> Copyright 2001-2005 Paul Davis and others.
> jackd comes with ABSOLUTELY NO WARRANTY
> This is free software, and you are welcome to redistribute it
> under certain conditions; see the file COPYING for details
> 
> JACK compiled with System V SHM support.
> loading driver ..
> creating dummy driver ... dummy_pcm|48000|1024|21333|2|2
> unknown source port in attempted connection [SilentJack]
> unknown source port in attempted connection [SilentJack]
> 
> [jeremy at serv ~]$ mplayer -ao jack,port=SilentJack http://live.skidrowstudios.com:8000/live
> MPlayer dev-SVN-r27514-4.1.2 (C) 2000-2008 MPlayer Team
> CPU: Intel(R) Xeon(R) CPU           X3220  @ 2.40GHz (Family: 6, Model: 15, Stepping: 11)
> CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> 
> Playing http://live.skidrowstudios.com:8000/live.
> Resolving live.skidrowstudios.com for AF_INET6...
> Couldn't resolve name for AF_INET6: live.skidrowstudios.com
> Resolving live.skidrowstudios.com for AF_INET...
> Connecting to server live.skidrowstudios.com[54.235.147.151]: 8000...
> Name   : Skidrow Studios LIVE!
> Genre  : News/Talk/Music
> Website: http://www.skidrowstudios.com
> Public : yes
> Bitrate: 64kbit/s
> Cache size set to 320 KBytes
> Cache fill:  2.50% (8192 bytes)   
> ICY Info: StreamTitle='The Weekly Wrap Up - The Weekly Wrap Up – 02/09/2013 – episode 50/Drew Marks, Rich Slaton';
> Cache fill: 10.00% (32768 bytes)   
> Audio only file format detected.
> ==========================================================================
> Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
> mpg123: Can't rewind stream by 216 bits!
> AUDIO: 22050 Hz, 2 ch, s16le, 64.0 kbit/9.07% (ratio: 8000->88200)
> Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
> ==========================================================================
> JACK tmpdir identified as [/dev/shm]
> AO: [jack] 48000Hz 2ch floatle (4 bytes per sample)
> Video: no video
> Starting playback...
> A: 246.0 (04:05.9) of -0.0 (unknown)  0.6% 18%                                                                                                                
> 
> [jeremy at serv ~]$ silentjack -v -n SilentJack
> JACK tmpdir identified as [/dev/shm]
> JACK client registered as 'SilentJack'.
> Input port isn't connected to anything.
> Input port isn't connected to anything.
> Input port isn't connected to anything.
> Input port isn't connected to anything.
> Input port isn't connected to anything.
> 
> I tried doing silentjack -c SilentJack, but this didn't work.
> 
> [jeremy at serv ~]$ silentjack -c SilentJack
> JACK tmpdir identified as [/dev/shm]
> JACK client registered as 'silentjack'.
> Connecting SilentJack to silentjack:in
> connect_jack_port(): failed to jack_connect() ports: -1
> 
> Thanks
> 
>> 
>> 
>> HTH
>> 
>> -- 
>> mail: adi at thur.de  	http://adi.thur.de	PGP/GPG: key via keyserver
>> 
> 
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-dev



More information about the Linux-audio-dev mailing list