mp3

Downloading non-DRM Amazon MP3s on Linux using clamz

I recently wanted to buy some MP3 files from Amazon (a whole album in my case, but you can also just buy single MP3 files if you want). Digital music downloads from Amazon are often much cheaper than buying the physical CD (from Amazon), and you can also instantly get the stuff within seconds, without having to wait for the physical CD to be shipped to your place.

The good thing about Amazon's MP3 downloads is that the files are not infested with any DRM-crap (if that were the case I wouldn't spend a single penny on such useless junk, of course). This allows you to burn the MP3 files on CDs and/or play them on any device you like (MP3 player of choice, laptop, hifi-system, car, e-book reader with MP3 playback support, etc. etc).

Granted, you can not re-sell the digital files on eBay later, this is the one little drawback you have when compared to physical CDs, but I guess most people can usually live with that. Also, it would be great if Amazon would provide Ogg Vorbis files instead (or in addition to) MP3 files, of course.

Anyway, in order to download the MP3 files you buy from Amazon, they suggest to install the Amazon MP3 Downloader, which (surprisingly) is even available in a Mac and Linux version (only 32-bit though), but is (unsurprisingly) closed-source. This is no-go, of course, but luckily there is an alternative.

The clamz tool (GPL, version 3 or later) allows you to easily download single Amazon MP3 files, or whole albums. First, you need to login to your Amazon account and then visit a certain Amazon page (which sets a special "congratulations, the Amazon MP3 Downloader has been successfully installed" cookie in your browser). See the clamz website for the respective URL for your country. For Germany, use this URL.

The clamz installation is easy enough on Debian:

  $ apt-get install clamz

IMPORTANT: It seems you need at least version 0.5 for recent Amazon files as they apparently changed something, see #647043. Current Debian unstable as of today already has 0.5, though.

After that is done, the rest is easy: In Amazon, click on "Buy MP3" or "Buy MP3 album", which will download a special AmazonMP3-1234567890.amz file. You can then let clamz download all the MP3s by typing:

  $ clamz AmazonMP3-1234567890.amz

Wait a few minutes, and you'll have a bunch of non-DRM MP3 files in your current directory. Easy.

See the manpage for a bunch of options which let you configure clamz to your preferences.

The TrekStor eBook Reader 3.0 (EBR30-a), review and dissection

The TrekStor eBook Reader 3.0, front
The TrekStor eBook Reader 3.0, front on

There a many, many, e-book reader devices available these days, and they're quickly becoming pretty affordable. The currently cheapest device in Germany (that I know of) is the TrekStor eBook Reader 3.0, model number EBR30-a, at 59.- Euros via Weltbild or Hugendubel.

The device has an 800x480 7" TFT (yep, no e-ink), 2100mAh battery, it can display PDFs, EPUB, and TXT files (and Adobe DRM crap, which I don't really care about), it has an accelerometer which allows for landscape/portrait switching, it can play MP3, OGG, WAV, and WMA audio files (headphone jack), it can display pictures (BMP, GIF, JPG, even PNG, though that's not mentioned in the vendor's specs), and it has 2GB internal storage for books/music/pictures. Uploading of (non-DRM) content is done by a simple file copy, it enumerates as a standard USB mass storage device with FAT filesystem. It's a relatively nice reader for the price, I've read a few PDFs (datasheets, presentations) on it in the subway/train while listening to music from the device and it's quite OK for my purposes. So much for the review part.

However, I didn't really buy it for reading books on it, I was more interested in taking it apart, of course ;-) My hope was that it would turn out to be a really cheap device running Linux/U-Boot which would be perfect for playing around with embedded Linux stuff. Unfortunately, I wasn't so lucky (it seems).

The TrekStor eBook Reader 3.0, opened

