Friday, January 22, 2010

Firefox 3.6 released, and i want it on Ubuntu Karmic

As web develops very fast (and i take part into it :)), I prefer newest technologies on my workstation under Ubuntu. In Ubuntu main repositories there are no Firefox 3.6 yet, and i believe it will be available in Ubuntu Lucid. To add FF 3.6 to Ubuntu Karmic use

sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update && sudo apt-get install firefox-3.6

After this you will then find Firefox 3.6 (Namoroka) under Applications > Internet > Namoroka Web Browser.

Wednesday, January 13, 2010

Audio output streaming on Ubuntu linux

Developers also have fun.

Usually developers who are listening to music listen it in their headphones, as not all people in office like music they are listening to. After couple of month all music on hard drive becomes annoying. And then internet radio becomes helpful. But if more and more programmers listen to radio through internet it would lag a lot. For web developers it's more annoying than music on HD. And they must listen to it. I have couple of co-workers who like to listen to one internet radio station. The big problem that it's going through Adobe Flash interface and i can't re-stream it. I've googled a lot to find how to broadcast audio stream through LAN. First option i've got is a PulseAudio Ubuntu native driver. But output on other machines was like on old cassette audio player. Music sometimes accelerates. So that was not a solution. Mix of other broadcasting tools does not help. And i remembered one of my classmates had broadcasted video through VLC.

Solution

To stream output channel you must have to install:

jackd
vlc
vlc-plugin-jack


Also you need to set up PulseAudio to play through Jack. Please refer this manual
After you have setup PulseAudio to play through jack and checked it's working you need to start qjackctl and start server if you are didn't set to start it automatically. Then start VLC with command:


vlc -vvv 'jack://channels=2:ports=.*' --sout '#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=raw,dst=192.168.1.3:8088}'
:sout=#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=raw,dst=0.0.0.0:8088}

Please note you need to set your IP address instead of 192.168.1.3
if you want vlc to start without an UI change vlc to cvlc

After this you can hear any audio on other machines by typing

mplayer http://192.168.1.3:8088


Finally you can write shell script to load all in one shot without interfaces

#!/bin/bash
pulseaudio -k
/usr/bin/jackd -t2000 -dalsa -dhw:0 -r48000 -p1024 -n2&
sleep 15
pulseaudio -DnF ~/.pulse/pulsejack.pa
cvlc -vvv 'jack://channels=2:ports=.*' --sout '#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=raw,dst=192.168.1.3:8088}' && pulseaudio -k && killall jackd; pulse-session

Please note you need to set your IP address instead of 192.168.1.3

Good music for you