Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: eumagga0x2a on November 20, 2016, 11:33:46 AM

Title: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: eumagga0x2a on November 20, 2016, 11:33:46 AM
I've missed an elephant in the room. It turned out that I actually never used VDPAU video output in Avidemux because the condition

        if(strcmp(displ,":0") && strcmp(displ,":0.0"))
        {
                printf("Looks like remote display, no Xv :%s\n",displ);
                return RENDER_GTK;
        }


in the function UI_getPreferredRender in avidemux/common/gui_main.cpp:1564 disables hwaccel on Fedora, where $DISPLAY is :1 for local display by default (probably due to X running as user and the first display occupied by display manager?). The check if $DISPLAY is :0 is a bad idea, unfortunately. What should we do? Dump the check completely or advertise a downstream patch for Fedora to bump the expected value?

Unfortunately. displaying a video via VDPAU doesn't reduce CPU load  :(
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: Jan Gruuthuse on November 20, 2016, 11:51:58 AM
vdpau works here on both screens/monitors (nv-control version 1.29)
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: Jan Gruuthuse on November 20, 2016, 11:54:02 AM
xscreen containing 2 monitors
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: eumagga0x2a on November 20, 2016, 12:02:16 PM
I'm sorry, Jan, but this is not what this topic is about. If you run

echo $DISPLAY

and the returned value is not :0 or :0.0, Avidemux assumes that it is running in a remote session and disables VDPAU display (VDPAU decoding is a different thing and doesn't suffer). If the X server is running as user, the local $DISPLAY is not :0 and VDPAU output gets wrongly disabled.
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: Jan Gruuthuse on November 20, 2016, 12:08:15 PM
thanks for explaining, here it says
echo $DISPLAY
Quote:0
on each monitor
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: eumagga0x2a on November 20, 2016, 12:19:20 PM
This means you are not affected by the issue. Could you please post the output of

ps -el | grep -i xorg

?
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: Jan Gruuthuse on November 20, 2016, 12:22:41 PM
ps -el | grep -i xorg
Quote4 S     0  1323  1283  9  80   0 - 502997 -     tty7     00:13:01 Xorg
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: eumagga0x2a on November 20, 2016, 12:36:37 PM
Thanks, you have just one Xorg process (running as root). On Fedora there are two (on different TTYs, of course): the first one for the display manager (gdm) and the second for the user.

Hoping for a feedback from Mean which course should be taken. For me, it is better if Avidemux comes down in pieces for 0.01% of users who launch it in a remote session than it withholds hwaccel from 99.99% of the total number of Linux users  ;)
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: mean on November 20, 2016, 01:40:06 PM
The check can indeed be removed
It should boost the speed of VDPAU for you :)
Title: Re: Remote display detection breaks VDPAU video display on Fedora (at least)
Post by: eumagga0x2a on November 20, 2016, 02:35:59 PM
I've submitted a pull request. Yes, the performance boost /CPU usage drop is impressive on condition of not using the default "gtk" Qt theme  :)

With the "gtk" Qt style I get ~30% CPU, with "fusion" mostly below 12%.