I've posted a few photos of the device and its hardware components on my flickr account and over at randomprojects.org, together with all the information I was able to find out so far. Here's a quick summary:

  • Main CPU/SoC: FI E200 B6077BA 26P1
  • RAM: MIRA P3S12D40ETP (512MBit / 64MByte DDR SDRAM, max. 200MHz)
  • NAND flash: Samsung K9GAG08U0E (16GBit / 2GByte, x8, 3.3V)
  • Battery management: KrossPower AXP199 A5004AB 36G
  • RTC/clock/calender chip (I2C): H8563S
  • Some accelerometer (to switch between landscape/portait mode), model unclear so far, maybe the chip labeled 605 132?

The TrekStor eBook Reader 3.0, CPU

There are public datasheets for most of the hardware components (see randomprojects.org for links), but unfortunately the most important one (for the CPU) is not yet found/identified. I was told that the CPU/SoC is probably based on an ARM9 (ARM926EJ-S) core and the firmware running on it seems to be some uCos-based RTOS (not Linux, unfortunately).

So far I was not able to find out the vendor name or website of the "FI E200" CPU/SoC (let alone any datasheets), any hints would be highly appreciated. I checked arm.com: Processor Licensees, but the only two companies whose name starts with "F" having licensed an ARM9 core are Fujitsu and Freescale, which doesn't fit, I think?

I could (and probably will) check the PCB for RX/TX lines on an UART and/or JTAG pads (none are obviously labelled), and given that it's and ARM9 core there is a good chance that OpenOCD can be used and that a standard cross-gcc toolchain for ARM will work. However, that is all pretty pointless until it's clear which SoC exactly is used, and thus whether there is already Linux and/or U-Boot support for it and/or whether datasheets are available so that the respective code could be written. Without datasheets, this is going to be a pretty painful experience, not really worth investing much time, IMHO.

If anyone knows more about the vendor/device and respective datasheets, please let me know. Thanks!

Update 2012-04-19: I found the UART TX pin a while ago, a bootlog is available. The CPU and all other chips are also known now: The SoC is an Allwinner Technology F1 E200, the orientation sensor is a MEMSIC MXC6225XU.

256 Creative Commons Christmas Songs

Christmas Tree

Yes, it's that time of the year again... it's almost Christmas, which means that I once again updated my 10 + 100 Creative Commons Christmas Songs blog article I originally wrote in 2005. That's a collection of a lot of freely downloadable, Creative Commons licensed Christmas music.

Some of the older entries in the list are no longer available unfortunately, some only needed a URL update, and I also added more than 30 new songs this year.

This currently makes a total of 256 CC Christmas songs (more will probably be added over the next few days), so head over to the full song list and get those downloads started...

(Photo: Wikipedia. Author: Malene Thyssen. License: GFDL 1.2 / CC-BY-SA 2.5)

Nine Inch Nails album "The Slip" released under Creative Commons license

NiN

You might have already heard of it — the new Nine Inch Nails album "The Slip" has been released by them under the Creative Commons BY-NC-SA 3.0 US license. Yep, that's right, it's totally legal to download it from the web — and use it for any non-commercial purposes!

It's a bit annoying that they want your email address, though. Nothing that bugmenot.com (or similar) cannot fix, but still. Luckily, the files are now also available from archive.org! This, and the fact that the music is CC-licensed allowed me to "play" one of the songs in my Creative Commons music podcast (RSS), and more will likely follow.

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 foo.au > /dev/dsp: 3% CPU load (but sounds crappy)
    • $ cat foo.au > /dev/audio: 3% CPU load (sounds better)
    • $ mplayer foo.au: 5% CPU load
    • $ aplay foo.au: 5% CPU load
    • $ playsound foo.au: 5% CPU load
  • AIFF:
    • $ sox foo.aiff -t wav - | aplay: 50% CPU load (a bit stupid, but it works)
  • Streaming MP3:
    • $ mplayer http://www.example.com/foo.mp3: doesn't work, 100% CPU load.
    • $ wget http://www.example.com/foo.mp3 -O - | madplay - : 17% CPU load
  • Streaming Ogg Vorbis:
    • $ cd /usr/share/doc/libvorbisidec-dev/examples
      $ wget http://www.example.com/foo.ogg -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.

Syndicate content