Difference between revisions of "PS3 Mediaserver"

From ArchWiki
Jump to: navigation, search
m (fixed category - it's not client app)
(update Pkg/AUR templates (https://github.com/lahwaacz/wiki-scripts/blob/master/update-package-templates.py))
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Web Server]]
+
[[Category:Web server]]
 
[[ja:PS3 Mediaserver]]
 
[[ja:PS3 Mediaserver]]
 +
{{Out of date|Mentions rc.d scripts.}}
 
Server implemented in java. Has very good default transcoding profiles for several clients, but lacks good information for headless servers.
 
Server implemented in java. Has very good default transcoding profiles for several clients, but lacks good information for headless servers.
  
 
== Installation ==
 
== Installation ==
 +
 +
{{Note|Because of the dependency {{AUR|tsmuxer}} having extra 32-bit dependencies, you will need to enable the [[multilib]] repository if you have a 64-bit system.}}
 +
 
Install {{AUR|pms}} from [[AUR]].
 
Install {{AUR|pms}} from [[AUR]].
  
Line 13: Line 17:
 
minimized = true}}
 
minimized = true}}
  
If you don't want your entire filesystem to be shown
+
If you do not want your entire filesystem to be shown
 
{{hc|Media Locations|
 
{{hc|Media Locations|
 
folders = /directory.you.want.shared/,/another.directory
 
folders = /directory.you.want.shared/,/another.directory
Line 29: Line 33:
  
 
A list with all options can be found [http://ps3mediaserver.org/forum/viewtopic.php?f=3&t=254&hilit=pms.conf#p15283 here].
 
A list with all options can be found [http://ps3mediaserver.org/forum/viewtopic.php?f=3&t=254&hilit=pms.conf#p15283 here].
 
Edit the system-wide configuration file:
 
{{hc|/etc/conf.d/pms|2=
 
PMS_USER='<user name to run it as>'
 
}}
 
Make sure that you place your configuration file in /home/<user name to run it as>/.config/PMS/PMS.conf
 
 
{{hc|May not be necessary on all systems|
 
# mkdir /opt/pms/database
 
# chown <username> /opt/pms/database
 
}}
 
  
 
== Run as a daemon ==
 
== Run as a daemon ==
Line 104: Line 97:
 
=== systemd ===
 
=== systemd ===
  
The package ships a systemd unit file by default now (since 1.71.0-2). After installation just run:
+
The package ships a systemd unit file by default now (since 1.71.0-2). However, upon bootup the service [http://www.ps3mediaserver.org/forum/viewtopic.php?f=3&t=17992 will not execute properly]. This can be resolved by adding a timeout before the service starts the involved script. One only has to edit the file as follows by adding the "ExecStartPre" line.
 +
 
 +
{{hc|/usr/lib/systemd/system/pms@.service|output=
 +
[Unit]
 +
Description=PS3 Media Server
 +
After=syslog.target network.target rpcbind.service
 +
 
 +
[Service]
 +
User=%i
 +
Group=users
 +
WorkingDirectory=/opt/pms/
 +
Type=simple
 +
ExecStartPre=/usr/bin/sleep 16
 +
ExecStart=/opt/pms/PMS.sh
 +
 
 +
[Install]
 +
WantedBy=multi-user.target
 +
}}
 +
 
 +
After the addition just run:
  
 
  # systemctl daemon-reload
 
  # systemctl daemon-reload
Line 112: Line 124:
  
 
== Indexing ==
 
== Indexing ==
 
+
This should be done automagically upon starting the service, but if it does not, this is how to do it manually:
 +
* Browse the logs to see at what ip-address and port pms has started the built-in webservice
 
* Use your web browser to go to: <nowiki>http://<ip-address-of-your-server>:5001/console/home</nowiki> and click on 'index files and folders'
 
* Use your web browser to go to: <nowiki>http://<ip-address-of-your-server>:5001/console/home</nowiki> and click on 'index files and folders'
 
* After the indexing has ended, you are done.
 
* After the indexing has ended, you are done.

Latest revision as of 09:09, 30 January 2016

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: Mentions rc.d scripts. (Discuss in Talk:PS3 Mediaserver#)

Server implemented in java. Has very good default transcoding profiles for several clients, but lacks good information for headless servers.

Installation

Note: Because of the dependency tsmuxerAUR having extra 32-bit dependencies, you will need to enable the multilib repository if you have a 64-bit system.

Install pmsAUR from AUR.

Configuration

The default install location is /opt/pms and the config file is at /opt/pms/PMS.conf, there are comments describing what each option is for.

If running headless on a server

Operating Mode
minimized = true

If you do not want your entire filesystem to be shown

Media Locations
folders = /directory.you.want.shared/,/another.directory

If you run into issues with the wrong audio track playing (example: English desired)

Audio language priority
mencoder_audiolangs = eng,und

Example of english subtitles desired, no subtitles by default on English programs

Subtitle language priority
mencoder_sublangs = loc,eng,und

A list with all options can be found here.

Run as a daemon

SysVinit

Use the following modified daemon script (originally from pms-svn).

/etc/rc.d/pms
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/pms

PID=`cat /var/run/pms.pid 2> /dev/null`
[ -z "$PID" ] && PID=`ps -Ao pid,command | grep java | grep pms.jar | awk '{print $1}'`

case "$1" in
	start)
		stat_busy "Starting PS3 Media Server"
		if [ -z "$PID" ]; then
			if [ -n "$PMS_USER" ]; then
				su -s '/bin/sh' $PMS_USER -c "/usr/bin/ps3mediaserver &>> /var/log/pms.log" &
			else
				/usr/bin/ps3mediaserver &>> /var/log/pms.log &
			fi
			PID=$!
			if [ $? -gt 0 ]; then
				stat_fail
			else
				echo $PID > /var/run/pms.pid
				add_daemon pms
				stat_done
			fi
		fi
		;;
	stop)
		stat_busy "Stopping PS3 Media Server"
		[ ! -z "$PID" ]  && kill $PID &> /dev/null
		while ps -p $PID &> /dev/null; do sleep 1; done
		if [ $? -gt 0 ]; then
			stat_fail
		else
			rm /var/run/pms.pid 2> /dev/null
			rm_daemon pms
			stat_done
		fi
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	*)
		echo "usage: $0 {start|stop|restart}"
		;;
esac
exit 0
# /etc/rc.d/pms start
  • (optionally) watch the output with 'tail -f /var/log/pms.log' or 'tail -f /opt/pms/debug.log' for any problems.

systemd

The package ships a systemd unit file by default now (since 1.71.0-2). However, upon bootup the service will not execute properly. This can be resolved by adding a timeout before the service starts the involved script. One only has to edit the file as follows by adding the "ExecStartPre" line.

/usr/lib/systemd/system/pms@.service
[Unit]
Description=PS3 Media Server
After=syslog.target network.target rpcbind.service

[Service]
User=%i
Group=users
WorkingDirectory=/opt/pms/
Type=simple
ExecStartPre=/usr/bin/sleep 16
ExecStart=/opt/pms/PMS.sh

[Install]
WantedBy=multi-user.target

After the addition just run:

# systemctl daemon-reload
# systemctl start pms@<username> # to start once
# systemctl enable pms@<username> # automatically start at boot
# journalctl -u pms@<username> # to debug the logfiles

Indexing

This should be done automagically upon starting the service, but if it does not, this is how to do it manually:

  • Browse the logs to see at what ip-address and port pms has started the built-in webservice
  • Use your web browser to go to: http://<ip-address-of-your-server>:5001/console/home and click on 'index files and folders'
  • After the indexing has ended, you are done.