ipkg install kmod-fs-nfsand then attempted to mount the filesystem export from the fileserver -
mkdir /tmp/musicthen
mount -t nfs 192.168.1.77:/home/share/music /tmp/music -o nolock
ls /tmp/musicindeed shows the music directory from the fileserver -
root@OpenWrt:~# ls /tmp/musicFollowing the Usb Storage and Usb Audio wiki entries, I installed the appropriate kernel modules to enable my usb soundcard -
2 Many DJ's
Acid House Kings
Al Green
Babyshambles
Barenaked Ladies
Buena Vista Social Club
Bugz in the Attic
ipkg install kmod-usb-ohci kmod-soundcore kmod-usb-audioThen, on plugging the soundcard in, dmesg gives -
hub.c: new USB device 00:04.0-1, assigned address 2I then installed the Music Player application -
usbaudio: device 2 audiocontrol interface 0 has 0 input and 1 output AudioStreaming interfaces
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 44100
usbaudio: valid output sample rate 48000
usbaudio: device 2 interface 1 altsetting 1: format 0x01000010 sratelo 44100 sratehi 48000 attributes 0x01
usbaudio: registered dsp 14,3
usbaudio: constructing mixer for Terminal 3 type 0x0301
usbaudio: registered mixer 14,0
usb_audio_parsecontrol: usb_audio_state at 807f8860
ipkg install mpdand some other dependences that weren't properly flagged when mpd was installed -
ipkg install alsa-lib libpthreadeditted the config file -
# MPD CONFIG FILE
# For a full description of all config parameters,
# Check the mpd man page, "man mpd".##################### REQUIRED ###########################
music_directory "/tmp/music"
playlist_directory "/tmp/music"
db_file "/tmp/music/mpd.db"
log_file "/tmp/mpd.log"
error_file "/tmp/mpd.error"
pid_file "/tmp/mpd.pid"
####################################################################################################################
# EVERYTHING ELSE IS OPTIONAL
############################################################################ AUDIO OUTPUT ##########################
#
# use this if you want to use OSS audio output
audio_output {
type "oss"
name "my OSS sound card"
device "/dev/sound/dsp" # optional
format "44100:16:2" #optional
}
#
# OSS Mixer
mixer_type "oss"
mixer_device "/dev/sound/mixer"
mixer_control "PCM"
################## SECURITY SETTINGS ######################
#
# It is encouraged to run MPD as
# non-superuser. If you start mpd as root
# (for example, in an init script), set
# this value, then mpd will drop root priveleges
# and runs as the user specified.
#
user "share"
################# MISCELLANEOUS OPTIONS ###################
#
port "6600"
chmod 777 /dev/sound -RThen try it ! First start the music player -
mpdThere may be a long wait while it builds the database before daemon starts up. Then can use the command-line controller to add all the files in the database to a playlist, shuffle it, then play -
mpc listall mpc addand lovely music!
mpc shuffle
mpc play
In order for it all to start up properly on power-up of the router, create /etc/init.d/mpd -
#!/bin/sh /etc/rc.commonand then to set it up to run on router restart -
# Copyright (C) 2006 OpenWrt.org
START=70
start() {
mkdir /tmp/music
mount -t nfs 192.168.1.77:/home/share/music /tmp/music -o nolock
chmod 777 /dev/sound -R
mpd
mpc listall mpc add
mpc shuffle
mpc volume 10
mpc update
}
stop() {
killall mpd
umount /tmp/music
}
/etc/init.d/mpd enable
No comments:
Post a Comment