Building OpenPHT for Ubuntu

**Update: please read message 1 until 3 to get a complete overview of the build.

Tried to build OpenPHT for Ubuntu, no luck yet. Some of the header files are not correct, they need a path to other headers (plex/PlexTypes.h for instance). But even after fixing that the build will fail. Posting this for future reference, since this seems the way to build it as soon as the sources are “compilable”.

I am actively using kodi from the team-xbmc ppa, I recommend you use the same ppa so you can install the latest build dependencies for kodi (no need to install kodi itself here). First step is to make sure you can build at all:

sudo apt-get install build-essential
sudo apt-get install git-core

Now we are going to add the kodi ppa. You can leave this step, if you want to and use the standard kodi provided with Ubuntu. However, your results might be slightly different than mine.

sudo add-apt-repository ppa:team-xbmc/ppa

Install the kodi developement dependencies (on my system this took around 500Mb):

sudo apt-get update
sudo apt-get build-dep kodi

I also had to install the following (the configure step below failed without the package being available):

sudo apt-get install libsdl-image1.2-dev libflac++-dev libshairport-dev

Find yourself a location to save the sources (in this example it will be ¯/OpenPHT) and get them:

cd ~
git clone https://github.com/RasPlex/OpenPHT.git openpht-src
mkdir ~/openpht-build
cd ~/openpht-build

To build the sources, execute the following three commands:
cmake -DCMAKE_BUILD_TYPE=Debug -DCOMPRESS_TEXTURES=on -DENABLE_AUTOUPDATE=off -DCMAKE_INSTALL_PREFIX=/opt/openpht "~/openpht-src"
make
sudo make install

@SingleServingSociety said:
THIS IS NOT WORKING YET

Tried to build OpenPHT for Ubuntu, no luck yet. Some of the header files are not correct, they need a path to other headers (plex/PlexTypes.h for instance). But even after fixing that the build will fail. Posting this for future reference, since this seems the way to build it as soon as the sources are “compilable”.

I am actively using kodi from the team-xbmc ppa, I recommend you use the same ppa so you can install the latest build dependencies for kodi (no need to install kodi itself here). First step is to make sure you can build at all:

sudo apt-get install build-essential
sudo apt-get install git-core

Now we are going to add the kodi ppa. You can leave this step, if you want to and use the standard kodi provided with Ubuntu. However, your results might be slightly different than mine.

sudo add-apt-repository ppa:team-xbmc/ppa

Install the kodi developement dependencies (on my system this took around 500Mb):

sudo apt-get update
sudo apt-get build-dep kodi

I also had to install the following (the configure step below failed without the package being available):

sudo apt-get install libsdl-image1.2-dev

Find yourself a location to save the sources (in this example it will be ¯/OpenPHT) and get them:

cd
git clone https://github.com/RasPlex/OpenPHT.git

To build the sources, execute the following four commands:
cd ¯/OpenPHT
./bootstrap
./configure --prefix=/usr/local
make
sudo make install

Instead of .bootstrap & .configure, try using cmake… the pht devs of old used cmake i believe… (Before it went to openPHT)

whole process should be like…
cd ~
git clone https://github.com/RasPlex/OpenPHT.git openpht-src
mkdir ~/openpht-build
cd ~/openpht-build
cmake -DCMAKE_BUILD_TYPE=Debug -DCOMPRESS_TEXTURES=on -DENABLE_AUTOUPDATE=off -DCMAKE_INSTALL_PREFIX=/opt/openpht "~/openpht-src/OpenPHT"
sudo make install

As long as your dependencies are right, should build just fine… (I built this morning no problems on Vivid)

Followed this guide and it almost worked perfectly for me.

Had to do the following changes on Ubuntu 14.04:

Now we are going to add the kodi ppa. You can leave this step, if you want to and use the standard kodi provided with Ubuntu. However, your results might be slightly different than mine.
sudo add-apt-repository ppa:team-xbmc/ppa

I needed to replace that with

sudo add-apt-repository ppa:team-xbmc/xbmc-ppa-build-depends
sudo apt-get update

And this line:

cmake -DCMAKE_BUILD_TYPE=Debug -DCOMPRESS_TEXTURES=on -DENABLE_AUTOUPDATE=off -DCMAKE_INSTALL_PREFIX=/opt/openpht “~/openpht-src/OpenPHT”

with this:

cmake -DCMAKE_BUILD_TYPE=Debug -DCOMPRESS_TEXTURES=on -DENABLE_AUTOUPDATE=off -DCMAKE_INSTALL_PREFIX=/opt/openpht “~/openpht-src”

Perfect build!

I’ve had absolutely no luck with this. First issue may that the ‘build-dep kodi’ does not seem to exist anymore? At least when I run that command line, the response is the source package cannot be located.

After that I seem to have dependency issues out the whazoo when I try to cmake. After manually installing maybe 20 dependencies, I gave up.

Am I missing something?

I have the old version of PHT running on Ubuntu and just want to get OpenPHT working on the system so I no longer have to worry about the remote player listing timing out.

Any help would be awesome. Thank you!

Did you read the post above yours? TonioRoffo said:

I needed to replace that with

sudo add-apt-repository ppa:team-xbmc/xbmc-ppa-build-depends
sudo apt-get update

Might work for you as well.

yes, I had the same problem with dependencies, until I ran with the ppa repository I’ve added in my former post. After that, it built without a hitch.

The issue is not building it but the > 600 Mb dependencies crap it needs, so I will just wait until someone creates a binary package for Ubuntu. These already exist for Arch Linux and Debian. I can’t believe that there are no packages yet for Ubuntu.

Hi,

