Just a quick gist to keep track of my research on this topic.
I'm using Ubuntu Server 18.04.2 as operating system.
Go to the download page and select your version: https://emby.media/linux-server.html
For my research, I've used two versions:
- AMD64
- ARMHF
The version
ARM64
should work too.
Follow the instruction on the Emby Server download page.
sudo dpkg -i emby-server-deb_4.2.1.0_amd64.deb
Then navigate to http://server-ip:8096 to finish the installation.
Replace
server-ip
by your server IP address if you are working remotely or you can uselocalhost
instead.The
HTTPS
version can be enabled later.
Now we are going to install the necessary packages to enable VA-API
.
sudo apt install vainfo xhost xinit
sudo usermod -a -G video $USER
sudo usermod -a -G video emby
In order to avoid issues because LibVA
is unable to find a physical display, you will have to add some lines into the file /etc/rc.local
.
If the file does not already exists, just create it and make it executable.
sudo nano /etc/rc.local
#!/bin/bash
# Start X server on display :0
/usr/bin/xinit -- :0 > /root/xinit.log 2>&1 &
# Wait 4 secs while server is starting
sleep 4
# Disable access control on display :0
echo export DISPLAY=:0 >> /root/xhost.log 2>&1
export DISPLAY=:0 >> /root/xhost.log 2>&1
xhost + >> /root/xhost.log 2>&1
Save the file and make it executable if it does not already:
sudo chmod -v u+x /etc/rc.local
The last step is to reboot your device in order to apply the performed changes.
sudo reboot
To test if everything is installed and running correctly, simply run the command vainfo
, you should have a similar output.
error: can't connect to X server!
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 2.1.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
If you got something similar, then Emby Server should detect the new available hardware acceleration.
You can verify if Emby Server detected the change by piping detection result to jq
.
jq
must be installed first, simply runsudo apt install jq
if it does not.
cat /var/lib/emby/logs/hardware_detection-63701177710.txt | jq .DetectionOutputs.Vaapi.Result.Devices[0].DeviceInfo
{
"VendorName": "Intel Corporation",
"DeviceName": "Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller",
"SubsytemVendorName": "Intel Corporation",
"VendorId": 32902,
"DeviceId": 8881,
"SubsytemVendorId": 32902,
"SubsytemDeviceId": 29296,
"DevPath": "/sys/bus/pci/devices/0000:00:02.0",
"DrmCard": "/dev/dri/card0",
"DrmRender": "/dev/dri/renderD128",
"IsEnabled": 1,
"IsBootVga": 1,
"ApiVersionMajor": 1,
"ApiVersionMinor": 4,
"Driver": "Intel i965 driver for Intel(R) CherryView - 2.3.0"
}
Change the detection file according the ones existing in folder
/var/lib/emby/logs
.
These links helped me to make this gist.
- https://github.com/MediaBrowser/Wiki/wiki/Hardware-Acceleration-on-Linux
- https://software.intel.com/en-us/articles/compute-offload-to-intelr-graphics-technology-when-xserver-is-up-and-running-on-a-linux
- https://emby.media/community/index.php?/topic/31174-hardware-encoding-on-ubuntu-server/page-6#entry377150
- https://emby.media/community/index.php?/topic/31174-hardware-encoding-on-ubuntu-server/page-3#entry361534
Feel free to comment if you have any issues or suggestions about this gist 😉
You can reach me on Twitter using @Jiab77