Topic: Mic., Again.

Hi There,

Has there been progress on getting software to work with the mic? VOIP is the obvious choice. Anything working yet? Maybe MagicJack (?) can work?

I love my Chumby... :-)

Jose

Re: Mic., Again.

hello,
not only I see obvious interest in voip (skype in primis)
I also cloud be interested in broadcasting audio from microfone.
I would like to use the chumby as a babyphone

from germany
immiimmi


josep wrote:

Hi There,

Has there been progress on getting software to work with the mic? VOIP is the obvious choice. Anything working yet? Maybe MagicJack (?) can work?

I love my Chumby... :-)

Jose

Re: Mic., Again.

I ask (bug) about this often.  It's an omission in the actual Flash Lite plugin and has nothing to do with Chumby at this time (from what I have been told).

Cheers.

Re: Mic., Again.

And directly with your own controlpanel using linux commands?

5 (edited by Joan Jett 2009-08-23 11:59:16)

Re: Mic., Again.

Hi all --

Sorry to bump this thread, but it seemed the most logical one rather than start a new one. So if Flash Lite doesn't have the ability to access microphone, would something like IHU (http://ihu.sourceforge.net) work? Initially, just a simple command line app (on a flash drive) to connect two ip addresses. Kind of like an IP intercom/walkie-talkie type thing. IHU uses SpeeX for compression, fairly lightweight, ALSA, but also JACK which is quite lightweight too, I believe. Does Chumby have JACK capability?

Brian, #1 Joan Jett Fan

Re: Mic., Again.

IHU uses Qt, which means it wouldn't work on Chumby unless you got Qt compiled and running, which is not an easy endeavor.

What you can do, though, if you want to get an intercom system going using Speex, is get speexenc compiled for ARM, then run something like:

arecord | speexenc - - | nc [ip_of_other_computer] [port_of_other_computer]

Then, on the other computer, you'd run:

nc -l [port_to_listen_on] | speexdec - - | aplay

Make up the port.  If you didn't want to use speex at all, you probably could leave it out and just send raw PCM back and forth.

Re: Mic., Again.

ChumbyLurker wrote:

IHU uses Qt, which means it wouldn't work on Chumby unless you got Qt compiled and running, which is not an easy endeavor.

What you can do, though, if you want to get an intercom system going using Speex, is get speexenc compiled for ARM, then run something like:

arecord | speexenc - - | nc [ip_of_other_computer] [port_of_other_computer]

Then, on the other computer, you'd run:

nc -l [port_to_listen_on] | speexdec - - | aplay

Make up the port.  If you didn't want to use speex at all, you probably could leave it out and just send raw PCM back and forth.


Yes, this works fairly nicely without the speex. Thanks for the tip!

Brian, #1 Joan Jett Fan

Re: Mic., Again.

Can you elaborate a little further on how you would use the mic on the chumby to stream sound to another PC using raw PCM? I understand how to ssh into the chumby, but what do I do on the PC side to listen to the sound?

Thanks!

-HuckFinn

Re: Mic., Again.

Joan Jett wrote:
ChumbyLurker wrote:

IHU uses Qt, which means it wouldn't work on Chumby unless you got Qt compiled and running, which is not an easy endeavor.

What you can do, though, if you want to get an intercom system going using Speex, is get speexenc compiled for ARM, then run something like:

arecord | speexenc - - | nc [ip_of_other_computer] [port_of_other_computer]

Then, on the other computer, you'd run:

nc -l [port_to_listen_on] | speexdec - - | aplay

Make up the port.  If you didn't want to use speex at all, you probably could leave it out and just send raw PCM back and forth.


Yes, this works fairly nicely without the speex. Thanks for the tip!

I did this on the chumby:

arecord | nc ip.of.listening.computer portnum

for example

arecord | nc 192.168.1.2 16544

I did this on the pc I wanted to receive the chumby (which needs to be running a linux shell)

nc -l 16544 | aplay

You should now hear what the chumby's mic is picking up through the speakers of the other computer (assuming your other pc's sound card/alsa etc. is configured correctly.

The audio quality was good, mic is very sensitive, but it seemed like the chumby was picking up some noise from the wifi to me. There was a lot of digital sounding stuff in the background.

Brian, #1 Joan Jett Fan

Re: Mic., Again.

Thank you very much for the detailed instructions, I will give it try later.

-HuckFinn

Re: Mic., Again.

Great. now only a widget is missing. and we name it baby-phone

Re: Mic., Again.

hello
1) aplay supports better quality; the noise remains
2) nc is not needed with ssh

ssh -l root chumbyip arecord -fS16_LE -r22050 -traw -c1 | aplay -fS16_LE -r22050 -traw -c1


Joan Jett wrote:
Joan Jett wrote:
ChumbyLurker wrote:

IHU uses Qt, which means it wouldn't work on Chumby unless you got Qt compiled and running, which is not an easy endeavor.

What you can do, though, if you want to get an intercom system going using Speex, is get speexenc compiled for ARM, then run something like:

arecord | speexenc - - | nc [ip_of_other_computer] [port_of_other_computer]

Then, on the other computer, you'd run:

nc -l [port_to_listen_on] | speexdec - - | aplay

Make up the port.  If you didn't want to use speex at all, you probably could leave it out and just send raw PCM back and forth.


