Playing audio on the NSLU2

3D Sound USB Audio Device

I'm a happy NSLU2 user since a few months now, and I'm using it for all kinds of things, e.g. as a 24/7 remote ssh server at home (using DynDNS and the ddclient Debian package), as IRC logger (screen + irssi), etc. etc.

I was considering multiple options as to where/how to install the slug (USB thumb drive, Compact Flash, disk drive, ...) but I settled with a full Debian install on an 1 GB USB thumb drive for now. I implemented some measures to maximize the life time of the USB thumb drive, maybe I'll post some info on that later...

One new thing I've been trying lately is to use the slug as an audio player.

As it doesn't come with an integrated sound card, you have to use an external USB audio device. I've got mine (see photo) from eBay for ca. 5 Euro (+ shipping) and it works out of the box with Linux 2.6.18 using the snd_usb_audio kernel module. You simply attach it via USB (the module is automatically loaded) and then attach external speakers to it. Here's an lsusb of the device:

Bus 001 Device 011: ID 1130:f211 Tenx Technology, Inc.

One problem with playing audio on the slug is the slow CPU. At 266 MHz (and without FPU!) playing audio with "normal" audio players such as mplayer or mpg321 is not possible. But there are several ways to make the slug play your favorite music. Here's a list of players I tested and a status report of whether they work at all. If yes, I listed a rough percentage of CPU load resulting from playing the music.

  • MP3:
    • mplayer, mpg321, aplay, playsound, and splay don't work.
    • $ madplay foo.mp3: 17% CPU load
  • Ogg vorbis:
    • mplayer, aplay, playsound, and ogg123 don't work.
    • $ apt-get install libvorbisidec-dev
      $ cd /usr/share/doc/libvorbisidec-dev/examples
      $ make
      $ cat foo.ogg | ./ivorbisfile_example | aplay -f cd

      Result: 40% CPU load

  • MOD, XM, S3M, IT, etc.:
    • $ mikmod foo.mod: 10% CPU load (even with compressed MOD files)
  • WAV:
  • FLAC:
  • SPEEX:
    • $ speexdec foo.spx: doesn't work, 100% CPU load. Any known alternatives?
  • AU:
    • $ cat > /dev/dsp: 3% CPU load (but sounds crappy)
    • $ cat > /dev/audio: 3% CPU load (sounds better)
    • $ mplayer 5% CPU load
    • $ aplay 5% CPU load
    • $ playsound 5% CPU load
  • AIFF:
    • $ sox foo.aiff -t wav - | aplay: 50% CPU load (a bit stupid, but it works)
  • Streaming MP3:
    • $ mplayer doesn't work, 100% CPU load.
    • $ wget -O - | madplay - : 17% CPU load
  • Streaming Ogg Vorbis:
    • $ cd /usr/share/doc/libvorbisidec-dev/examples
      $ wget -O - | ./ivorbisfile_example | aplay -f cd
      : 40% CPU load

The SlugAsAudioPlayer page in the NSLU2-Linux wiki might have further information on this topic.

Feel free to add comments if you know of other audio types which can be played on an NSLU2.

Measuring the energy consumption of everything you own

Voltcraft Energy Check 3000

Inspired by this post from Lars Wirzenius, I recently bought an electricity meter (or energy meter) and measured the energy consumption of everything I could find in my flat.

I did not yet perform any long-term tests, i.e. measuring the average consumption over multiple days or so, only some quick ad-hoc checks. I just recorded the number of watts the respective device used when powered on.

Here are the results:

Kitchen stuff:

  • Microwave. Off: 0 W. On: 1150 W.
    Depends on the configured "mode" of the microwave, I used the highest/hottest mode here.
  • Coffee machine. Off: 0 W. On: 884 W.
  • Mini-oven. Off: 0 W. On: 800 W.
    Depends on the configured "mode" of the mini-oven, I used the highest/hottest mode here.
  • Kettle. Off: 0 W. On: 2035 W.
    Quite a shock. I bet there are more energy-efficient ones out there, but still...
  • Toaster. Off: 0 W. On: 168 W.
  • Fridge. Off: 0 W. On: 110 W.
    This needs testing over a longer period of time. Fridges are not powered all the time.

Computer stuff:

  • Printer (Epson Stylus DX4200). Off: 0 W. Idle: 2.6 W. Printing: 10 W.
  • Laptop (Toshiba Satellite A80-117). Off: 0 W. On: 40 W. Heavy CPU load: 50 W. In powersave mode: 32 W.
  • PC (ASUS P4B266, 2 GHz). Off: 2.7 W. On: 60 W. Heavy CPU load: 92 W.
  • Computer monitor (CRT). Off: 1.7 W. On: 77 W. Pretty dark screen contents: 60 W. Text console: 50 W.
  • NSLU2. Off: 0 W. On: 3.5 W. Heavy CPU load: 3.9 W.
    This is one of the greatest pieces of hardware I ever bought, and these numbers are one reason for that!
  • External USB hard drive. Off: 0 W. On: 9.6 W. Heavy I/O load: 10.8 W.
  • DSL splitter + router. Off: 0 W. On: 1.2 W.
  • Radio. Off: 0.6 W. On: 2.1 W.
  • Shredder. Off: 0 W. On: 40-60 W.
  • External loudspeakers ("bass booster"). Off: 1.5 W. On: 3.5 W.
  • Portable mini CD player. Off: 0.4 W. On: 1.6 W.

By removing all devices which draw more than 0 watts in stand-by mode, I was able to reduce the overall (useless) energy consumption (and costs!) quite a bit.

I also replaced a bunch of 40 W and 60 W lightbulbs with energy saving lightbulbs which are equally bright, but only consume 8 W or 12 W respectively. On the long run you can save quite some amount of energy (and money) with them. They do cost a little bit more than normal lightbulbs, but save lots of electricity costs and they also last a lot longer (8000-15000 hours vs. 1000 hours according to Wikipedia).

Syndicate content