disable it for the workshop, if you enable it later on don't forget to exclude port TCP 6600 (or the one you have chosen for mpd) and UDP 698 for olsr
stop & disable
/etc/init.d/firewall stop /etc/init.d/firewall disable
telnet to 192.168.1.1
we need some kernel modules on the base system to recognize USB stuff on bootup
ipkg install kmod-usb-uhci-iv kmod-usb2 kmod-usb-storage kmod-fs-vfat kmod-fs-ext2 kmod-fs-ext3 kmod-usb-audio olsrd
after connecting a storage device and running dmesg on the shell you should see something similar to this:
scsi0 : SCSI emulation for USB Mass Storage devices Vendor: Multi Model: Flash Reader Rev: 1.00 Type: Direct-Access ANSI SCSI revision: 02 Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0 SCSI device sda: 4001760 512-byte hdwr sectors (2049 MB) sda: Write Protect is off Partition check: /dev/scsi/host0/bus0/target0/lun0: p1 WARNING: USB Mass Storage data integrity not assured USB Mass Storage device found at 2
but first connect the device to your PC and copy some audio to it.
the provided config files assume that all audio will be in directory /music on the storaged-device
after connecting USB audio device dmesg output should look similar to this:
usbaudio: device 2 audiocontrol interface 0 has 1 input and 1 output AudioStreaming interfaces usbaudio: device 2 interface 2 altsetting 1 channels 1 framesize 2 configured usbaudio: valid input sample rate 48000 usbaudio: valid input sample rate 44100 usbaudio: device 2 interface 2 altsetting 1: format 0x00000010 sratelo 44100 sratehi 48000 attributes 0x01 usbaudio: device 2 interface 1 altsetting 0 does not have an endpoint usbaudio: device 2 interface 1 altsetting 1 channels 2 framesize 2 configured usbaudio: valid output sample rate 48000 usbaudio: valid output sample rate 44100 usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 44100 sratehi 48000 attributes 0x01 usbaudio: registered dsp 14,3 ... .. .
MPD runs without any GUI in the background. it takes care of playlist and library management, decoding of compressed audio files and output via selected sound system.
in kamikaze 7.09 and current SVN build of mpd 0.13 ogg/vorbis support is disabled. but we want ogg vorbis, as for example many community radio stations are streaming in ogg format. read more about patent free formats here: http://www.fsf.org/resources/formats/playogg
cross-compiling mpd manually throws an error if ogg support is enabled
workaround: use mpd 0.12 - it compiles with ogg/vorbis support. grab it here: [attachment:mpd_0.12.0-1_mipsel.ipk]
this gives us a minimalistic mpd with mp3, ogg and flac support. output system is OSS as we do not need extra alsa packages for 2.4 kernels
for an inhouse audio player you usually want to have some webfrontend and more input modules in mpd (mp2, mod, …)
to control mpd from the router itself we install mpc, a very simple cmd line client. hint: mpd can also be controlled with plain telnet commmands
ipkg install mpc
sample MusicPlayerDeamonConfig for OSS
mpd.error and mpd.log should be in /tmp as too many write attempts on your flashdisk (and will distroy it)
is a ncurses console frontend to mpd, start with
ncmpc -h $ROUTERIPADDR
you can either upload stream playlists (for webradios) to the “playlist” directory (check you mpd.conf to see where it is) or compile one in the playlist editor of your favorite mpd client.
playlists are in .m3u format, here is one to relay community radio stations of austria: [attachment:freieradios.m3u]
save this script to /etc/init.d/mpd
#!sh (-)
#!/bin/sh /etc/rc.common
START=99
start() {
mount /www/music/flash
sleep 1
mpd /etc/mpd.conf
mpd sleep 2
mpc volume 75
mpc load freieradios.m3u
mpc play
mpc repeat 1
mpc crossfade 3
}
where $X is the volume level. the optimum has to be found by empiric testing listening to the air signal.
test it:
/etc/init.d/mpd start
if everything runs fine enable the script on bootup
/etc/init.d/mpd enable
as openwrt focuses networking appliances some kernel modules - especially usb related stuff - is missing.
eg. mount remote filesystem over inet with sshfs and export as samba share to localnetwork
could be used to control mpd, switch outputs of outbreak board,…. /dev/evdev is our friend - needs kernel recompile
e.g vellemann K8055 http://linuxk8055.free.fr/
read one-wire-sensors such as DS1820
use mobile phone as a remote control (HID has to be compiled in the kernel)
cams that use pwc or spca driver work fine