Jump to content

Quicksync works once per boot, then stops working and uses software


embylad892746

Recommended Posts

embylad892746

System: Intel i5-11320H, Debian 11.2 Bullseye (5.10.0-10-amd64), running Docker.

If i restart computer, load a video and transcode it will always work the first time. If i start any subsequent transcodes they all default to software. If i restart the container then go to transcoding settings, all the Quicksync/VAAPI options mysteriously disappear! I've tried completely headless (booting to Cli), and headless booting to GUI (with DP dummy plug) and the result is always the same. I think it has nothing to do with dummy plug or not because i recently moved from an older computer (completely headless) and had no problem using quicksync.

From what i can see in logs, it realizes it can HW transcode using quicksync then for no reason at all, says it's falling back to software.

I'm using linuxserver/emby docker image (always worked previously on old system without problems). I've also tried official emby docker image after correctly giving it the GUIDs from getent commands, but still not working.

getent group render | cut -d: -f3

and

getent group render | cut -d: -f3

 

Any advice?

lsmod | grep i915

i915                 2711552  1
i2c_algo_bit           16384  1 i915
drm_kms_helper        278528  1 i915
cec                    61440  2 drm_kms_helper,i915
drm                   618496  3 drm_kms_helper,i915
video                  53248  1 i915

 

ffmpeg-transcode-988890ac-761d-48c8-98e5-9972109725b3_1.txt

Edited by embylad892746
Link to comment
Share on other sites

embylad892746

other info that might be helpful.

$ vainfo
error: can't connect to X server!
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
Segmentation fault

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation TigerLake GT2 [Iris Xe Graphics] (rev 03)

 

Link to comment
Share on other sites

embylad892746

lastly, on a clean boot, quicksync will work exactly one time before stop working. Likewise, after a reboot of pc vainfo is different:

vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSliceLP
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSliceLP
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile1            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileVP9Profile3            :	VAEntrypointVLD
      VAProfileHEVCMain12             :	VAEntrypointVLD
      VAProfileHEVCMain422_10         :	VAEntrypointVLD
      VAProfileHEVCMain422_12         :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         :	VAEntrypointVLD
      VAProfileHEVCMain444_10         :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          :	VAEntrypointVLD
      VAProfileHEVCSccMain10          :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         :	VAEntrypointVLD
      VAProfileHEVCSccMain444         :	VAEntrypointEncSliceLP
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointEncSliceLP

 

Link to comment
Share on other sites

Hi there, please attach the emby server and hardware detection log files as well. Thanks.

  • Thanks 1
Link to comment
Share on other sites

embylad892746

@Luke i also tried upgrading Linux Kernal to 5.16 and the problem is the exact same. On a complete PC restart, the FIRST time emby docker starts up, the FIRST transcode will always work (sometimes 2 at same time). I can see the Quicksync is working. Then if i close either of those videos and start anything else it's over. No more transcoding period for anything until the PC gets completely rebooted again... it's almost as if Quicksync is working fine initially then crashes and is never able to recover until a reboot.

So in summary, Kernal update not fixing it, problem same between Emby linuxserver image and official emby image.

Link to comment
Share on other sites

embylad892746
59 minutes ago, softworkz said:

@embylad892746 - Could you please install Emby Server directly on the machine (without Docker)?

Thanks,
sw

 

@softworkzSure I can do that, but how do I migrate config files from Docker image to host based deployment? 
Losing all my user info, playlists etc is not an option.

Edited by embylad892746
Link to comment
Share on other sites

embylad892746
13 minutes ago, Q-Droid said:

Do you use a compose file for the container and can you post it?

---
version: "2.1"
services:
  emby:
    image: linuxserver/emby:latest
    container_name: emby
    network_mode: lsio
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Zurich
    volumes:
      - ./emby_config/config:/config
      - /mnt:/media
      - ./emby_config/transcoding:/transcode #optional
      - /opt/vc/lib:/opt/vc/lib #optional
    ports:
      - 8096:8096
      - 8920:8920 #optional
    devices:
      - /dev/dri:/dev/dri #optional
    restart: unless-stopped

Link to comment
Share on other sites

2 hours ago, embylad892746 said:

@softworkzSure I can do that, but how do I migrate config files from Docker image to host based deployment? 
Losing all my user info, playlists etc is not an option.

It's just meant for temporary testing and should be totally separate from your Docker installation - just a blank Emby Server installation to which you add a library folder with some files for testing - that's it.

  • Like 1
Link to comment
Share on other sites

Q-Droid

These questions are for your Debian host, not the container.

What user and group correspond to UID and GID 1000?

What is the ownership of /dev/dri? (ls -l /dev/dri)

What are the GIDs for the video group and the render group if also shown in the output?

One more - what are the supplementary groups for UID 1000? (id 1000)

 

 

Edited by Q-Droid
  • Thanks 1
Link to comment
Share on other sites

embylad892746
1 hour ago, softworkz said:

@embylad892746 Maybe @Q-Droid can help you better at this stage. I'm not familiar with Docker, so before going for the wide-scope bisection, this might be a better way for starting.

 

i tried direct emby server installation on host as you recommended for testing...to my horror, no encoders/decoders showing in transcoding menu there either...so it's likely not a docker problem but something else...

Link to comment
Share on other sites

embylad892746
1 hour ago, Q-Droid said:

These questions are for your Debian host, not the container.

What user and group correspond to UID and GID 1000?

What is the ownership of /dev/dri? (ls -l /dev/dri)

What are the GIDs for the video group and the render group if also shown in the output?

One more - what are the supplementary groups for UID 1000? (id 1000)

 

 

What user and group correspond to UID and GID 1000?

$id
uid=1000(debian) gid=1000(debian) groups=1000(debian),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev),115(bluetooth),122(lpadmin),125(scanner),998(docker)

What is the ownership of /dev/dri? (ls -l /dev/dri)

$ls -l /dev/dri
drwxr-xr-x  2 root root         80 Mar 23 07:36 by-path
crwxr-xr-x+ 1 root video  226,   0 Apr  1 09:41 card0
crwxr-xr-x+ 1 root render 226, 128 Mar 23 07:36 renderD128

What are the GIDs for the video group and the render group if also shown in the output?

$getent group video
video:x:44:debian,emby

$getent group render
render:x:107:emby

One more - what are the supplementary groups for UID 1000? (id 1000)

$id 1000
uid=1000(debian) gid=1000(debian) groups=1000(debian),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev),115(bluetooth),122(lpadmin),125(scanner),998(docker)

thanks for your help, really appreciate it.

Edited by embylad892746
formatting
Link to comment
Share on other sites

Q-Droid

One more thing, just to see what it has:

getfacl /dev/dri/card0

getfacl /dev/dri/renderD128

But I think the change which could make a difference is to add supplementary group render to user debian (1000).

And by the way, I think the entry in your compose for /opt/vc/lib is specific to R-Pi and not needed. Maybe should remove that line.

      - /opt/vc/lib:/opt/vc/lib #optional


 

Edited by Q-Droid
Link to comment
Share on other sites

1 hour ago, embylad892746 said:

i tried direct emby server installation on host as you recommended for testing...to my horror, no encoders/decoders showing in transcoding menu there either...so it's likely not a docker problem but something else...

That's very helpful. Can you please attach the emby server and hardware detection log files from that? Thanks.

Link to comment
Share on other sites

embylad892746
On 4/3/2022 at 8:20 PM, Q-Droid said:

One more thing, just to see what it has:

getfacl /dev/dri/card0

getfacl /dev/dri/renderD128

But I think the change which could make a difference is to add supplementary group render to user debian (1000).

And by the way, I think the entry in your compose for /opt/vc/lib is specific to R-Pi and not needed. Maybe should remove that line.

      - /opt/vc/lib:/opt/vc/lib #optional


 

 

$getfacl /dev/dri/card0 
getfacl: Removing leading '/' from absolute path names
# file: dev/dri/card0
# owner: root
# group: video
user::rw-
group::rw-
other::---

 

$getfacl /dev/dri/renderD128 
getfacl: Removing leading '/' from absolute path names
# file: dev/dri/renderD128
# owner: root
# group: render
user::rw-
group::rw-
other::---

 

Link to comment
Share on other sites

13 minutes ago, embylad892746 said:

 

$getfacl /dev/dri/card0 
getfacl: Removing leading '/' from absolute path names
# file: dev/dri/card0
# owner: root
# group: video
user::rw-
group::rw-
other::---

 

$getfacl /dev/dri/renderD128 
getfacl: Removing leading '/' from absolute path names
# file: dev/dri/renderD128
# owner: root
# group: render
user::rw-
group::rw-
other::---

 

@embylad892746

Can you please attach the emby server and hardware detection log files from that? Thanks.

Link to comment
Share on other sites

embylad892746
10 minutes ago, Luke said:

@embylad892746

Can you please attach the emby server and hardware detection log files from that? Thanks.

Luke, these are the local install AFTER a reboot. Remember, everything works fine the first time after a reboot... so these should show no signs of error.

embyserver.txt hardware_detection-63784698670.txt

Edited by embylad892746
Link to comment
Share on other sites

embylad892746

@Luke i just transcoded  a video on my local install, was working fine, stopped it and tried transcoding a different video and then it "broke" like usual. So here are the log files on the local system AFTER quicksync has stopped working.

 

So to summarize the problem so far: On Docker AND direct host install the problem is the exact same. On a complete system reboot, Encoders/Decoders in settings show the first time and transcoding works the very first time i start up emby. After the first transcode, it's almost as if quicksync "crashes" because after that i'm hosed. All the encoders/decoders will magically be gone from settings menu and transcoding never works again until the next system reboot....

This literally makes no sense.

The problem is the same on different kernel versions, and i tried Ubuntu as well as Debian. Exact same problem.

 

embyserver_after_breaking.txt hardware_detection-63784699598_after_breaking.txt

Link to comment
Share on other sites

embylad892746

Just connected a screen to my headless server and i see these error messages....

 

 

 

 

IMG_5399.jpg

Edited by embylad892746
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...