Hi all.
Here is my take on a portable Pi music player.
http://youtu.be/X0d7d0fCjEI
Sorry about the washed out colours - they look great in real life (see the Star Wars clip at the end for an idea). Also the backlight fade effect looks strange on the video...
In terms of hardware, in that layer case is:
(a) a modded Pi model A (removed the large connectors and inserted a low dropout regulator so that the Pi can work reliably on battery power);
(b) an i2s DAC (http://www.mikroe.com/downloads/get/146 ... l_v100.pdf )
(c) one of texy's TFT displays (http://www.raspberrypi.org/phpBB3/viewt ... 93&t=53144), with a new connector to make it sit closer to the Pi
(d) an arduino that monitors the battery voltage and shuts down the Pi if it gets too low (the vid does not show the button under the screen that switches on the Pi which is also managed by the arduino)
Mame is controlled by a Nintendo wavebird with its receiver hacked to an arduino Leonardo plugged into the USB port so that it presents itself as a HID keyboard/analogue joystick (not shown in video)
In terms of software it uses:
(i) the latest November 2013 version of Arch
(ii) koalo's i2s kernel (the new one based on 3.10 http://www.raspberrypi.org/phpBB3/viewt ... =44&t=8496 and https://github.com/koalo/linux/tree/rpi-3.10.y-asoc)
(iii) to which I have added notro's TFT display kernel drivers (https://github.com/notro/fbtft)
(iv) MPD
(v) a few configurations/startup scripts
The result is a MPD mini-client that wirelessly streams internet radio stations and my server-based CD collection. It will also work with locally (to the Pi) stored CD rips. In terms of output it uses standard 3.5mm jacks that I plug into headphones or to a Minirig speaker and subwoofer. Sound quality is really excellent (IMO) but I paid some attention to shielding the DAC from the Pi. Note that as this uses MPD, any MPD client can control the device (at one stage I had a web front end but dropped it as the iPhone interface through mPod worked really well).
A bash build script based on what I was using is here:
https://www.mediafire.com/?huor35gps1ez2zv
Note that although this script will work on a model B with "gpu_mem=16" in config.txt, it is not the one I actually used (I cross-compiled and it will probably take about 12 hours to run on a Pi) you will need a lot of spare SD card space and there is a lot more you will need to do to get the overall solution working as I have it… Also note that the script runs once then reboots and then you will need to run it again post-reboot. Finally note that the script is based on kernel drivers still in the throws of very active development on the i2s 3.10 side, I imagine koalo will very shortly update the i2s drivers such that the hacks I have deployed to get the thing working will no longer be required (and may break the script).
Here is the link to the main code:
https://www.mediafire.com/?j8ht04tsoljgd3j
It is with some trepidation that I am posting the code here - not because I don't want anyone to use it (it is freeware - or more precisely, I will not enforce any copyright against anyone in the world and the code can be issued under any licence anyone wants) but because it is not very well written (in terms of style - I should really have objectified it - and it is probably the best example of how not to write) and because I imagine that I am making a rod for my own back if anyone wants to try to replicate the device…
Note that the code does not include the link with the arduino (for battery monitoring/shutdown) and for the link to MAME (this works but is not very good, the commented out code results in a segfault that I suspect was due to pygame not having the chance to exit cleanly before advmame was called, my eventual solution uses a bash script as this was quicker than investigating the issue).
Future work will be to internalise the battery (but I will need one with a different shape/size).
Thanks to everyone on the forum for their help but especially notro, koalo and texy.
Have fun.
BBUK