Another of the main features of my server was always intended to be to stream media to other devices around the house (iPhone, DVD player, media streaming box). This is predominantly music, but I wanted to get video and photos working too (just out of idle technological interest).
My first port of call was uShare, described as “A free UPnP A/V & DLNA Media Server for Linux“. Unfortunately it’s a little too lightweight for me, and left me very little in the way of error messages and feedback when my media wasn’t visible. I initially chose it because it’s free and licensed under the GPL, principles which I generally approve of, but it turns out it’s also no longer being actively developed so there is little chance of problems being resolved.
Next I went to Twonky Media Server, which seems to get mentioned quite a lot when media servers are discussed. The site provided installation files and a guide, which I followed without any issues. Once installed, the server was immediately up-and-running, which is where my problems began. The admin page can be found at http://<servername>:9000/config and one of the pages lists the folders which should be shared. I duly added my “Music” folder and re-scanned. Behaviour here became sporadic at best, due entirely to the folder owner and permissions as far as I can tell.
Nowhere on the entire internet does anyone seem to tackle the topic of user groups and permissions on folders to be shared through Twonky Server. My “Music” folder is also a Samba share, which I was trying to set up at the same time. Each time I changed the folder owner to ‘smbuser‘ (the group allowed to view the Samba share), the music files would disappear from Twonky. But why is this so? There’s nothing in the manual which specifies that files and folders should be owned by a particular user. If I changed the owner to the ‘nobody‘ user and the ‘nogroup‘ group, the files would re-appear, but this meant they were no longer visible through Samba!
I eventually ended up with a main folder belonging to the user and group ‘nobody‘ and ‘nogroup‘. Within this reside three folders, all shared individually through Twonky. Each of these is in the ‘twonkymedia‘ group.
chown .smbuser /path/to/share/
All my Linux users are now members of the ‘twonkymedia‘ group, as well as ‘smbuser‘. This seems to have resulted in a setup which allows me to access the share (with write permissions) through Samba, while still letting Twonky see and serve all of the media files. I have no idea whether this is the right way to do it, but it’s my way! Note that it doesn’t seem to matter who owns the folders within the shares, but I have found that it is still important to chmod the shared folders once you’ve created them (see my UHS Samba article for more detail):
chmod 2775 /path/to/share/
Now it’s all done, it’s a beautiful thing to behold:
Twonky Server itself seems a nice piece of software with plenty of options, most of which are self-explanatory. So far it’s seamlessly served up music to iOS and Android phones (via PlugPlayer), and to a Zyxel DMA-1000 media streaming box too. It seems nice and stable, and I’ve had no problems.