UPnP AV streaming in Ubuntu with a D-Link DNS-323

I'm writing this little tutorial because I couldn't find the info nicely laid out anywhere else on the web.

So, about month ago I bought myself a D-Link DNS-323 NAS device. So far, it's been pretty awesome (after I upgraded the firmware, at least), allowing for networked RAID-1, a built-in iTunes server, print server and streaming UPnP AV support, all for a pretty decent price. The first three on those list are a snap to set up, the fourth is a little more cryptic. UPnP, as far as I can tell, is usually meant to be used with a media server (something like a MythTV setup), rather than just for desktop users. I found very little info about how to connect to and play content from a UPnP AV server using a desktop software client. I did find, however, mention of djmount, a utility that allows you to mount a UPnP AV server's content as a filesystem. Sounds great! However, getting it set up and functioning on my Ubuntu box was still anything but straight-forward. Here's how I did it in Feisty.

First off, djmount's docs mention it needs FUSE, so I installed libfuse2, and to build djmount from source, I needed libfuse-dev (just installing this package with aptitude automatically installs libfuse2):

sudo aptitudue install libfuse-dev

Next, download djmount, untar and cd to the resulting directory. then build and install:

wget http://downloads.sourceforge.net/djmount/djmount-0.71.tar.gz?modtime=1156717401&big_mirror=0
tar -zxvf djmount-0.71.tar.gz
cd djmount-0.71
./configure
make
sudo make install

Next, make a mount point in /media. I used "upnp", but you could name it anything.

cd /media
sudo mkdir upnp
sudo chmod 777 upnp

The chmod 777 was recommended in a forum post I found somewhere about djmount, I don't know if it makes a huge difference or not, but it's what's I did.

Now, load the fuse FUSE kernel module and then mount the filesystem:

sudo modprobe fuse
sudo djmount -o allow_other /media/upnp

The allow_other option is what tripped me up at first. I was trying it without that and all I was getting was a /media/upnp directory that was appearing as a unknown filetype in Nautilus. I did a djmount --help and guessed that the -o allow_others option was what I needed. Lucky me, it worked.

Now, assuming the UPnP AV server on your DNS-323 is set up and working properly, you should now be able to access the files on it just like they were on your local disk. I myself seem to have no trouble watching videos over the network in VLC. If you want to unmount it, just do the following:

fusermount -u /media/upnp

Hopefully I didn't leave anything out.