Streaming audio from the ROV USB webcam


#1

Idea

I really wanted to hear the audio from the usb webcam on the ROV. I did some looking around and found this article about "Live mp3 streaming from audio-in with Darkice and Icecast2 on Raspberry Pi.". We're using a beaglebone but that should be a minor detail, right? A bit more reading and I learned that Darkice is a program to feed audio from things like your microphone or line-in to a streaming audio server. Icecast2 is that streaming audio server that people can actually connect to and listen in to the audio that Darkice is collecting from the webcam mic.

This may not run perfect, but at least it's a start so somebody that knows what they're doing can come in and help us make it better!


The bare necessities(beaglebone/camera) so anyone around the world can help us get super fast audio/video together and kids around the world can fly robots in kelp forests!

Method

So the process is kind of tricky but well worth playing with because of the low cost of embedded linux computers these days. If everything is becoming a little linux server now is a good time to learn!

You will need to be comfortable moving around in linux and if you're not you're welcome to try anyway (I did). If something goes terribly wrong you should be able to reflash with this image. But as a heads up it might be nice to have a 2nd beagle bone to play with things like this and keep your ROV RTF(Ready to fly...in water).

To go through this process you're also going to need your ROV(or just a beaglebone and camera) to be connected to the internet. This means it will get an IP address from your router instead of the normal 192.168.254.1 it sets itself to when you plug it in to a PC. So login to your router or use a port scanner to find the ROV again after it boots up joins your local network.

Got the IP? Great! Now you can ssh(login and send commands) to the ROV using a program like Putty or whatever else you want to use.

Login: rov

Password: OpenROV (you will need this password to be re-entered when you do a lot of the "sudo" commands)

So now you're logged in to the ROV? Awesome. Let's cross our fingers, blow on our nintendo cartidges, and get things going.


Setup Icecast 2

This is the first step because it's easier and you'll be able to see something right away. There is a nice tutorial here that shows you how to do this after you ssh in to your ROV. Or if you like you can read my version below based on his.

rov@OpenROV:~$ sudo apt-get update


Wait for a bit and you'll have an updated apt-get (the thing that lets you install new software super easy)

rov@OpenROV:~$ sudo apt-get install Icecast2

After telling your Beaglebone to install Icecast2 you'll have to press "Y" (caps matter, these Linux people take things very seriously) when you see this message:

After this operation, 1,942 kB of additional disk space will be used.
Do you want to continue [Y/n]?

Wait a bit for things to download and you should haveicecast2 installed. A nice pink screen will pop up and ask you to configure icecast2, select yes of course to save yourself some hassle!


You're going to want to set the host to localhost. Then it's going to ask you a bunch of times for passwords, you should probably set those to OpenROV or end up looking for passwords later. (Unless you're going to be a real dj and let your ROV stream to the internet, in which case you should use a different password.)

After everything is setup look at what the installer said at the end:

icecast2 daemon disabled - read /etc/default/icecast2.


Well let's see what that says...

rov@OpenROV:~$ cat /etc/default/icecast2


So this file, /etc/default/icecast2 let's us know that we should set our passwords in this icecast.xml file and then we should change the line that says "ENABLE=false" to "ENABLE=true". That will make it so that icecast2 will start when your beaglebone turns on and you'll have yourself a streaming audio server. Let's go ahead and do that using a program called "vi".

There is a nice page about how to use vi here. The main thing you need to know is that unlike notepad you have to change modes to be able to write. So basically you press "i" for insert mode and then you can edit text. Press escape again and you're just moving around not breaking stuff. When you are done you'll want to press escape to get out of insert mode, press ":" to bring up the little command window, and type "wq" for write then quit. Bingo bango you're on your way.

rov@OpenROV:~$ sudo vi /etc/default/icecast2


Setup DarkIce

Test it all out

So your icecast server is running, darkice is good to go, and when you connect to the icecast server through your web browser you even see the