Plex Home Theater for Arch Linux

pht-for-linux

#1

There you go, PKGBUILDs for PHT are now in good shape and unofficial builds are rolling out!

 

Packages

 

plex-home-theater is available in the official [community] repository. There is also a git package in the AUR, nightly builds for this one are available in the unofficial repository below.

Unofficial repository


 


Add the following lines above official repos in '/etc/pacman.conf'.



[alucryd]
SigLevel = Optional
Server = http://pkgbuild.com/~alucryd/$repo/$arch

Edit: Nuked the git package, github is only updated all at once when there's a release, making it useless.


#2

You are just a hero, congrats and keep doing this good work!


#3

FYI: I linked to this post from this thread in the official Plex Home theater forum: https://forums.plexapp.com/index.php/topic/87253-linux-builds/?p=505687


- Mark


#4

Arch Linux is the best! Thanks for this!


#5

I was able to get my HTPC running plexhometheater standalone after installing just a base arch install + video drivers + xorg server + plex-home-theater-git.

Edit /etc/X11/xinit/xinitrc to comment out default commands and add my own:

vi /etc/X11/xinit/xinitrc
#twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login
export XBMC_HOME=/usr/share/plexhometheater
exec plexhometheater --standalone



Then create a new systemd service to startx at boot: 



vi /usr/lib/systemd/system/plexhometheater.service




[Unit]
Description=Start X and plexhometheater --standalone

[Install]
WantedBy=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/bin/startx



systemctl enable plexhometheater.service

May not be the best way to go about this, but it is working.



 


#6

I'm doing that with slightly different .xinitrc and service files on my desktop, so that plex runs on tty2 on the TV screen, and I still can use my desktop for everything else :)


#7

I'm doing that with slightly different .xinitrc and service files on my desktop, so that plex runs on tty2 on the TV screen, and I still can use my desktop for everything else :)



Please share if you don't mind


#8

Here is the service file, you need to have a functional "systemctl --user" for this to work (see arch systemd wiki for this, you need to modify systemd-user.pam iirc). The service file then needs to be placed in "~/.config/systemd/user/plex@service", you can start plex by issuing "systemctl --user start plex@tty2" for example. Keep in mind that it is not meant for autostarting plex, rather it is a more convenient way of switching to tty2, logging as my user and launching startx or xinit on it.

[Unit]
Description=Launch Plex Home Theater on %I

[Service]
ExecStart=/usr/bin/xinit plex
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

As for .xinitrc, here is the plex part:

#!/bin/sh

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

if [[ $1 == plex ]]; then
  /usr/bin/xrandr --output DVI-I-1 --off --output HDMI-0 --auto
  export XBMC_HOME=/usr/share/plexhometheater
  exec /usr/bin/plexhometheater
fi

#9

Would love to see PHT in the official Arch repos.


#10

I got a differant .service file working. Also allows for running plex as plex instead of root.

[Unit]
Description=Start X and plexhometheater --standalone

[Install]
WantedBy=multi-user.target

[Service]
User=plex
Group=plex
Type=simple
Environment="XBMC_HOME=/usr/share/plexhometheater"
Restart=on-abort
ExecStart=/usr/bin/xinit /usr/bin/plexhometheater --standalone -- :0 -nolisten tcp

This of course requires the plex user to be added and given the correct groups:

groupadd plex
useradd -d /usr/share/plexhometheater -g plex -s /bin/nologin plex
usermod -a -G plex,audio,video,power,network,optical,storage,disk,uucp,lock plex

If you have already have pht set up, you will also need to move the .plexht folder from the home directory into the plex user home directory "/usr/share/plexhometheater"


#11

I got a differant .service file working. Also allows for running plex as plex instead of root.

[Unit]
Description=Start X and plexhometheater --standalone

[Install]
WantedBy=multi-user.target

[Service]
User=plex
Group=plex
Type=simple
Environment="XBMC_HOME=/usr/share/plexhometheater"
Restart=on-abort
ExecStart=/usr/bin/xinit /usr/bin/plexhometheater --standalone -- :0 -nolisten tcp

This of course requires the plex user to be added and given the correct groups:

groupadd plex
useradd -d /usr/share/plexhometheater -g plex -s /bin/nologin plex
usermod -a -G plex,audio,video,power,network,optical,storage,disk,uucp,lock plex

If you have already have pht set up, you will also need to move the .plexht folder from the home directory into the plex user home directory "/usr/share/plexhometheater"

Although... This doesnt allow for shuting the box off with the "Shut Down" option in the interface (or suspending for that matter). I am not sure how to acheive that.... Anyone with more experience with systemd have any ideas?


#12

Thanks alucryd!


#13

Although... This doesnt allow for shuting the box off with the "Shut Down" option in the interface (or suspending for that matter). I am not sure how to acheive that.... Anyone with more experience with systemd have any ideas?

I don't believe pht uses systemd to handle this. I'll have a look at this later if it's within my abilities.

Thanks alucryd!

My pleasure!


#14

