Friday, February 28, 2014

Broadcasting audio over the network using VLC

This is pretty much a rip-off of a response that I wrote in a reddit thread, but it's useful, and if nothing else, I'd like a way to be able to reference this in the future!  Of course, there are other ways to do this, but this was the easiest to do with the tools I already had installed.

Regarding, in general, a way to stream audio over the network:
VLC makes for a fairly easy solution. The syntax is a little bizarre, but the documentation[1] seems pretty good.
Here's an example that will stream my headset microphone input out over the network as a Vorbis OGG stream:
cvlc -vvv \
pulse://alsa_input.usb-Logitech_Logitech_G930_Headset-00-Headset.analog-mono \
--sout '#transcode{vcodec=none,acodec=vorb,ab=128,channels=2,samplerate=44100}:http{dst=192.168.2.170:8080/stream.ogg}'
Then, on the other computer, you can use VLC or some other audio player, or even a web browser, and point it at the URL (192.168.2.170:8080/stream.ogg in my example.)
My example uses pulseaudio. If you're also using pulseaudio, you can find the MRL for your input by running
pacmd list-sources | grep name
and replacing my "alsa_input...analog-mono" string with the one you find. You'll also need to change the IP to your IP address, obviously.
If you run into issues, you can use the VLC gui (if you're running a gui) to help you generate the proper transcode string and input MRL. In VLC, open the playlist and choose Audio capture under Devices on the left, right click the one you want, and follow through on the Stream wizard.
This should at least give you a starting point!


You've gotten better at Linux! (6)

Wednesday, February 12, 2014

Installing brewpi on MINIBIAN

The related projects:
  brewpi
  MINIBIAN

Why?

  • Installs on 1GB SD card (you need 4GB to install raspbian).

Use the normal method of installing the minibian img to an SD card (ie # dd if=imgfile.img of=/dev/sdcardyouwanttouse bs=1M) (see http://elinux.org/RPi_Easy_SD_Card_Setup for more details).

After installing:

  • Default login: root/raspberry
  • You'll want to change your root password (# passwd), but wait until after you update your keyboard config/localization settings (in raspi-config), especially if you are using symbols in the password.
  • I'd highly recommend disabling the ability to login as root remotely, by editing /etc/ssh/sshd_config and changing "PermitRootLogin yes" to "PermitRootLogin no".

  # apt-get install raspi-config git-core sudo
  # raspi-config
    (change appropriate settings in here)
  # useradd -mU -G sudo pi
  # passwd pi
    (enter new password)
  # apt-get update && apt-get upgrade
  # su pi

Everything else should be the same as the instructions in the brewpi docs.  Start here: http://docs.brewpi.com/installing-your-pi/rpi-setup.html#configuring-your-system.  Enjoy!


You've gotten better at Linux! (5)