OpenWrt Forum Archive

Topic: Router for mpd like Asus WL 500g

The content of this topic has been archived between 1 Apr 2018 and 7 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I have seen some "hacked" Asus Routers in the internet that can run mpd.

I know the WL-520gu and the WL-500g* could do that.
Is it also possible with the WL-600g?

Is there a piece of hardware you could advise me?

Thanks for your help.

Tobbes

Hello experts,

I have flashed openWRT on the WL600.

The router works with it :-)

With the WIKI I was able to use it as AP (masquerade).

I could install usb software as well. But there is not enough diskspace for mpd :-(

Could anybody help me with this problem?
Are there packages that could be removed to have enough diskspace for mpd?

Would somebody help me to compile a firmware if neccessary?

Thanks for reply.

Tobbes

If your hardware is equipped with at least 8M flash then it should be possible. You'd need to strip alsa crap and some other dependencies out of the mpd configuration and build it yourself. I only keep dependencies to mp3, flac and ogg - the rest is removed. Alternatively you can use extroot to add more space for packages

Hello flux - thanks for reply.
The WL600 owns only 4MB Flash ...

Is it possible to mount /overlay on an USB Flash Memory (a 256MB SD Card maybe)?

Tobbes

Hello experts,

I have successfully installed extroot on a 256MB SD Card with ext3.

I have written fstab as shown in the wiki (option is_rootfs 1) and /overlay was shown (df) with only 3%.

The problem: Before I change to is_rootfs the AP works and I could install packages with opkg.
After the change to SD Card I could not reach the internet or install packages (because of missing connections).
Why?

My second idea was to mount the card to /mnt/usb and install additional packages there (opkg -dest usb install mpd).

The internet is still working after mounting the card and I was able to install packages.
But now the box hangs up very often during installing packages.
For mpd it is installing a lot of dependencies and hangs up so often that I could not finish it at one evening?

Is there something wrong? Could you advice me a good way to do?

Thanks Tobbes

Hi tobbes, I'm doing a similar thing with a TP-Link WR703N, I'm using a usb hub with a memory stick attached to it, I set up my network as a wireless client (v.s an access point like your setup) I have had no trouble installing packages to my mounted usb stick (I'm not using extroot, I saw no need for it, I just updated the $PATH variable in /etc/profile to include the paths of the installed packages - refer to openwrt wiki on opkg).

Assuming you're not having any trouble installing packages bar the problems with hang ups. I'd say it's likely your problem is due to your  network setup, are you running out of ram? (run top to see what processes are hogging ram) #.

If that's not the issue, it sounds as if your network setup may be a little borked, and hence perhaps you should try reflashing and setting up your network, then testing it thoroughly to see that your set up isn't the issue, then proceed to install usb-storage support and then mpd.

I'm not familiar with the router you have or openwrt, but I can try and help until someone more knowledgeable turns up.

(Last edited by willprice94 on 25 Dec 2011, 22:02)

Hello experts,

thanks for your help.
Today I have tried to install mpd again.

Here the last screen of top before hanging up:

Mem: 12640K used, 784K free, 0K shrd, 312K buff, 2708K cached
CPU:   3% usr  93% sys   0% nic   0% idle   1% io   0% irq   0% sirq
Load average: 2.48 0.93 0.34 1/40 1279
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
1137  1132 root     R     1364  10%  20% top
1101     1 nobody   R      912   7%  11% /usr/sbin/dnsmasq -K -D -y -Z -b -E -
1195  1124 root     S     2828  21%   8% opkg -dest usb install mpd
1131   936 root     S     1204   9%   7% /usr/sbin/dropbear -p 22 -P /var/run/
  726     1 root     S     1464  11%   7% wpa_supplicant -B -P /var/run/wifi-wl
   87     2 root     SW       0   0%   6% [mtdblockd]
1111     1 root     S     1352  10%   2% watchdog -t 5 /dev/watchdog
  284     2 root     SW       0   0%   1% [usb-storage]
  596     2 root     SW       0   0%   0% [kjournald]
  694     2 root     SW       0   0%   0% [irq/32-b43]
   73     2 root     SW       0   0%   0% [kswapd0]
    3     2 root     SW       0   0%   0% [ksoftirqd/0]
  316     1 root     S     1372  10%   0% syslogd -C16
1122     1 root     S     1372  10%   0% udhcpc -t 0 -i wlan0 -b -p /var/run/d
    1     0 root     S     1368  10%   0% init       
1124  1123 root     S     1368  10%   0% -ash
1132  1131 root     S     1368  10%   0% -ash
  301     1 root     S     1368  10%   0% init       
1279  1195 root     S     1364  10%   0% wget -q -O /tmp/opkg-rbAha3/libvorbis
  318     1 root     S     1352  10%   0% klogd


Is there a memory problem?

What can I do?

Oh good news :-)

I have installed all packages one by one and now it seems to be installed:

root@OpenWrt:~# opkg -dest usb install mpd
Package mpd (0.15.8-5) installed in usb is up to date.
root@OpenWrt:~#


Now I will work on mpd :-)