Any chance that we could get an ARM build of this? I'd love to run it on my Odroid-u2 running Arch Linux ARM.


#15

Any chance that we could get an ARM build of this? I'd love to run it on my Odroid-u2 running Arch Linux ARM.

Nope, you'll have to build it yourself. I have no ARM build machine.


#16

Ah ok, I'll have to wait until my motherboard comes in because I'll be damned if I'm compiling this on my Chromebook or my Odroid lol


#17

Although... This doesnt allow for shuting the box off with the "Shut Down" option in the interface (or suspending for that matter). I am not sure how to acheive that.... Anyone with more experience with systemd have any ideas?

useradd -m -g users -G power, -s /bin/bash plex


#18

On both the stable and the git version I got this a lot (intel i915) and it takes forever to load. Do more people have this?

00:09:29 T:140429429245696 WARNING: FillBuffer: Reconnect, (re)try 1
00:11:06 T:140429420852992  NOTICE: Thread CFileCache start, auto delete: false
00:11:06 T:140429446031104 WARNING: Read - waited for data but got none

#19

On both the stable and the git version I got this a lot (intel i915) and it takes forever to load. Do more people have this?

00:09:29 T:140429429245696 WARNING: FillBuffer: Reconnect, (re)try 1
00:11:06 T:140429420852992  NOTICE: Thread CFileCache start, auto delete: false
00:11:06 T:140429446031104 WARNING: Read - waited for data but got none

Can't reproduce here on my desktop and laptop, nvidia and intel, but the error message doesn't seem graphics related. Don't know what's hitting you unfortunately.

In fact 1.0.12 is smoother than any earlier revision for me, so I pushed it in [community]. Ended up putting everything in /opt, even though I don't like it, we had another package like this added recently and it doesn't seem to be frowned upon that much.


#20

Hmm. Strange. All other clients can play from my PMS, except this one. It will try to buffer, but failes after ~20 seconds and quits to the menu.

Complete log:

16:45:18 T:139768568461056  NOTICE: Creating Demuxer
16:45:18 T:139768517895936  NOTICE: Thread CFileCache start, auto delete: false
16:45:36 T:139770156005120 WARNING: Read - waited for data but got none
16:45:48 T:139768568461056 WARNING: Previous line repeats 2 times.
16:45:48 T:139768568461056   ERROR: Open - Error, could not open file plexserver://332b469067bdc23b27845ff495f321a8407da74e/library/parts/1242/file.m4v
16:45:48 T:139768568461056   ERROR: OpenDemuxStream - Error creating demuxer
16:45:48 T:139768568461056  NOTICE: CDVDPlayer::OnExit()
16:45:48 T:139768568461056  NOTICE: CDVDPlayer::OnExit() deleting input stream
16:46:05 T:139768576853760  NOTICE: Thread Jobworker start, auto delete: true
16:46:09 T:139770331019008 WARNING: Read - waited for data but got none
16:46:15 T:139770339411712 WARNING: FillBuffer: curl [192.168.178.20:32400/library/arts?X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:15 T:139770339411712 WARNING: FillBuffer: Reconnect, (re)try 1
16:46:16 T:139770172790528 WARNING: FillBuffer: curl [192.168.178.20:32400/library/sections/2/recentlyAdded?unwatched=1&X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:16 T:139770172790528 WARNING: FillBuffer: Reconnect, (re)try 1
16:46:16 T:139770164397824 WARNING: FillBuffer: curl [192.168.178.20:32400/library/sections/2/onDeck?X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:16 T:139770164397824 WARNING: FillBuffer: Reconnect, (re)try 1
16:46:16 T:139768797046528 WARNING: FillBuffer: curl [192.168.178.20:32400/library/sections/2/arts?X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:16 T:139768797046528 WARNING: FillBuffer: Reconnect, (re)try 1
16:46:16 T:139768938604288 WARNING: FillBuffer: curl [192.168.178.20:32400/library/sections/1/recentlyAdded?unwatched=1&X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:16 T:139768938604288 WARNING: FillBuffer: Reconnect, (re)try 1
16:46:16 T:139770164397824 WARNING: CPlexDirectory::ReadMediaContainer root name MediaContainer
16:46:16 T:139770147612416 WARNING: Previous line repeats 1 times.
16:46:16 T:139770147612416 WARNING: FillBuffer: curl [192.168.178.20:32400/library/arts?X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:16 T:139770147612416 WARNING: FillBuffer: Reconnect, (re)try 1
16:46:16 T:139768788653824 WARNING: FillBuffer: curl [192.168.178.20:32400/photo/:/transcode?height=320&url=http%3a%2f%2f127.0.0.1%3a32400%2f%3a%2fplugins%2fcom.plexapp.plugins.bringthepopcorn%2fresources%2ficon-default.png%3ft%3d1387342576&width=320&X-Plex-Token=SECRETSTUFF] failed with code 28
16:46:16 T:139768788653824 WARNING: FillBuffer: Reconnect, (re)try 1

Any ideas? Thanks alucryd