- - - By CrazyStat - - -

6. October 2012

Raspberry Pi as a digital webradio

Filed under: Linux,Raspberry Pi — Tags: , , , , , , , — Christopher Kramer @ 19:41

As my FM radio just sounded painfully because of so much noise, I looked at my Raspberry Pi lying next to it and thought “would it work as a digital webradio?”.

So I went ahead and installed VLC player:

apt-get install vlc

Then I went to the website of the local radio station and downloaded the m3u-file to the 128 kbit/s MP3-stream. Then I opened the file in VLC and clicked Play.

And it works great! CPU usage is at about 40%, RAM at 70MB. Sound can be digitally transferred using HDMI or using the stereo jack.

By the way, you can change the audio output to the stereo jack like this:

sudo amixer cset numid=3 1

And to HDMI:

sudo amixer cset numid=3 2

Compared to normal standalone webradios, this is not even an expensive solution. Using the IO pins, one could add buttons to control it, add an IR receiver via USB to add an IR remote control. You could even control it over the web using your smartphone.

Power consumption of the raspberry pi is also okay for a webradio, even if you do not shut it down because booting takes too long. Maybe the XBMC distribution for the raspberry pi is even better for a usage like this.

Oh, there are so many cool usages for this board. I really need to build something cool out of it.


Try my Open Source PHP visitor analytics script CrazyStat.

7. August 2012

Flash on the Raspberry Pi

Filed under: Linux,Raspberry Pi — Tags: , , , , , , , , — Christopher Kramer @ 17:14

The Raspberry Pi is a cool tiny board with a ARM CPU and lots of interfaces like HDMI, USB and Ethernet that runs Linux and costs only about 30€. If you have not heard if it, you should have a look at it, it’s just a very cool gadget to play around with or build your own devices. I got mine about a month ago but unfortunately did not have a lot of time to play with it, but am doing a bit from time to time, so you might hear some more stuff about it soon.

That’s what (mine) looks like:

Lots of people say having flash on the raspberry pi would be cool but then others claim it’s impossible to realize. In the Raspberry Pi forum, user “Aux” writes:

There is absolutely no way of getting Flash for RasPi. Adobe is a closed-source developer and the only version they made for ARM CPUs is Android one which requires ARMv7 CPU with NEON extension. That makes RasPi unable to run it even if someone ports Android.

That’s a reasonable thought and I thought the same way. But then I talked to a friend of mine and he said “well, what about Gnash? Does it run on the raspberry Pi?”

And so I went straight home and installed Gnash on my Raspberry Pi. And it works 🙂

Opening Adobe’s Flash test page looks like this:

The red ball indicates that Flash is working.

So what is gnash? Well, this is what the Debian repository description says:

GNU Gnash is a free GPL’d SWF player. It runs as a standalone application on either the desktop or embedded devices, or may be used as a plugin for several popular browsers. It supports playing media from a disk or streaming over a network connection.

GNU Gnash is based on GameSWF and supports most SWF v7 features and some SWF v8 and v9. SWF v10 is not supported by GNU Gnash.

Included in the Gnash is an XML based messaging system, as specified in the SWF specification. This lets a SWF animation communicate over a TCP/IP socket, and parse the incoming XML message. This lets an animation be a remote control for other devices or applications.

As there is an ARM package of Gnash, it installs fine on Debian for the Raspberry Pi.

Here is how you install Gnash for Flash support in the browser:

sudo apt-get install iceweasel browser-plugin-gnash

So this will get you a Mozilla-based browser called iceweasel (just like Firefox) that plays Flash.

Well, this is the theory. Reality is that going to youtube with that and trying to play a movie is just a pain. It eats up the whole CPU and hangs for hours until the 5 minutes movie is through.

But simple Flash animations should work fine. Have a try and enjoy your raspberry Pi!

Note that I still used Debian Squeeze and not yet the special Raspbian distro that is reported to run faster. I will have a try with the new version soon to see whether Gnash works reasonably fast on the new version.