I think first I must configure mpd but I can't find /etc/mpd.conf ...

Must I create a new conf file?

Thanks - Tobbes

tobbes wrote:

I think first I must configure mpd but I can't find /etc/mpd.conf ...

It's not in /etc/mpd.conf, it's in ${USB}/etc/mpd.conf

In other words, you installed mpd on the USB drive, so you should look for the configuration file on the USB drive. My setup has the USB drive on /opt, so the config file is in /opt/etc, so I start the daemon with:

mpd /opt/etc/mpd.conf

Where did you mount the USB drive?

Thanks to whbjr,
I have also mount the first USB drive to /opt (/mnt/usb) and I have found /opt/etc/mpd.conf

But first I tried to mount a second USB drive with vfat on it. But I became an error the hole evening:
mount: mounting /dev/sdb1 on /mnt/share failed: Invalid argument

I have seen this in dmesg:
usb 1-1: new high speed USB device using ehci_hcd and address 4
usb 1-1: configuration #1 chosen from 1 choice
scsi2 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
scsi 2:0:0:0: Direct-Access     VMAX     256MB            2.00 PQ: 0 ANSI: 2
usb-storage: device scan complete
ready
sd 2:0:0:0: [sdb] 512000 512-byte logical blocks: (262 MB/250 MiB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sdb: sdb1
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] Attached SCSI removable disk

My /etc/config/fstab looks like this:
config 'global' 'automount'
        option 'from_fstab' '1'
        option 'anon_mount' '1'

config 'global' 'autoswap'
        option 'from_fstab' '1'
        option 'anon_swap' '0'

config 'mount'
        option 'target' '/mnt/usb'
        option 'device' '/dev/sda1'
        option 'fstype' 'ext3'
        option 'options' 'rw,sync'
        option 'enabled' '1'
        option 'enabled_fsck' '0'
        option 'is_rootfs' '0'

config 'swap'
        option 'device' '/dev/sda2'
        option 'enabled' '0'

config 'mount'
        option 'device' '/dev/sdb1'
        option 'fstype' 'auto'
        option 'options' 'rw,sync'
        option 'enabled_fsck' '0'
        option 'enabled' '1'
        option 'target' '/mnt/share'

I have created an folder share in /mnt/ and I have also tried the uci commands:
/etc/init.d/fstab stop
uci add fstab mount
uci set fstab.@mount[-1].device=/dev/sda1
uci set fstab.@mount[-1].options=rw,sync
uci set fstab.@mount[-1].enabled_fsck=0
uci set fstab.@mount[-1].enabled=1
uci set fstab.@mount[-1].target=/mnt/share
uci commit fstab
/etc/init.d/fstab start

I have also installed this packages :

opkg install kmod-usb-storage
opkg install kmod-usb-storage-extras
kmod-nls-base
kmod-nls-cp437
kmod-nls-cp850
kmod-nls-iso8859-1
kmod-nls-iso8859-15
kmod-nls-utf8


Nothing works to mount the second USB drive!

What do I wrong?

Thanks - Tobbes

Hello to all

I try more with my Asus to bring up my mpd ...

I have found the mpd.conf and I have configured first things.
But I do not know how to start mpd.

I thought madplay would be easier at first.

I installed it and found it in /opt/usr/bin
there is:
alsamixer  amixer     aplay      arecord    madplay

But I can't start anything:
/opt/usr/bin # ./aplay
./aplay: can't load library 'libasound.so.2'
/opt/usr/bin # ./alsamixer
./alsamixer: can't load library 'libform.so.5'
/opt/usr/bin # ./madplay
./madplay: can't load library 'libmad.so.0'

(alsa-lib / alsa-utils/ and libmad are installed !!)

I think there is something wrong with the path for the commands.


In /etc/profile stands:
export PATH=<current default path>:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
export LD_LIBRARY_PATH=<current default LD library path>:/opt/lib:/opt/usr/lib



Whats wrong?
Please give me a hint:-)

And how can I start mpd?

One more question: Where is the reboot command? For some days I could reboot the box but now the command is missing ....

Hello, thank you for reading my diary :-)

I could solve some problems.
The path in /etc/profile must be changed this way:
In terminal:
echo 'export PATH=$PATH:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin' >> /etc/profile
echo 'export LD_LIBRARY_PATH=/opt/lib:/opt/usr/lib' >> /etc/profile

So the right path will be taken. Some symbolic links are necessary to:
For my problem with alsa I did:
mkdir /usr/share/alsa/
ln -s /opt/usr/share/alsa/alsa.conf /usr/share/alsa/alsa.conf

And for the mpd.config I create a link too.
ln -s /opt/etc/mpd.conf /etc/mpd.conf

Now I could start mpd without errors.
/opt/usr/bin/mpd /opt/etc/mpd.conf

With my laptop I could connect to mpd over Sonata and see the libary on mpd.
But the music will not play. I could choose a track but it will not start to play.

Maybe someone know what to do?

With "madplay /path/to/music/track.mp3" the router could play music.



Thanks for reading - tobbes

Hello possible reader,

I want to use the box als mp3 player in an existing network. So it is working in client modus to get WiFi.

I have taken extroot installation because my first try with an /opt place to install mpd needs to much links to work...

Now mpd is on the box and I can choose music over Sonata or Ipod app.

Unfortunately mpd stutters randomly every 3 or 5 seconds.
The box is running over limit I think.

I have set audio_buffer_size to "4098" and buffer_before_play to "25%" but it is stuttering all the time.

I have looked with command top and found this:
1053  1052 root     S <  25376 189%   0% /usr/bin/mpd
1052  1050 root     S <  25376 189%   0% /usr/bin/mpd
1050     1 root     S <  25376 189%   0% /usr/bin/mpd
1054  1052 root     S <  25376 189%   0% /usr/bin/mpd

Mem is about 189% - is this my problem?
What can I do - please give me a hint :-)

Tobbes

tobbes wrote:

What can I do - please give me a hint :-)

Tobbes

if you use alsa then you should switch to oss. Check the /etc/mpd.conf

Hello flux,
thanks for your answer.
I have tried a little bit but I cannot activate OSS.
I have changed the mpd.conf to OSS output but get the message:

output: line 189: No such audio output plugin: oss
I have tried to force a OSS device like /dev/audio or /dev/dsp
But I get always the same error.

I installed kmod-usb-audio but still the same....
What must I change to get OSS working (alsa is deactivated in mpd.conf of sure).

Thanks for helping me.

tobbes wrote:

I installed kmod-usb-audio but still the same....
What must I change to get OSS working (alsa is deactivated in mpd.conf of sure).

Thanks for helping me.

I suppose that the mpd binary you're using is compiled without the oss support

root@OpenWrt:~# mpd -V
mpd (MPD: Music Player Daemon) 0.15.8

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Supported decoders:

[mad] mp3 mp2
[vorbis] ogg oga
[flac] flac
[audiofile] wav au aiff aif
[faad] aac

Supported outputs:

shout null fifo alsa httpd

Supported protocols:

file:// http:// lastfm:// mms:// mmsh:// mmst:// mmsu://

Shit I think you are right.
Any ideas?

tobbes wrote:

Any ideas?

a) compile it yourself
b) wait for the backfire 10.03.2 and install mpd-mini
c) try to install trunk snapshot image and install mpd-mini

I'd follow a) because no one knows how long it would take to release 10.03.2

Thanks again flux.

I have looked in wiki what do to but I don't think that I can compile it myself.

I do not know how to bring in mpd and allow OSS support.

Do you know a how-to (maybe in german)?

tobbes wrote:

Thanks again flux.

I have looked in wiki what do to but I don't think that I can compile it myself.

I do not know how to bring in mpd and allow OSS support.

Do you know a how-to (maybe in german)?

well the wiki build page is here http://wiki.openwrt.org/doc/howto/build

you would need to prepare the build_root environment (there is a german translation)
get the sources with the svn checkout svn://svn.openwrt.org/openwrt/tags/backfire_10.03.1
get the packages feeds - ./scripts/feeds update -a
replace the content of the feeds/packages/sound/mpd/Makefile with this paste http://pastebin.com/rxjgDUWL and execute ./scripts/feeds install -a
then make menuconfig select your hardware and all packages you need (luci for example). Also select mpd
then build the image.

Hello at all,

I have tried to compile a firmware on my own but it shows always errors and FORCE messages.
@flux:
whats about point c)  try to install trunk snapshot image and install mpd-mini
I did not found the trunk snapshot ready to flash on the ASUS.

Where can I get it?

Thanks in advance - Tobbes

tobbes wrote:

Hello at all,

I have tried to compile a firmware on my own but it shows always errors and FORCE messages.
@flux:
whats about point c)  try to install trunk snapshot image and install mpd-mini
I did not found the trunk snapshot ready to flash on the ASUS.

Where can I get it?

Thanks in advance - Tobbes

well, all snapshots are here http://downloads.openwrt.org/snapshots/trunk/
The name of the image to flash should be the same like with the backfire. I do not know what image is suitable for your hardware, sorry. And I cannot guaranty that the snapshot version is stable enough with your hardware because I've never tried it. All I meant - it is worth to try

Hello experts,

now I thinks its over :-(
I have flashed the original ASUS Firmware to get to the trunk Firmware on the box.
I haved seen that the trunk firmware has no luci (web interface).
So I think I go back to backfire rc4 and install the repository of trunk on it to get mpd-mini.
I tried to flash the original ASUS firmware again but now the box only shows a red LED.

This red light is the on-off led that normaly is green and must flshing to flash the ASUS Firmware.

What can I do to get the ASUS Firmware on the box again????

Thanks - Tobbes

Hello,
I have found the router on 192.168.1.1!
I will try to flash it up to backfire rc4 again and fetch mpd-mini out of trunk repository.

Do think this way could be successful?

Hi mpd-mini is installed over trunk packages over backfire rc4 without error messages.

But now I get an error like this:

root@OpenWrt:~# /etc/init.d/mpd start

Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 128
  Mono:
  Front Left: Playback 40 [31%] [0.00dB] [on]
  Front Right: Playback 40 [31%] [0.00dB] [on]
BusyBox v1.15.3 (2010-11-11 23:54:31 PST) multi-call binary

Usage: nice [-n ADJUST] [PROG [ARGS]]

Run PROG with modified scheduling priority

Options:
    -n ADJUST    Adjust priority by ADJUST

/etc/rc.common: line 78: service_start: not found

Could I fix this? (Maybe opkg upgrade on trunk...?)

Thanks for helping me!
Tobbes