8.09 + mpd/mpc + NFS

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
puppycrack
Posts: 3
Joined: Tue Sep 14, 2010 6:41 pm

8.09 + mpd/mpc + NFS

Post by puppycrack »

Hi all. Great project, and the many posts here have made for a successful hack. Thanks!

I thought it may benefit someone to share my setup:
- OpenWRT 8.09
- mpd & mpc
- alsa support (needed for my Chinese sound "card". without it (and step 5), all I got was beeping from the card)
- NFS (this was my stumbling block, and why I didn't use the MightyOhm FW)

Here's how I did it:
1) install 8.09 off openwrt using recommended method (I used tftp)
http://downloads.openwrt.org/kamikaze/8 ... uashfs.trx

2) change /etc/config/wireless & /etc/config/network as per instructions

3) keep the opkg.conf as delivered in the 8.09 FW for now and
opkg install kmod-usb-audio kmod-usb-ohci nfs-client
* you may or may not need this. you may if all you get is beeping...
opkg install kmod-alsa

4) change opkg.conf to point to packages on mightyohm (http://mightyohm.com/files/kamikaze-2.4/packages/mipsel)
opkg update
install mpd mpc
* While these are in the 8.09 repository, they are too fat to fit into RAM with their dependencies. So we get an older, leaner version from MightyOhm.

5) if you need alsa support:
a) comment out the one line in the file: /etc/modules/60-usb-audio
b) I dont know if this was necessary, but I changed the bitrate in the mpd.conf to 48000 since that's what dmesg output indicated the card was

6) mount NFS:
mount -t nfs [ip.addr.of.system]:/path/to/music /mnt/media -o nolock
* w/o the nolock option, the mount will hang

Seems so easy in retrospect, but it took me many tries to to get it all working.

Hope this helps someone.

- PC
jeroen94704
Posts: 109
Joined: Sat Feb 13, 2010 4:27 am
Location: Eindhoven, the Netherlands

Re: 8.09 + mpd/mpc + NFS

Post by jeroen94704 »

One thing I found out is that when mounting nfs shares, it is important to have portmap running. For some reason, without portmap running, mounting a share can take 5-10 minutes. This may look like it's hung up. With portmap running, it's done in a second.

Jeroen
Tozmo
Posts: 7
Joined: Tue Sep 14, 2010 3:42 pm

Re: 8.09 + mpd/mpc + NFS

Post by Tozmo »

nfs-client doesn't exist. I put nfs-utils. Will see if that works.

Thanks

edit: I get a "permission denied" error when attempting to mount, which may be because of this impossible windows nfs server. However, attempting to mount I can also get "cannot create directory /mnt/media: no such file or directory
puppycrack
Posts: 3
Joined: Tue Sep 14, 2010 6:41 pm

Re: 8.09 + mpd/mpc + NFS

Post by puppycrack »

Tozmo wrote:nfs-client doesn't exist. I put nfs-utils. Will see if that works.

Thanks

edit: I get a "permission denied" error when attempting to mount, which may be because of this impossible windows nfs server. However, attempting to mount I can also get "cannot create directory /mnt/media: no such file or directory
Sorry, I misspoke about the nfs package. It should be "kmod-fs-nfs". This should have a side effect of installing kmod-fs-nfs-common as a dependency.

I am mounting to a Thecus N4100PRO NAS, so YMMV with a Windows NFS server. FWIW, when mounting, you will need to pre-create the directory you are mounting to - in this case, /mnt/media.

HTH.
puppycrack
Posts: 3
Joined: Tue Sep 14, 2010 6:41 pm

Re: 8.09 + mpd/mpc + NFS

Post by puppycrack »

jeroen94704 wrote:One thing I found out is that when mounting nfs shares, it is important to have portmap running. For some reason, without portmap running, mounting a share can take 5-10 minutes. This may look like it's hung up. With portmap running, it's done in a second.

Jeroen
Interesting. I do not have a "portmap" process running, and my NFS mount commands return immediately. As I mentioned in my post, however, if I do not use "-o nolock" on the mount command, it seems to hang. Although I never let it run for more than 2-3 minutes before killing it.
Tozmo
Posts: 7
Joined: Tue Sep 14, 2010 3:42 pm

Re: 8.09 + mpd/mpc + NFS

Post by Tozmo »

I now have a windows folder (and subfolders) mounted and being read by mpd/mpc. A big thanks to puppycrack and MightyOhm, I'm now 90% of the way to what I have been dreaming of (wifi jukebox).
My next tasks will be to figure out how to make multiple windows folders (as in C:\music, external hd D:\music, etc) mount as one volume (symlinks?) so that I have a mega jukebox...
User avatar
pasdesignal
Posts: 20
Joined: Sat Oct 02, 2010 2:31 am

Re: 8.09 + mpd/mpc + NFS

Post by pasdesignal »

Tozmo wrote:I now have a windows folder (and subfolders) mounted and being read by mpd/mpc.
Tozmo: I am trying to do the same with an NFS shared folder from windows xp.

Keep getting 'access denied'/permissions errors when attempting to get mpd to look at "/mnt/media" as its music directory.

Am I missing something obvious here?
User avatar
pasdesignal
Posts: 20
Joined: Sat Oct 02, 2010 2:31 am

Re: 8.09 + mpd/mpc + NFS

Post by pasdesignal »

Heres my mount details:

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock/4 on /jffs type jffs2 (rw)
mini_fo:/jffs on / type mini_fo (rw)
none on /proc/bus/usb type usbfs (rw)
192.168.x.xxx:/test on /mnt/media type nfs (rw,v3,rsize=32768,wsize=8192,hard,udp,nolock,addr=192.168.x.xxx)
User avatar
pasdesignal
Posts: 20
Joined: Sat Oct 02, 2010 2:31 am

Re: 8.09 + mpd/mpc + NFS

Post by pasdesignal »

To clarify what I am trying to do:

Objective is to mount an NFS share from windows XP on Asus wl-520GU. Use it as music directory for MPD.

Whenever I try to get MPD to start, with /mnt/media as its music directory i get:
cannot open music_directory "/mnt/media/" (config line 5): Permission denied

The mount is mounting succesfully, as I can verify that from my log file within NFS server.

Something not working with permissions or user/groups. I am interested to read about what settings others are using...
Tozmo
Posts: 7
Joined: Tue Sep 14, 2010 3:42 pm

Re: 8.09 + mpd/mpc + NFS

Post by Tozmo »

Tricks that I found out, assuming you set up the windows nfs server according to any instruction on the internet:
start portmap from the start on the router (i do it manually because i don't know how to do it otherwise)
in windows, you have to share the folder with NFS sharing (right click -> sharing), whatever you call the folder in the NFS share is your mount path obviously, so keep it simple.
THE SECRET that held me up: click "permissions" in the windows "NFS sharing" folder part on the folder you are sharing. "Allow root access" took me forever to find that that was the problem.
use any mount command, hopefully it works. Start a new thread if it doesn't so we don't clutter puppycrack's post too much. Or shoot me a PM
Post Reply