- Home
- Howtos
- System Admin
- Backing Up Files Using rdiff-backup
- Restoring Backups Made With rdiff-backup
- Logging In Via SSH Without A Password
- Fix Broken Scripts In Ubuntu
- Compiling Software From Source Code
- Deleting Files For Real
- Find The Largest Files On A Disk
- When Linux Goes Rogue – Killing Processes
- System Monitor – Gkrellm
- Finding Your Way Around The Command Line
- Everyday Commands
- Advanced Command Line
- Undelete Files on an ext3 or ext4 File System
- Eyecandy
- Desktop
- Multimedia
- Networking and Email
- Android
- System Admin
- Useful Linux Apps
- My Apps
- Useful Tools
Run a DLNA Server that Works with a Samsung TV
Having just bought a Samsung ‘Smart’ TV, I was very keen to take advantage of its built in DLNA media renderer. I already have mediatomb running on my headless file/mail/web/whatever server, so I thought I’d be all ready to go. Sadly, Samsung seems to have not implemented the DLNA standard in a sane way, and despite following a number of guides on I found on the internets suggesting sending custom http headers to the TV, I could not get mediatomb to play nicely with the TV.
Don’t start me on why Samsung can’t make DLNA work properly. Rather than supporting the standard, they have written and support their own Windows only DLNA server. Not very helpful for their customers who run Linux, OSX or have a NAS appliance. Anyway, I digress.
So having given up on mediatomb, I turned to ps3 media server. PS3 media server, as the name suggests, is a DLNA server focussed on the PS3 as a DLNA renderer. However, it has been adapted to operate with a number of different renderers, including Samsung TV’s.
PS3 Media Server is written in java and is GUI based. This is fine for windows users, who would generally run a server with a GUI. However, for me, and my headless server, it poses a few problems. The main one being getting the thing to run as a daemon. There are a number of options for doing this, but the standard ones didn’t seem to work that well on my setup, so I had to get creative. Anyway, into it:
First thing is to make sure you have a working JAVA runtime. Your distribution should provide the necessary packages. Then download the latest ps3 media server from here. Uncompress it with:
tar -zxpf pms-generic-linux-unix-1.50.1.tgz
If you are running it headless, then you’ll need to set up a basic configuration. So create a file at ~/.config/PMS/PMS.conf containing:
thumbnails = true thumbnail_seek_pos = 300 mencoder_ass = true folders = /path/to/folder/1, /path/to/folder/2 hide_videosettings = true hide_enginenames = true audiochannels = 2
If you’re not running headless, just start PMS by cd’ing to the directory you created with the tar command above and type:
./PMS.shIf you’re running headless, then there are a number of ways to run ps3 media server, so that it doesn’t stop running when you logout. The way a lot of websites suggest is to use the nohup command, like this:
nohup ./PMS.sh &
nohup prevents the hangup signal (the signal given when you logout of the shell from which you ran the command) from being passed to the ./PMS.sh programme and keeps it running when you log out of your ssh session. However, on my setup, this didn’t work – ie. when I logged out of the ssh session, ssh hung, and when I killed the terminal I was using to run ssh, PMS stopped running. An additional suggestion was to redirect all output, which should help with this behavior. So run:
nohup ./PMS.sh > foo.out 2> foo.err < /dev/null
This didn’t work for me either. So I tried running the command using screen. This should allow me to detach from the screen session, and then logging out of ssh should not affect PMS.sh. However, again this didn’t work. Logging out of ssh hung and killing the terminal killed PMS.sh. So, I tried running it using the at daemon, and hey presto, it worked! So to do this, run this command:
echo ./PMS.sh | at now
Enjoy.






about 3 months ago
You might also try running it using “openvt” which would simply dedicate one of your unused virtual consoles to PMS.sh
This would also give you the benefit of being able to toggle over to it when you need to.