Author Topic: [Changed] Xine/mplayer and delay during playback SD/HD video  (Read 4636 times)

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
[Changed] Xine/mplayer and delay during playback SD/HD video
« on: April 11, 2009, 12:37:47 pm »
Hi,

I'd like ask about CPU loading during HD video playback. In my case mplayer takes 50-80% of CPU. As result I can see small delays continuously. Any suggestions or recommendations to improve HD video playback will be very appreciated!

TIA
« Last Edit: April 23, 2009, 12:32:51 am by nite_man »
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Xine/mplayer and delay during playback SD/HD video
« Reply #1 on: April 23, 2009, 12:32:02 am »
I've found the same problem with DivX playback after a few hours of working of core. See these log messages:
Code: [Select]
05      04/23/09 1:21:40.291            [ID: 1004]  CHAPTER:0 POS:6362640 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:41.976            [ID: 1004]  CHAPTER:0 POS:6364320 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:43.627            [ID: 1004]  CHAPTER:0 POS:6366000 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:45.282            [ID: 1004]  CHAPTER:0 POS:6367640 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:46.946            [ID: 1004]  CHAPTER:0 POS:6369320 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:48.649            [ID: 1004]  CHAPTER:0 POS:6371000 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:50.417            [ID: 1004]  CHAPTER:0 POS:6372800 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:52.133            [ID: 1004]  CHAPTER:0 POS:6374520 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:53.820            [ID: 1004]  CHAPTER:0 POS:6376160 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:55.408            [ID: 1004]  CHAPTER:0 POS:6377800 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:56.729            [ID: 1004]  CHAPTER:0 POS:6379120 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:58.025            [ID: 1004]  CHAPTER:0 POS:6380400 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:21:59.325            [ID: 1004]  CHAPTER:0 POS:6381720 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:22:00.638            [ID: 1004]  CHAPTER:0 POS:6383040 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:22:01.947            [ID: 1004]  CHAPTER:0 POS:6384320 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>
05      04/23/09 1:22:03.523            [ID: 1004]  CHAPTER:0 POS:6385880 TITLE:0 SUBTITLE:-1 AUDIO:-1 TOTAL:6533440 (seek 0) t.c. ctr 1 freq 1, <0xac2ffb90>

As you may see sometimes the time between message is 1 sec, sometimes - 2-3. After reboot it again starts play without any delay. I don't see any loading of the system. The CPU is used by just 22.2%. But Xine takes 40-50% of CPU but normally it's 30-40%.

Any idea why it can be happened?

TIA
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #2 on: April 23, 2009, 12:41:30 am »
Michael,

The log entries are normal (although should be 1 per second all the time) - they are just the timestamps used to keep track of the location through playback so that the resume and split stream functions can work.

It sounds like you are describing the well known xine issue..... after a period of time, playback starts to get jerky... the longer the time and/or the more video files you playback the worse it gets. A Quick Reload fixes the problem. It has been postulated that it is a leak in xinelib (memory leak? can't remember), and I believe someone said that they believe it is more general than just LMCE, so perhaps it is a bug that will be fixed in 0810? Not sure, I haven't seen any of those using 0810 Alpha comment on it... but obviously, HD video is going to be effected even more....

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #3 on: April 23, 2009, 12:46:37 am »
Michael,

The log entries are normal (although should be 1 per second all the time) - they are just the timestamps used to keep track of the location through playback so that the resume and split stream functions can work.

It sounds like you are describing the well known xine issue..... after a period of time, playback starts to get jerky... the longer the time and/or the more video files you playback the worse it gets. A Quick Reload fixes the problem. It has been postulated that it is a leak in xinelib (memory leak? can't remember), and I believe someone said that they believe it is more general than just LinuxMCE, so perhaps it is a bug that will be fixed in 0810? Not sure, I haven't seen any of those using 0810 Alpha comment on it... but obviously, HD video is going to be effected even more....

Hmmm... weirdly I have just been testing the latest 0810 Alpha and this problem is still there even with SD content. So as xinelib has certainly changed between 0710 and 0810 its hard to see how this could be purely a xinelib issue.

It needs to be fixed for sure though :-(

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #4 on: April 23, 2009, 12:53:02 am »
Damn! Had my fingers tightly crossed!

Does the xine wrapper do anything once it has kicked off playback? Or does the call to the xine library do everything from then on until playback is finished? I guess xine wrapper at least has to send the time stamp events.... just trying to think of something that could be leaking or otherwise going awry in the wrapper part, that could be causing this... doesn't seem all that likely.... unless the wrapper is constantly calling something in xinelib to keep the playback going (also doesn't seem likely) that could potentially then cause this issue.... it really is a pain!

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #5 on: April 23, 2009, 09:14:39 am »
Thanks guys for clarification! The strange thing is that. I didn't face with that problem in the past when I played just SD content and run UI2 with low resolution. Now I run UI2 without transparency with resolution 1080p. Maybe it's related somehow. If quick reloading of router help I suspect that problem should be with xine wrapper. Otherwise it won't help at all. Moreover, the same problem appears with mplayer and HD content. So, maybe it something more generic then just wrapper?
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #6 on: April 23, 2009, 12:19:17 pm »
Hi,

I also spotted similar behaviour. If I have a long uptime and have played many files, than there is a higher chance that video will be jerky...

I'm not using any higher resolution than 800x600 on MD.

HTH,

regards,

Bulek.
Thanks in advance,

regards,

Bulek.

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #7 on: April 23, 2009, 01:02:05 pm »
Hi,

I also spotted similar behaviour. If I have a long uptime and have played many files, than there is a higher chance that video will be jerky...

I'm not using any higher resolution than 800x600 on MD.

HTH,

regards,

Bulek.


Posde has a theory that it might be caused by the polling on port 12000 for timecode updates. This sounds plausible to me...so we'll test it.

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

MarcoZan

  • Veteran
  • ***
  • Posts: 148
    • View Profile
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #8 on: April 23, 2009, 04:53:14 pm »
Hi all

if it can be of any help, on low "horse power" MD this issue (jerky videos) shows near the end of the first playback (when movie is long).
A router reload always clears the situation.

Regards
Marco

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #9 on: April 23, 2009, 05:08:40 pm »
Hi all

if it can be of any help, on low "horse power" MD this issue (jerky videos) shows near the end of the first playback (when movie is long).
A router reload always clears the situation.

Regards
Marco

Ok... thanks ;-)

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #10 on: April 24, 2009, 09:16:16 am »
Quote
Posde has a theory that it might be caused by the polling on port 12000 for timecode updates. This sounds plausible to me...so we'll test it.

Keep us updated, please. I also try to dig it as deep as I can :)
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: [Changed] Xine/mplayer and delay during playback SD/HD video
« Reply #11 on: April 24, 2009, 12:55:52 pm »
Quote
Posde has a theory that it might be caused by the polling on port 12000 for timecode updates. This sounds plausible to me...so we'll test it.

Keep us updated, please. I also try to dig it as deep as I can :)

Will do. May get time on our 810 alpha test system later to run some tests on this port 12000 theory.

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk