FS#46100 - [kaffeine] unable to watch tv

Attached to Project: Community Packages
Opened by bobbasun (bobbasun) - Tuesday, 25 August 2015, 10:29 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 12 June 2016, 00:31 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
after upgrading from kaffeine-1.2.2-4-x86_64 to kaffeine-1.3-1-x86_64, tv capture has broken. it will display one frame and no audio.

this seems to be the problem:
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.


starting up kaffeine:
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
[0000000001cb2f88] pulse audio output error: PulseAudio server connection failure: Connection refused
Object::connect: No such signal MediaWidget::playlistPrevious()
Object::connect: No such signal MediaWidget::playlistPlay()
Object::connect: No such signal MediaWidget::playlistNext()
Object::connect: No such signal MediaWidget::playlistTrackLengthChanged(int)
Object::connect: No such signal MediaWidget::playlistTrackMetadataChanged(QMap<MediaWidget::MetadataType,QString>)
20:27:20 DvbManager::loadDeviceManager: using built-in dvb device manager
20:27:20 DvbLinuxDevice::startDevice: found dvb device "P14f18802107d665f" 47 "Conexant CX22702 DVB-T"
QSystemTrayIcon::setVisible: No Icon set

clicking the tv button:
20:27:55 DvbDevice::frontendEvent: tuning succeeded
20:27:55 DvbSectionFilterInternal::processSections: short section
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[00007fd8e0000958] vdpau_avcodec generic error: Xlib not initialized for threads
[00007fd8e0000958] vdpau_avcodec generic error: Xlib is required for VDPAU
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[00007fd8d0001268] vdpau_display vout display error: Xlib not initialized for threads
[00007fd8f4016188] core decoder error: Could not convert timestamp 0

closing kaffeine:
20:28:23 DvbEpgModel::~DvbEpgModel: filter list not empty
[00007fd8f4016188] core decoder error: Could not convert timestamp 0
[00007fd8f4016188] core decoder error: Could not get display date for timestamp 0
[00007fd8f4016188] core decoder error: Could not get display date for timestamp 0
[00007fd8f4016188] core decoder error: Could not get display date for timestamp 0
[00007fd8f4016188] core decoder error: Could not get display date for timestamp 0
[00007fd8f4016188] core decoder error: Could not get display date for timestamp 0
[00007fd8f4016188] core decoder error: Could not get display date for timestamp 0
[00007fd8f40840d8] core decoder error: Could not convert timestamp 0
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 12 June 2016, 00:31 GMT
Reason for closing:  Fixed
Additional comments about closing:  kaffeine 2.0.3
Comment by Antonio Rojas (arojas) - Tuesday, 25 August 2015, 16:09 GMT
Please report this upstream
Comment by bobbasun (bobbasun) - Wednesday, 26 August 2015, 01:00 GMT Comment by patrick (potomac) - Saturday, 29 August 2015, 22:12 GMT
@bobbasun : I have the same TV card ( WinFast DTV1000-T ) I can see image, sound ( 25 FPS ), I use the last version of vlc ( 2.2.1-6 ), kernel 4.1.6, no pulseaudio, my graphic card is amd radeon HD4650 ( with open source driver radeon ),

do you have some AUR packages ?
AUR packages can sometimes trigger bugs, create a conflict,

the only bug I notice is that randomly kaffeine 1.3 uses high CPU ( 56% with my pentium dual core 3.33 Ghz ),

the high CPU activity is not normal because with the previous version ( kaffeine 1.2 ) the CPU usage was Ok ( 5% ), so indeed there is at least a bug with this 1.3 version and I suggest you to downgrade to the previous version package :

ftp://seblu.net/archlinux/arm/2015/03/06/community/os/x86_64/kaffeine-1.2.2-4-x86_64.pkg.tar.xz

you can check also if resetting your kaffeine configuration in "~/.kde4/share/apps/kaffeine/" ( for example the file "xine-config" ) gives better results,

I will check if with the git version of kaffeine this bug is solved
Comment by bobbasun (bobbasun) - Sunday, 30 August 2015, 00:15 GMT
same kernel, vlc versions here. no pulseaudio either. nvidia gtx970 on nvidia-352.41-1-x86_64.

i tried wiping out my .kde4/share/apps/kaffeine directory, no change. xine-config doesn't get recreated at all with kaffeine 1.3.1.

tried kaffeine-git r1005.500e25f-1 from https://aur.archlinux.org/packages/kaffeine-git/. same deal. first frame, no audio, no xine-config being created.

audio only "radio" style stations will play sound, but hiccup every second with some of this business:
[0000000000c1e5a8] core input error: ES_OUT_RESET_PCR called
[0000000000c1e5a8] core input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 526 ms)
[0000000000c1e5a8] core input error: ES_OUT_RESET_PCR called
[0000000000c1e5a8] core input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 531 ms)

kaffeine-1.2.2-4-x86_64 still works perfectly.
Comment by patrick (potomac) - Sunday, 30 August 2015, 00:45 GMT
maybe something ( a video application running in the background ) prevents kaffeine to use xine

you can do this test :

- create a new user
- then connect to kde with this user
- run kaffeine
- check if the problem is still here
Comment by patrick (potomac) - Sunday, 30 August 2015, 00:54 GMT
interesting here : VLC can also have this error message :

"../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads."

https://bugs.launchpad.net/openlp/+bug/1433245

http://askubuntu.com/questions/635356/run-vlc-via-bumblebee

it could be related to X11 configuration or nvidia driver, you can try with the opensource driver ( "nouveau" ),

a possible workaround is to create manually the file "xine-config" in your ~/.kde4/share/apps/kaffeine/ folder, and put this :

# video driver
# { auto vdpau aadxr3 dxr3 xv vaapi raw opengl2 opengl xshm aa caca xxmc none sdl fb xvmc }, default: 0
video.driver:xv

it can help kaffeine 1.3, the vdpau driver will not be used, only the xv driver here
Comment by bobbasun (bobbasun) - Sunday, 30 August 2015, 01:14 GMT
nothing is running the the background.

tried the nouveau driver, no change.

although i have just noticed that half the channels work and the other half don't. (sorry, should have already tried this but i only tune in a couple of channels because most are junk/24hr home shopping).

so of the providers we have here (melbourne, australia):
7 network: all works.
sbs network: all works, but audio only channels hiccup
channel 31 community tv: works.

9 network: won't play.
10 network: won't play.
abc network: won't play.

very strange. i swapped out my aerial but get the same results.
Comment by patrick (potomac) - Sunday, 30 August 2015, 15:12 GMT
you must check what kind of video codec your channels use ( mpeg 2 ? h264 ? )

for example abc network may use the h264 codec, if kaffeine/xine have problem with h264 codec it can explain why it doesn't work,

and for example sbs network may use mpeg2 codec,

problem may also occur if some of your channels are in SD format ( single definition ), and others in HD format ( high definition )
Comment by patrick (potomac) - Sunday, 30 August 2015, 17:20 GMT
I did some investigations and I notice that I have the same error message at startup of kaffeine 1.3 :

19:09:36 DvbDevice::frontendEvent: tuning succeeded
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[00007f301c05f888] vdpau_avcodec generic error: Xlib not initialized for threads
[00007f301c05f888] vdpau_avcodec generic error: Xlib is required for VDPAU
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[00007f3014001268] vdpau_display vout display error: Xlib not initialized for threads

but despite this error message I can watch the channels with kaffeine 1.3, the difference between you and me could be the graphic driver, amd may be more tolerant than nvidia about bugs like that,

anyway there is clearly a bug in kaffeine 1.3, because with kaffeine 1.2.2-4 I don't have this error message in the console, and the CPU usage is much lower ( 5% instead of 56% ),

I will try a "git bisect" in order to find the culprit about the commit
Comment by patrick (potomac) - Tuesday, 01 September 2015, 00:00 GMT
I did the "git-bisect", the problem starts with commit e31652b06cc46dde488804b09205487d8036114f, an old commit from 2011 :

http://commit-digest.org/issues/2011-05-01/moreinfo/e31652b06cc46dde488804b09205487d8036114f/

with this commit they switch from (lib-)xine to (lib-)vlc, the previous package ( kaffeine-1.2.2-4 ) uses lib-xine, and the new package ( kaffeine-1.3-1 ) uses lib-vlc

kaffeine-1.2.2-4 uses a source code from 2011-04-17
kaffeine-1.3-1 uses a source code from 2015-08-07

a KF5 version of kaffeine exists but the author gave up the project due to a lack of time :

https://github.com/denisq/kaffeine5
Comment by rob.til.freedman (rtfreedman) - Wednesday, 09 September 2015, 15:53 GMT
I've got vdpau working (and some odd behaviour is also gone) with this little patch and linking with -lX11:
--- old/kaffeine/src/main.cpp 2015-08-07 17:43:59.000000000 +0200
+++ new/kaffeine/src/main.cpp 2015-09-09 17:01:04.068655271 +0200
@@ -25,6 +25,8 @@
#include "mainwindow.h"
#include "sqlhelper.h"

+#include <X11/Xlib.h>
+
class KaffeineApplication : public KUniqueApplication
{
public:
@@ -63,6 +65,8 @@

int main(int argc, char *argv[])
{
+ XInitThreads();
+
KAboutData aboutData("kaffeine", 0, ki18n("Kaffeine"), "1.3-git",
ki18n("A media player for KDE with digital TV support."),
KAboutData::License_GPL_V2, ki18n("(C) 2007-2011 The Kaffeine Authors"),


---
Please have a test before posting it upstream

Comment by patrick (potomac) - Wednesday, 09 September 2015, 16:28 GMT
@rtfreedman : it doesn't work ( fail with gcc ) because you have forgotten to add a link to X11 lib in /src/CMakeLists.txt,

here is a full patch in attachment to this message,

but your patch and mine don't really solve the problem, vdpau doesn't work ( too much high CPU usage ), and there is a crash if I close kaffeine ( it's likely related to XInitThreads() function, a mutex lock problem ),

there is also a bug report where these problems are discussed :

https://bugs.kde.org/show_bug.cgi?id=351774

kaffeine 1.2.2-4 is still the best version : decent CPU usage with vdpau, no bugs with xine backend,

problems have begun when they have started to use libvlc
Comment by rob.til.freedman (rtfreedman) - Wednesday, 09 September 2015, 16:36 GMT
@patrick because you have forgotten to add a link to X11 lib in /src/CMakeLists.txt
It's in the comment: and linking with -lX11

It's a quick patch and it is working for me with low cpu usage no crashes so far.
And I'm aware of the possible lock problem!
And 'is still the best version' doesn't help with this version really, does it?
Comment by patrick (potomac) - Wednesday, 09 September 2015, 16:47 GMT
I did a new test, the crash when I close the application doesn't occur now, I don't know why,

what I am sure is that the CPU usage is still too high ( I have an amd radeon 4650HD Pcie with open source driver ), it's not normal, because with vdpau driver I should have a lower CPU usage ( vdpau driver works without problem in mplayer ),

I suspect a bug in libvlc or a bad use of libvlc by kaffeine 1.3.x

a black screen can occur sometimes when I change channels,

that's why I said that kaffeine 1.2.2-4 is still the best version ( for me ), and with this version we have the ability to choose the video driver in xine-config config file ( vdpau, xvideo ), with 1.3.x it's not the case because there is no way to configure libvlc ( no config file, no option in GUI )
Comment by rob.til.freedman (rtfreedman) - Wednesday, 09 September 2015, 16:59 GMT
@patrick
Thanks for the link I didn't know about. I've tried your .m2t and it didn't work. After trying, cpu usage went up to 54%
for every tvchannel. Restarting kaffeine and usage is about 8% again.
Comment by Antonio Rojas (arojas) - Thursday, 02 June 2016, 09:45 GMT
still valid with 2.0.1?
Comment by patrick (potomac) - Thursday, 02 June 2016, 18:31 GMT
I still have the same bug like the 1.3.1 version : too much high CPU usage when I watch TV ( 100% CPU usage ),

the main problem is the VLC backend, kaffeine seems to use it badly, and we don't have a way to configure vlc backend inside kaffeine ( for example VDPAU, xv, x11 for the video output ), that's why there is a high CPU usage if the default settings choosen by kaffeine is not suitable for the graphic driver,

and I discover another bug : when I click on "file-> exit" kaffeine is still running ( the GUI disapears but kaffeine process is still running, I had to kill the process ),

kaffeine 1.2.2-4 is still the best version : decent CPU usage with vdpau, no bugs with xine backend,

Loading...