Yes, this works fairly nicely without the speex. Thanks for the tip!

I did this on the chumby:

arecord | nc ip.of.listening.computer portnum

for example

arecord | nc 192.168.1.2 16544

I did this on the pc I wanted to receive the chumby (which needs to be running a linux shell)

nc -l 16544 | aplay

You should now hear what the chumby's mic is picking up through the speakers of the other computer (assuming your other pc's sound card/alsa etc. is configured correctly.

The audio quality was good, mic is very sensitive, but it seemed like the chumby was picking up some noise from the wifi to me. There was a lot of digital sounding stuff in the background.

Re: Mic., Again.

Is there anyway to do this on the PC without a linux shell or what linux shell do you recommend?

-HuckFinn

Re: Mic., Again.

Huck, try installing cygwin (http://www.cygwin.com/) to get a bunch of Linux/Unix style commands that run on top of the Windows command prompt.

Re: Mic., Again.

Thanks I am working on installing Cygwin, I just can not find the right packages that need to be selected for all of the commands. I found netcat but still working on finding "aplay".

-HuckFinn

Re: Mic., Again.

aplay isn't part of cygwin; it's specific to the ALSA audio system on Linux.  However, there should be a setting in sox (http://sox.sourceforge.net/) that would let you play the incoming audio stream -- I'm not sure exactly what that would be.

17 (edited by huckfinn 2010-01-12 23:15:19)

Re: Mic., Again.

Ugh. I looked a little at the SOX documentation and I do not see anything regarding playing a stream. I could very easily have missed it as a lot of documentation was over my head. I really do thank you for your help, I was hoping this would be easier to pull off on a WindowsXP laptop. I am good at following directions, but not so good at figuring these types of things out.

Is there anyway to simply use a media player, such as VLC, to capture the stream?

If anyone can help me I would greatly appreciate it.

BR

-HuckFinn

Re: Mic., Again.

OK, here's an idea.  VLC can play MP3 and Ogg Vorbis format HTTP streams.  So it may be possible to make a CGI script that runs from /psp/cgi-bin on the Chumby, reads audio data from the microphone, and sends back a stream until it's disconnected.

I don't have an exact recipe for this yet -- I just realized this might work, but I'll stick it on my list of hacking ideas to pursue over the next few weeks.

Re: Mic., Again.

Maybe something like this?

#!/bin/sh
echo "Content-Type: audio/x-wav"
echo ""
arecord -f cd

20 (edited by unwiredben 2010-01-13 07:45:38)

Re: Mic., Again.

Just tried this on my Chumby One, and it worked with some tweaks to get the microphone capturing audio at a reasonable volume.  I couldn't play the stream directly in Firefox, but it worked as a network stream in VLC.  Here's my modified version.

#!/bin/sh
echo "Content-Type: audio/x-wav"
echo ""
amixer sset "Mic PGA" Capture cap > /dev/null
amixer sset "Mic PGA" Capture 71% > /dev/null
arecord -f cd

I stuck this in /psp/cgi-bin/playmic, did a chmod +x on it, then was able to stream using the url http://chumbyip/cgi-bin/custom/playmic .

21 (edited by huckfinn 2010-01-13 18:12:17)

Re: Mic., Again.

Thank you so much! This worked perfectly and it was very easy to setup and easier to use. This now makes the chumby a perfect baby monitor. Now to add a webcam to stream video as well ;-)

-HuckFinn

Re: Mic., Again.

This is a cool use for a Chumby that hadn't even occurred to me until I read this thread.  The CGI script provided by Unwiredben works well for me within my home LAN.  But now suppose I want to listen from another location via an Internet connection.  I have 2 concerns:

1. This is going to consume a lot of bandwidth, isn't it?  Is there a simple way to add compression to this solution?  Someone suggested using Speex above, but I can't use that under Windows, right?  Is there a way to get VLC to handle a Speex-compressed stream?

2. If I set my router to forward port 80 to my Chumby so I can access it via HTTP from outside my network, am I opening myself up to serious security problems?  The obvious one is that anyone could listen to what's going on near my Chumby.  I guess I can solve that one by just removing the playmic script when I'm not using it.  But are there other security issues I need to think about?

Thanks for the great solution.

Re: Mic., Again.

I'd obfuscate the script name a bit if you're running this on a public network to try to make the URL less guessable.  Maybe only access it through a VPN to your home network so it can't be sniffed.

As for compression -- I'd just look at doing low-bitrate MP3 compression, get a copy of lame running on the chumby, pipe arecord into that, then send the MP3 stream out.

Re: Mic., Again.

I haven't been able to find a copy of lame compiled for an ARM processor, but I did find a copy of ffmpeg at http://groups.google.com/group/chumby-wma.  It sounds like it should be able to encode the audio stream into mp3 format, but ffmpeg has so many options and I have so little understanding of audio processing that I can't figure out how to use it.  Can anyone give me any pointers?

Re: Mic., Again.

I got the code from unwiredben to work, and I can hear the sounds near the chumby either using VLC or WMP, but the audio is very low even with volume turned up to max.  Also, the streaming delay begins as only a few seconds, but I'm not sure if the audio is slightly slower, but the delay seems to grow a lot.  Still a pretty cool feature though...

...any fixes in mind?

Non-programmer
Chumby One for Xmas '09
Registered Nurse