I have successfully compile OpenPHT 1.5.2 on Ubuntu 14.04 (and made the port to QNAP NAS but it’s not the problem)
… all seems to work as expected EXCEPT one things
I can ONLY use “Pulseaudio” … none of the “direct” ALSA HDMI audio output is listed …
If I try (as before plexhometheater 1.4.2) to add
export AE_ENGINE=SOFT (or just to see AE_SINK=ALSA)
OpenPHT display INFO (not error) but in fact stay in background BUT display NOTHING on the screen


09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:768:(parse_card) cannot find card ‘$CARD’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:392:(snd_func_concat) error evaluating strings
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such device
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1251:(snd_func_refer) error evaluating name
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such device
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such device
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.front.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.surround40.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.surround51.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.surround51.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.surround51.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.surround71.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.iec958.3:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.modem.3:CARD=0’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH,DEV=0
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH,DEV=0
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4578:(parse_args) Unknown parameter DEV
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4711:(snd_config_expand) Parse arguments error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.front.1:CARD=PCH’
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH,DEV=0
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH,DEV=0
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH,DEV=0
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: confmisc.c:1286:(snd_func_refer) Unable to find definition ‘cards.HDA-Intel.pcm.surround40.1:CARD=PCH’


09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH,DEV=0
09:59:30 T:140613357459328 INFO: CAESinkALSA - ALSA: conf.c:4694:(snd_config_expand) Unknown parameters CARD=PCH


NOTHING more in the plexhometheater.log ???
And I don’t identified the file or directory missing ???
Do you have the same problem ?
do you know where I have to search ??
or is it a know problem ??? (don’t see it in issue list (even it’s for rasplex ? ) )

Last : suppressing the export AE_ENGINE is enough to restart and work as well.

Philippe.

When you list your ALSA devices with aplay -l, do you see the devicec it is complaining about?
"cards.HDA-Intel.pcm.surround40.1:CARD=PCH’…

I use the following file to start the PHT 1.4.2 because I don’t want to remove Pulseaudio completely from my Intel NUC Ubuntu 14.04 desktop machine, but it interferes with PHT:

sleep 30
export XBMC_HOME=/opt/plexhometheater/share/XBMC
pactl suspend-sink 1 1
export AE_ENGINE=SOFT
/opt/plexhometheater/bin/plexhometheater
pactl suspend-sink 1 0

Here is the aplay -l output on the NUC (I selected card 1 in the PHT Audio settings, which is an external USB Sound Card with optical out going directly into my receiver’s optical in. I don’t use the HDMI out of the NUC as my Samsung Plasma TV does not support Pass-through over HDMI):
**** List of PLAYBACK Hardware Devices ****
xcb_connection_has_error() returned true
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

The last piece of the puzzle is my plex user specific alsa config (even that is says 2 channel, it is 5+1 because of the spdif output):
plex@htpc:/usr/bin$ cat /home/plex/.asoundrc
pcm.!spdif {
type plug
slave {
pcm “iec958:CARD=Device,DEV=0”
rate 48000
format S16_LE
channels 2
}
}

From ~/.plexht/userdata/guisettings.xml you can see the Audio device I have selected in PHT:

true
ALSA:spdif
1
0
false
true
2
2
false
true
false
ALSA:spdif
false
false

Just keep in mind that this configuration works great for an external USB SPDIF sound card, so make your adjustments accordingly.

In my experience if you don’t want to use pulseaudio you can just “apt-get remove” it. Fixed a lot of similar issues I have seen in the past.

Hi,

Thanks,
BUT I can’t disable pulseaudio (some other tools need it (Skype for ex.)
And
I have a PlexH.T. 1.4.2 that run on same system well (with AE_ENGINE=SOFT) … and problem is only when I try 1.5.2 …

BUT thanks for your advice.

Philippe.

I’ve finally had some time to build OpenPHT on Intel NUC with Ubuntu 14.04.4 LTS. There was an issue with installing the dependences, which I fixed with first manually installing the SDL 2 library VIRTUAL packages from Trusty Updates. Otherwise build-dep kodi was failing with unresolved dependences or wanted to downgrade xorg.

Everything is working fine, including DTS and AC3 via the external USB sound card (spdif) except that when playing a movie, random video blurring occurs. I have posted already in the issue log (issue #34), but decided to post here as well in case someone else experienced this issue.

Even before upgrading Ubuntu 14.04 to the LTS release the issue existed. No blurring with PHT 1.4.2 on the same machine. I am using custom xorg.conf with TearFree “true” and “sna” Acceleration, but have not seen the tearing issue so far.

The only way to stop the blurring issue is to disable VAAPI, which is not acceptable. Same blurring occurs on the same movie with VLC 2.1.6 and VAAPI enabled. No blurring on the same movie with PHT and VAAPI enabled.

Any ideas? It seems like a bug to me.

Examples

VAAPI disabled:

VAAPI enabled:

Maybe you are crushing blacks (RGB limited vs full?)

No, when I enable vaapi acceleration the video gradually blurs over a period of a few seconds. It then clears up, and again starts to get blurrier and blurrier over a few seconds, and repeats this. When I disable the vaapi everything is running fine.

This didn’t work for me either. I got a ton of build errors. Are they going to add native Ubuntu compatibility at any point?

@vdimitrov said:
The issue is not building it but the > 600 Mb dependencies crap it needs, so I will just wait until someone creates a binary package for Ubuntu. These already exist for Arch Linux and Debian. I can’t believe that there are no packages yet for Ubuntu.

Build it on a (virtual) development machine then?

Has anyone tried to do this on a SoC board (other than the Rasp Pi) running a distro of Linux?
I tried but was getting errors. Still have a few more things to try but was just curious if anyone else has had any success?