LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-07-2012, 07:26 PM   #1
sneakyimp
Member
 
Registered: Dec 2004
Posts: 795

Rep: Reputation: 50
wall wart linux to allow audio monitoring via wifi network


I play in a band and we rent a rehearsal space in a building that also houses other bands. Occasionally, we drive over there hoping to record something and there are all kinds of other bands rehearsing so it's not quiet enough. The facility has free wi-fi so I want to set up something (cheap) which would allow me to listen via a microphone or webcam so I can tell if it's busy and/or loud before trekking over there.

I was thinking of getting one of those wall wart linux boxes and attaching a microphone or webcam to it, but have very little experience either with the little computers or with getting a USB device (like a mic or webcam) to connect to a linux box and share its data over the internet.

Because there is no fixed IP or domain associated with the wifi network at this facility, I expect I would need to write a cron script that would check in every so often with one of my servers so the wall wart could keep me apprised of its current IP address.

Beyond that, I'm kind of lost. Any advice about linux drivers for mics, etc. and how to share the audio data via internet would be much appreciated.
 
Old 02-08-2012, 03:11 AM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,143

Rep: Reputation: 133Reputation: 133
check internet radio programs, maybe there is one with mic support and you are done. You don0t need a mic driver but a soundcard driver if anything.
 
Old 02-08-2012, 03:04 PM   #3
sneakyimp
Member
 
Registered: Dec 2004
Posts: 795

Original Poster
Rep: Reputation: 50
I just don't see how a soundcard is going to fit into a wall wart. On the other hand, I do have a USB microphone and most of these wall wart things have USB jacks.
 
Old 02-08-2012, 03:12 PM   #4
LinuxNoobX
Member
 
Registered: Jan 2012
Location: Evermore
Distribution: Linux Mint 12
Posts: 165

Rep: Reputation: 2
Wink

I am a little fuzzy on the set up of externals on a Linux machine but once you have the recording portion set up where the band is playing you can use a hyper intuitive service called livestream to do web broadcasts and watch the band play from any internet terminal... the service also has a few other features. I was testing it for the purposes of monitoring my apartment remotely... the ghetto is not very friendly to a man with a decent computer setup . Livestream is browser-based so it should be compatible with Linux or any end-user OS for that matter. Z/Z
 
Old 02-08-2012, 03:19 PM   #5
sneakyimp
Member
 
Registered: Dec 2004
Posts: 795

Original Poster
Rep: Reputation: 50
The point is not to watch the band play or to stream the band at all. The point is for the band to check when they are at home whether the building is quiet or not.

For example, While at home, I get a hankering to record my new song, Mr. Winnar, and would like to know if it is quiet enough in the rehearsal complex to go down and record some moody acoustic brilliance. I pull out my computer (or phone) and type in the IP address of the wall wart machine running down at the space and in doing so I can hear what's coming through the mic at the rehearsal complex.

A couple of important things:
1) Our recording setup is a windows machine and probably consumes a few hundred watts of electricity. We don't want to leave this on 24-7. That's why I'm thinking wall wart as they only consume about 5 watts.
2) I'm not really interested in paying for a streaming service just for this use. I'm not afraid of writing my own cron jobs and/or apps to get at the audio data on the mic. Just wondering if there's some open source thing out there that might make it easy.
 
Old 02-08-2012, 03:30 PM   #6
LinuxNoobX
Member
 
Registered: Jan 2012
Location: Evermore
Distribution: Linux Mint 12
Posts: 165

Rep: Reputation: 2
The streaming service is free but if all you want to do is check volume levels then a used netbook with Linux and teamviewer ( other variations of team work too but it is the only one I can think of ) should keep power consumption low and allow you to monitor the place remotely on-demand 24/7... most netbooks have built-in webcams and in a lot of cases built-in mics which suck but are fairly sensitive. Z/Z
 
Old 02-08-2012, 03:51 PM   #7
sneakyimp
Member
 
Registered: Dec 2004
Posts: 795

