Bug 364041 - video does not display when using kaffeine in a vncserver desktop KDE environment, viewed with vncviewer
Summary: video does not display when using kaffeine in a vncserver desktop KDE environ...
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.x
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Mauro Carvalho Chehab
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-06 22:25 UTC by rens
Modified: 2017-10-04 09:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
attachment-21897-0.html (1.37 KB, text/html)
2016-06-08 19:09 UTC, rens
Details
rensQR128x128.jpg (10.47 KB, image/jpeg)
2016-06-08 19:09 UTC, rens
Details
attachment-13354-0.html (3.09 KB, text/html)
2016-06-09 14:22 UTC, rens
Details
rensQR128x128.jpg (10.47 KB, image/jpeg)
2016-06-09 14:22 UTC, rens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rens 2016-06-06 22:25:26 UTC
I have a USB dvb S2 receiver. I use kaffeine to record films from Astra 1, 2 and 3, FTA as well as encoded.
The system is on the attic, I start a desktop with e.g, vncserver :10
I then connect remotely with vncviewer from tigervnc package.
the vncserver runs a kde4 desktop. I start kaffeine, which works fine.
However, Kaffeine does not display any video when started on this virtual desktop. Not from live TV, but also not from mpg or avi from disk.
If using x11vnc, serving the actual hardware desktop, everything works fine.


Reproducible: Always

Steps to Reproduce:
1. start vncserver
2. connect with vncviewer from remote system
3. start kaffeine from konsole window and try to watch a video
4. kaffeine is not displaying any video. it suggests it does (play button pressed, stop button active) but the indicator does not progress, and nothing happens.  

text output from kaffeine in konsole window :  X windows bad parameter 3 

Actual Results:  
no video displaying

Expected Results:  
should have seen a video playing

Qt :4.8.6
KDE dev platform : 4.14.10
Kaffeine 1.2.2
linux opensuse LEAP 42.1
Comment 1 Mauro Carvalho Chehab 2016-06-08 17:02:50 UTC
Git commit 89486d8d7c2bbdf1a55ca72d882efae0e5ebf897 by Mauro Carvalho Chehab. Committed on 08/06/2016 at 16:57. 
Pushed by mauroc into branch 'master'. 

configuration: add support to setup the arguments for libVLC 

Sometimes, passing different command line options to libVLC may help to solve some troubles on some special setups. So, add an option to allow changing the libVLC parameters.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

M +32 -2 src/backend-vlc/vlcmediawidget.cpp 
M +10 -0 src/configuration.cpp 
M +9 -0 src/configuration.h 
M +22 -0 src/configurationdialog.cpp 
M +2 -0 src/configurationdialog.h 

http://commits.kde.org/kaffeine/89486d8d7c2bbdf1a55ca72d882efae0e5ebf897
Comment 2 Mauro Carvalho Chehab 2016-06-08 17:05:41 UTC
By default, libVLC (present on Kaffeine versions 1.3.x and 2.0.x) will try to use the DRI acceleration at the local machine. This doesn't work when the display windows is on another machine. There are a number of libVLC options that could help to disable such behavior, like --no-xlib and --vout.

I just added a patch adding support for it. Maybe with that you could find a setup that would work with vncviewer.
Comment 3 rens 2016-06-08 19:09:14 UTC
Created attachment 99413 [details]
attachment-21897-0.html

Hello,

disabling hardware accel : this would be an option of kaffeine, I guess ?

best regards,

rens

