Please log in first.

Clear message
Locked History Actions

BackyardRadio

about

install Openwrt Kamikaze

  • we are using current (mid november 2007) stable 7.09
  • only routers with broadcom wireless chips should use kernel 2.4 based firmware images

flash with tftp

base system config

general config

  • check out this page for network, switch and wireless configuration

firewall

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

1st login

telnet to 192.168.1.1

additional packages

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

usb storage

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

usb audio

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
...
..
.

music player daemon

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: 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

configure mpd

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)

setup mpd client

mpc

ncmpc

is a ncurses console frontend to mpd, start with

ncmpc -h $ROUTERIPADDR

GUI clients

http://musicpd.org/clients.shtml

setup playlists

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: freieradios.m3u

start on bootup with default playlist & volume

save this script to /etc/init.d/mpd

#!/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

other methods to alter music repository

  • ftp server
  • samba server
  • simple http filemanager

setup FM radio

antenna

frequency selection

range test

distributing audio signal over IP to several transmitters

  • icecast server on well connected site within the mesh network
    • can be a microFM router
    • better use more powerfull hardware, eg mini-itx with SATA
    • can do live and playlist streams
    • can relay (~proxy) other streams in mp3/ogg format
    • in combination with olsr & anycast it would be the core

      • of a city wide audio/video live stream distribution system (IP)

other appliances

as openwrt focuses networking appliances some kernel modules - especially usb related stuff - is missing.

  • edit target/linux/<platform>/config

  • 'make' (do not call 'make menuconfig'!)

web server

  • busybox httpd is ok for static content
  • lighthttpd can do php and virtualhosts

file services

  • samba (2-4 Mbit from USB disk)
  • sshfs (1-2 Mbit)
  • nfs

eg. mount remote filesystem over inet with sshfs and export as samba share to localnetwork

usb joystick

could be used to control mpd, switch outputs of outbreak board,.... /dev/evdev is our friend - needs kernel recompile

outbreak board

e.g vellemann K8055 http://linuxk8055.free.fr/

digitemp

read one-wire-sensors such as DS1820

bluetooth dongle

use mobile phone as a remote control (HID has to be compiled in the kernel)

webcam

cams that use pwc or spca driver work fine

CategoryHowto