Original Poster
Rep: Reputation: 50
OK I like this thinking, but this netbook would need to be set up to auto-answer or something. Unless I'm mistaken, someone has to allow a user to connect to a team viewer session. If it's possible to fire up team viewer on this netbook and prevent it from sleeping and then the netbook can auto-answer team viewer connections, that would pretty much rule. This sounds a lot simpler than the other approach I was thinking. I was expecting to
1) set up wall wart computer to check in to my apache web server via a cron job to say "Here I am at IP www.xxx.yyy.zzz".
2) When I access from home, I go to my apache web server and find out where the wall wart checked in from then try to access that IP
3) set up some kind of streaming access to the wall wart

I realized this morning that I have no control over the wifi router at the rehearsal complex and would therefore be unable to route incoming requests to the wall wart computer in my rehearsal space. The problem is something like this:
1) wall wart recently checked into my apache server and said "As you can see I'm www.xxx.yyy.zzz and my LAN address is 192.168.1.123"
2) I go to my apache server which tells me to visit www.xxx.yyy.zzz
3) I send a request to port 12345 at www.xxx.yyy.zzz
4) WiFi router is the machine connected at www.xxx.yyy.zzz and says "lolwut?" and drops the request
 
Old 02-08-2012, 04:20 PM   #8
LinuxNoobX
Member
 
Registered: Jan 2012
Location: Evermore
Distribution: Linux Mint 12
Posts: 165

Rep: Reputation: 2
I am trying to figure out if you are trying to access a computer remotely or trying to make weaponized anthrax.

From the place you are monitoring you just have to set the display to dim never or after 10 mins and disable hibernation... with team you can set up a shared account easily so as long as both computers are accessing the internet and have team running then you can execute team and access any computer you have on the team network that is connected to the internet.

Livestream works in much the same way... these are moron Windows end-user methods that work with Linux... configurations that use apache or online hosting or anything like that are beyond my scope until I start my projects up again. Z/Z
 
Old 02-08-2012, 04:38 PM   #9
sag47
Senior Member
 
Registered: Sep 2009
Location: Philly, PA
Distribution: Kubuntu x64, RHEL, Fedora Core, FreeBSD, Windows x64
Posts: 1,431
Blog Entries: 33

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
If it were me I would write (or find) a sound meter which measures the dB coming in on the microphone (basically how loud the environment is).

Server side
On the server side I would have munin set up which simply receives data and logs it in a graph.

Client side
Write a munin plugin which uses the sound meter to measure the decibels of the room and submit the check automatically to the munin server with the sound level as a integer value in dB.

Then the sound in the room can be measured at regular intervals over time and graphed. Then you may start to see trends when nobody is at the room. Historical trend data is more useful then real time listening in this case in my opinion. You could then create your own schedule around when nobody is usually there (or the lowest noise level periods since there may always be environment noise).

***EDIT***
Terms you might want to look for is sample peak programme meter (SPPM) in plain text or terminal for linux.

alsa peak meter

Are a few I've looked up. Some promising results but no one off solution without writing your own so far.

***EDIT***
Sample software I found which could be used to write a pure text sound meter plugin.
***EDIT***
With help from the #alsa channel I found the sox command which can give you statistics on a sound file. So you can record the environment for 1 second (or more) and then run statistics on the file using an audio analyzer.
Code:
sox MYFILE.wav -n stat
#one liner to record one second and then analyze the sample using sox.
arecord -d 1 -f cd -t wav foo.wav &> /dev/null && sox foo.wav -n stat
You could then process the output of the sox command using python or perl and then output in a format that munin can understand. The parts you want to keep track of for the noise levels are the amplitudes. More specifically the "Maximum amplitude".

***EDIT***
So to get the maximum amplitude for a plugin you would want to run the following command...
Code:
#!/bin/sh

case $1 in
   config)
        cat <<EOM
graph_title Maximum Amplitude
graph_vlabel mamplitude
mamplitude.label max_ampl
EOM
        exit 0;;
esac