On 06/08/16 19:05, Mauro Carvalho Chehab via KDE Bugzilla wrote:
> https://bugs.kde.org/show_bug.cgi?id=364041
>
> --- Comment #2 from Mauro Carvalho Chehab <mchehab@osg.samsung.com> ---
> By default, libVLC (present on Kaffeine versions 1.3.x and 2.0.x) will try to
> use the DRI acceleration at the local machine. This doesn't work when the
> display windows is on another machine. There are a number of libVLC options
> that could help to disable such behavior, like --no-xlib and --vout.
>
> I just added a patch adding support for it. Maybe with that you could find a
> setup that would work with vncviewer.
>
Comment 4 rens 2016-06-08 19:09:15 UTC
Created attachment 99414 [details]
rensQR128x128.jpg
Comment 5 Mauro Carvalho Chehab 2016-06-08 19:40:20 UTC
(In reply to rens from comment #3)
> Created attachment 99413 [details]
> attachment-21897-0.html
> 
> Hello,
> 
> disabling hardware accel : this would be an option of kaffeine, I guess ?

Qt5 does hardware accel, via DRI and OpenGL, but video playback is actually done via libVLC, since version 1.3.x, with has its own video accel logic, and some options that affects it. Unfortunately, the libVLC options depends on its version, and the function call that starts libVLC (libvlc_new) accepts, as parameter, a list of arguments. So, there's not much that we can do at the Kaffeine side, other than exposing somehow a way for the user to specify what arguments should be passed to the library. You can see the arguments libVLC accept via:
vlc --help
and:
vlc --help --advanced
Comment 6 Mauro Carvalho Chehab 2016-06-09 14:14:16 UTC
I did some tests of calling Kaffeine via ssh, setting the new libVLC arguments at:
"Settings" -> "Configure Kaffeine" -> "libVLC", changing the libVLC
arguments to:
        --no-video-title-show -V xcb_glx
or
        --no-video-title-show -V xcb_xv
and re-starting Kaffeine.

both options worked for me, with vlc 2.2.3 and Kaffeine 2.0.2-git.

PS.: due to a bug with DRI3 support on Fedora 23, I actually had to start Kaffeine with:
   LIBGL_DRI3_DISABLE=1 kaffeine 
as newer versions of mesa-LibGL have troubles with X11, as documented at:
   https://bugzilla.redhat.com/show_bug.cgi?id=1174257

I'm documenting the above at the Kaffeine's README. 

This also worked for tightvncserver (and no need to explicitly disable DRI3 on such case).

As we now have a way to run Kaffeine remotely, I'm closing this bug.
Comment 7 rens 2016-06-09 14:22:47 UTC
Created attachment 99425 [details]
attachment-13354-0.html

ok
thanks.
meanwhile, on 1.2.2, I worked around it by using x11vnc (=using the
active xserver on the actual hardware)
might be of interest to other users.

btw, I am seeing that (on suse, at least) the scanfile.dvb file in the
distributed package (rpm)
is of better content than what kaffeine gets from the internet update 
as far as europe satellite info is concerned.

For example Astra3 is completely missing S2 entries in that file, while
the distro version does have them, although they are outdated.
the missing S2 entries of course mean there is no way of tuning (most)
HD channels. Allmost all of Canal Digital HD (M7) channels will be missing,
which means most of europe is missing them, M7 group being quite dominant.

would you be interested in having this fixed ? I will fix it for my own
uses, but I am quite willing to share it.

best,

Rens

On 06/09/16 16:14, Mauro Carvalho Chehab via KDE Bugzilla wrote:
> https://bugs.kde.org/show_bug.cgi?id=364041
>
> Mauro Carvalho Chehab <mchehab@osg.samsung.com> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>          Resolution|---                         |FIXED
>              Status|UNCONFIRMED                 |RESOLVED
>
> --- Comment #6 from Mauro Carvalho Chehab <mchehab@osg.samsung.com> ---
> I did some tests of calling Kaffeine via ssh, setting the new libVLC arguments
> at:
> "Settings" -> "Configure Kaffeine" -> "libVLC", changing the libVLC
> arguments to:
>         --no-video-title-show -V xcb_glx
> or
>         --no-video-title-show -V xcb_xv
> and re-starting Kaffeine.
>
> both options worked for me, with vlc 2.2.3 and Kaffeine 2.0.2-git.
>
> PS.: due to a bug with DRI3 support on Fedora 23, I actually had to start
> Kaffeine with:
>    LIBGL_DRI3_DISABLE=1 kaffeine 
> as newer versions of mesa-LibGL have troubles with X11, as documented at:
>    https://bugzilla.redhat.com/show_bug.cgi?id=1174257
>
> I'm documenting the above at the Kaffeine's README. 
>
> This also worked for tightvncserver (and no need to explicitly disable DRI3 on
> such case).
>
> As we now have a way to run Kaffeine remotely, I'm closing this bug.
>
Comment 8 rens 2016-06-09 14:22:48 UTC
Created attachment 99426 [details]
rensQR128x128.jpg
Comment 9 Mauro Carvalho Chehab 2016-06-09 15:03:09 UTC
Git commit 41096434359637a50f4432c7510da18ef79ef78f by Mauro Carvalho Chehab.
Committed on 09/06/2016 at 15:01.
Pushed by mauroc into branch 'master'.

README: add instructions for using Kaffeine on a remote machine

As there are a few bugs related to it, let's add instructions
about how to use Kaffeine with remote desktops.

While here, let's make the README file use markdown, as understood
by pandoc.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

R  +75   -30   README.md [from: README - 063% similarity]

http://commits.kde.org/kaffeine/41096434359637a50f4432c7510da18ef79ef78f
Comment 10 Mauro Carvalho Chehab 2016-06-09 15:22:17 UTC
(In reply to rens from comment #7)

> meanwhile, on 1.2.2, I worked around it by using x11vnc (=using the
> active xserver on the actual hardware)
> might be of interest to other users.

Ah, yes, this is another solution ;)

Btw, openSUSE Tumbleweed now have Kaffeine 2.0.

> btw, I am seeing that (on suse, at least) the scanfile.dvb file in the
> distributed package (rpm)
> is of better content than what kaffeine gets from the internet update 
> as far as europe satellite info is concerned.

There were a bug on the script that auto-generates scanfile.dvb that were adding 4
blank lines in the middle of the scanfile. That hits another bug on Kaffeine < 2.0 that makes it to understand the blank lines as the end of the file. Both bugs were fixed on 2.0.

Maybe, what openSUSE did were to remove those 4 blank lines. Not sure, though, as I didn't double-checked it.

> For example Astra3 is completely missing S2 entries in that file, while
> the distro version does have them, although they are outdated.

There were some bugs on parsing DVB-S2 channels that got fixed.  On the latest file, Astra3 has 32 DVB-S channels and 16 DVB-S2 ones.

Btw, the new scanfile.dvb is now automatically synced, once by week, with the upstream tree that holds the channel lists, hosted at linuxtv.org:
    https://git.linuxtv.org/dtv-scan-tables.git/
and the auto-generated file:
   https://autoconfig.kde.org/kaffeine/scantable.dvb.qz
and
    https://linuxtv.org/downloads/dtv-scan-tables/kaffeine/

> the missing S2 entries of course mean there is no way of tuning (most)
> HD channels. Allmost all of Canal Digital HD (M7) channels will be missing,
> which means most of europe is missing them, M7 group being quite dominant.
> 
> would you be interested in having this fixed ? I will fix it for my own
> uses, but I am quite willing to share it.

Sure. If are there any channels missing, please submit to the linux-media@vger.kernel.org mailing list (no subscription required), with "[PATCH] dtv-scan-files: " in the subject.
The patch should be against the dtv-scan-files git tree (https://git.linuxtv.org/dtv-scan-tables.git/).