echo -n "mamplitude.value "
arecord -d 1 -f cd -t wav /tmp/foo.wav &> /dev/null && sox /tmp/foo.wav -n stat 2>&1 | grep 'Maximum amplitude' | awk '{print $3}'
rm -f /tmp/foo.wav
And there's your munin plugin. Pretty cool journey. Thanks custos-mundi from #alsa on freenode for helping me find the tools I need and breaking the problem down.

SAM

Last edited by sag47; 02-09-2012 at 03:19 PM.
 
1 members found this post helpful.
Old 02-17-2012, 01:24 PM   #10
sneakyimp
Member
 
Registered: Dec 2004
Posts: 795

Original Poster
Rep: Reputation: 50
OK I've been preoccupied with other stuff, but I did manage to test Teamviewer using my ASUS netbook and it works pretty darn well. I get video too. This is definitely an option. I'm considering just installing teamviewer on the pc in question. I've got my kill-a-watt and can see how much electricity is being consumed.

sag47: Amazing info. The graph approach does sound very interesting because it would give one a good idea ofwhen the quiet times are, generally speaking. THANK YOU so much for the detailed info. Coding in C is a little deeper than I'd like to get, but I may just do it anyway. At the moment, I'm wondering whether I can connect my logitech USB microphone to a wall wart linux box. In particular, where would one find the driver? How can one determine what sort of audio is being fed into the wall wart box?
 
Old 02-17-2012, 02:41 PM   #11
sag47
Senior Member
 
Registered: Sep 2009
Location: Philly, PA
Distribution: Kubuntu x64, RHEL, Fedora Core, FreeBSD, Windows x64
Posts: 1,431
Blog Entries: 33

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
Quote:
Originally Posted by sneakyimp View Post
sag47: Amazing info. The graph approach does sound very interesting because it would give one a good idea ofwhen the quiet times are, generally speaking. THANK YOU so much for the detailed info. Coding in C is a little deeper than I'd like to get, but I may just do it anyway. At the moment, I'm wondering whether I can connect my logitech USB microphone to a wall wart linux box. In particular, where would one find the driver? How can one determine what sort of audio is being fed into the wall wart box?
The drivers for webcams are generally supported out of the box. I just linked you to a support document which points you to kernel modules (drivers) for different webcams if it is not automatically supported.

Also for the solution I gave you, you don't have to program in C. I gave you the complete solution (arecord records the audio sample, sox gives you the amplitude from that sample). The programming you see is a munin plugin (basic bash) and I even added to the plugin in a blog post. They are both tested working examples and can be graphed as of this post.

Last edited by sag47; 02-17-2012 at 03:23 PM.
 
1 members found this post helpful.
Old 02-17-2012, 02:44 PM   #12
sneakyimp
Member
 
Registered: Dec 2004
Posts: 795

Original Poster
Rep: Reputation: 50
Most excellent. Sorry to ask already-answered questions. Currently overwhelmed with day job.

I'm truly grateful. rep++
 
Old 02-17-2012, 03:02 PM   #13
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
How about getting a motion detector, such as the ones used to control outdoor lights, which I believe provide a contact closure when they detect motion. Then, on your wall wart form-factor host, find something that has a binary input of some sort, like a printer port, or game port, or even a serial port that implements modem-control lines. These kinds of inputs should be very easy to monitor with a simple userspace program that can be called as a CGI from the web server, or can simply beacon out to a remote web server whenever the empty/occupied status changes. If you aren't up to writing such code, it is probably simple enough that someone would be able to provide it right here without too much sweat.

--- rod.
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tiny Linux Plug Computers: Wall Wart Linux Servers LXer Syndicated Linux News 0 01-27-2011 06:10 PM
LXer: Linux Wall Wart Works Wonderfully LXer Syndicated Linux News 0 02-20-2010 02:30 AM
network monitoring:unable to launch nagios network monitoring system oladapo1980 Linux - Newbie 0 07-21-2009 01:45 PM
Network Monitoring on Linux cipher7836 Linux - Newbie 4 12-04-2008 03:56 PM
Best WiFi PCI (or else) card in general for Linux and WiFi network experimentation? ICEMANII Linux - Wireless Networking 2 09-21-2006 04:50 PM


All times are GMT -5. The time now is 01:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration