[Solved] Expert help: Tried it all, but still no dual core

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

[Solved] Expert help: Tried it all, but still no dual core

Postby pivot » Mon Feb 08, 2010 10:56 pm

First of all I want to thank the creators for an amazing software. This really is truly magic! I'm so happy to be a PS3 owner now! :)

I recently installed ps3mediaserver on my ubuntu 9.10 server. I first tried the easy way with just apt-get installing, and it worked almost right out of the box. Some tweaking and trying to understand the pms.conf file, and I was happy. But there was one major feature missing. I could not play my h264 mkv files. I could not play anything in 720 and up without lag and jitter. Some movies are better than others, but they all have one thing in common: they all lag sooner or later, and when it starts it goes baaaaaaad.

After trying pretty much everything out there (nbcores =, threads=, skiploopfilter +++) without any difference I decided to compile my own ps3mediaserver, mplayer with ffmpeg-mp and h264. (of course uninstalled ffmpeg and similar I had installed with the easy way first). I had a look at several guides and decided this one - viewtopic.php?f=3&t=3437 - looked good. Followed this guide step by step, but it still didn't work. Removed everything but pms and h264 codec, and tried another guide for installing mplayer with ffmpeg-mt (http://tips4linux.com/make-mplayer-play ... -machines/) but that didn't help either. So I went back to the guide from jgl75 since that's the one working the best. Now I'm writing this thread, because I'm getting mighty frustrated....

Some of the background: I set up ubuntu server 9.10 about one month ago. I then had 2,5gb ram and a athlon 3500+ single core cpu. The gfx card won't matter (I presume?) so I won't even list it here. It's a server and is supposed to host files, download usenet and torrent and crunch numbers. After the mainboard on my htpc died I realized I could use the cpu from that one, plus some ram from my old BOXX workstation. I now have:

A8NE-FM mainboard
AMD Athlon 64 dual core 2,2 (each core, of course)
3,5gb ddr400 ram
gigabit ethernet

I've used htop to make sure that both cpu's are working, and I know for sure that all the ram is working. So there should be no problem with the hardware. And it should be able to handle 720p, right?

Here's my PMS.conf:

Code: Select all
folders = /media/Barracuda2/Movies,/media/Barracuda2/Pictures,/media/Barracuda2$
thumbnail_seek_pos = 60
hidevideosettings = false
hide_extensions = false
hide_enginename = false
mencoder_sublangs = en,off;eng,off
autoloadsrt = false
mencoder_disablesubs = true
mencoder_ass = false
mencoder_yadif = true
mencoder_mt = true
nbcores = 2


As you can see I've tried using the mencoder_mt configuration, but that didn't do any difference. I also tried using nbcores = 2 (and 4,6,8 etc etc) but the only thing it does is creating more processes with mencoder that divides the 100% mencoder uses. I can see in htop that mencoder does not use more than one cpu, and that the other core is working the OS and the ps3mediaserver software. It does switch now and then from core to core, but mencoder is still only using one core with 100%. The other core has plenty of power left thats is untouched. I've tried adding "threads = 0 (and 2,4,6,8 etc) to the ffmpeg option in pms.conf, but that didn't do anything either.... frustrating, yeah....

There are no errors in the debug.log (something about wmv files, but that's probably because I haven't installed the ubuntu restricted codecs.... yet) so everything seems to be working fine. Everything but any dual core posibility.

So... any clever suggestions out there? If you want me to check some versions and note them here, just ask me and I'll do that. I can also mention that from the default settings of PMS I do need to disable the "Default h264 remux with mencoder" option on my ps3, or with the "mencoder_mux_compatible = false" option in the pms.conf to make mencoder play anything at all. If not the ps3 claims the data is corrupted. Tsmuxer, through the transcode options within each directory does not work either.

When movies start lagging it's usually above 40mb/s (I can see it with the display settings on the ps3 when playing).
I've also done some testings with the movie files from this website - http://www.bigbuckbunny.org/index.php/download/ - and I was actually able to play the h264 720p .mov file (although still using only one core), but the 1080p version was impossible. A lot of lagging, and the bandwidth showed around 200-300mb/s. Guess that 1080p clip is pretty massive, so I don't expect my hardware to be able to deal with that amount of data. But a 720p file it really should be able to stream...

So... any suggestions? Please! I'm dying here! ;)
Last edited by pivot on Thu Feb 11, 2010 12:48 am, edited 1 time in total.
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Re: Expert help needed: tried it all, but still no dual core

Postby shagrath » Tue Feb 09, 2010 12:06 am

I can see in htop that mencoder does not use more than one cpu, and that the other core is working the OS and the ps3mediaserver software. It does switch now and then from core to core, but mencoder is still only using one core with 100%.


yep your system should handle 720p but as you saw, unless you get the trick to make it works with 2 cores... I would suggest to take a basic mencoder command line, and try to encoder videos yourself (just as a test) with the -lavdopts threads=2 switch. It's the one used in ps3ms to trigger the multicore transcoding
shagrath
Project Lead
 
Posts: 2667
Joined: Wed Jan 14, 2009 1:39 pm

Re: Expert help needed: tried it all, but still no dual core

Postby industrai » Tue Feb 09, 2010 4:03 am

As shagrath said, you need to make sure mplayer/mencoder can do dual cpu outside of PMS first. There's a link in this thread that I use for dual core installation, viewtopic.php?f=3&t=4253&hilit=howto+ubuntu

I'm on the same platform as you and got it working this way.
industrai
 
Posts: 34
Joined: Tue Nov 03, 2009 2:07 am

Re: Expert help needed: tried it all, but still no dual core

Postby bytesaber » Tue Feb 09, 2010 5:28 am

Are you sure you are runing an SMP kernel? As in, a kernel that runs multi core.

uname -a
Last edited by bytesaber on Wed Feb 10, 2010 10:30 pm, edited 1 time in total.
-=bytes
bytesaber
 
Posts: 14
Joined: Mon Feb 08, 2010 8:55 am

Re: Expert help needed: tried it all, but still no dual core

Postby pivot » Tue Feb 09, 2010 4:57 pm

shagrath wrote:
I can see in htop that mencoder does not use more than one cpu, and that the other core is working the OS and the ps3mediaserver software. It does switch now and then from core to core, but mencoder is still only using one core with 100%.


yep your system should handle 720p but as you saw, unless you get the trick to make it works with 2 cores... I would suggest to take a basic mencoder command line, and try to encoder videos yourself (just as a test) with the -lavdopts threads=2 switch. It's the one used in ps3ms to trigger the multicore transcoding


Tried using command

mencoder -lavdopts threads=2 -o test.avi -nosound -oac copy -ovc lavc potus-1408.mkv

and it started encoding. But still only used 100% of one core. This is the output:

Code: Select all
MEncoder SVN-r30526-4.4.1 (C) 2000-2010 MPlayer Team
success: format: 0  data: 0x0 - 0x175cf883
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  1280x688  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31  fourcc:0x31637661  size:1280x688  fps:23.976  ftime:=0.0417
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
[h264 @ 0x1e0e370]Cannot parallelize deblocking type 1, decoding such frames in sequential order
Movie-Aspect is 1.86:1 - prescaling to correct movie aspect..000 [0:0]
videocodec: libavcodec (1280x688 fourcc=34504d46 [FMP4])
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

1 duplicate frame(s)!
^CPos:  16.6s    398f ( 0%) 41.23fps Trem: 100min 1042mb  A-V:0.000 [839:0]
Flushing video frames.
Writing index...
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream:  839.586 kbit/s  (104948 B/s)  size: 1742133 bytes  16.600 secs  398 frames


I also tried with more threads... still no luck. I have encoded mplayer with the codecs from ffmpeg-mt (according to the tutorial) but obviously not working. Are there any way of checking if it something went wrong in that install? Checking which codecs it's using and if they are from the ffmpeg-mt library?
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Re: Expert help needed: tried it all, but still no dual core

Postby pivot » Tue Feb 09, 2010 4:59 pm

bytesaber wrote:Are you sure you are runing an SMP kernel? As in, a kernel that runs multi core.

uname -a

-=kreg


uname -a

Linux pivserver 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Re: Expert help needed: tried it all, but still no dual core

Postby pivot » Tue Feb 09, 2010 5:01 pm

Should I now try the instructions in viewtopic.php?f=3&t=4253&hilit=howto+ubuntu instead to see if that makes a difference? Or should I test out some more with my current install?
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Re: Expert help needed: tried it all, but still no dual core

Postby pivot » Tue Feb 09, 2010 7:38 pm

Tried the ffmpeg also to see if that one would use two cores... Have a look:

Code: Select all
pivot@pivserver:/media/Barracuda2/Movies/1408 (2007)$ ffmpeg -i potus-1408.mkv -target pal-dvd test.avi
FFmpeg version git-d4fad7c, Copyright (c) 2000-2010 Fabrice Bellard, et al.
  built on Feb  8 2010 17:50:14 with gcc 4.4.1
  configuration: --enable-pthreads
  libavutil     50. 8. 0 / 50. 8. 0
  libavcodec    52.52. 0 / 52.52. 0
  libavformat   52.50. 0 / 52.50. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0
[matroska @ 0x10e6410]Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (500000/10427) -> 24.00 (24/1)
Input #0, matroska, from 'potus-1408.mkv':
  Duration: 01:52:30.83, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x688, PAR 1:1 DAR 80:43, 24.39 fps, 24 tbr, 1k tbn, 47.95 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 6 channels, s16
File 'test.avi' already exists. Overwrite ? [y/N] y
[ac3 @ 0x11028b0]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
Output #0, dvd, to 'test.avi':
    Stream #0.0(eng): Video: mpeg2video, yuv420p, 720x576 [PAR 64:43 DAR 80:43], q=2-31, 6000 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame=  644 fps= 26 q=2.0 size=    7448kB time=25.72 bitrate=2372.2kbits/s dup=28 drop=0


But still only one core :(
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Re: Expert help needed: tried it all, but still no dual core

Postby pivot » Tue Feb 09, 2010 7:45 pm

One more try.... added the "threads 4" option to see... seems that it actually used a lot more from each core now. 90-99 on one core and up to 80 on the other... guess that's what the amount of power needed for that file?

Code: Select all
pivot@pivserver:/media/Barracuda2/Movies/1408 (2007)$ ffmpeg -threads 4 -i potus-1408.mkv -target pal-dvd test.avi
FFmpeg version git-d4fad7c, Copyright (c) 2000-2010 Fabrice Bellard, et al.
  built on Feb  8 2010 17:50:14 with gcc 4.4.1
  configuration: --enable-pthreads
  libavutil     50. 8. 0 / 50. 8. 0
  libavcodec    52.52. 0 / 52.52. 0
  libavformat   52.50. 0 / 52.50. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0
[matroska @ 0x1e47410]Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (500000/10427) -> 24.00 (24/1)
Input #0, matroska, from 'potus-1408.mkv':
  Duration: 01:52:30.83, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x688, PAR 1:1 DAR 80:43, 24.39 fps, 24 tbr, 1k tbn, 47.95 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 6 channels, s16
File 'test.avi' already exists. Overwrite ? [y/N] y
[ac3 @ 0x1e638b0]No channel layout specified. The encoder will guess the layout, but it might be incorrect.
Output #0, dvd, to 'test.avi':
    Stream #0.0(eng): Video: mpeg2video, yuv420p, 720x576 [PAR 64:43 DAR 80:43], q=2-31, 6000 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 2216 fps= 31 q=1.6 size=   39880kB time=88.60 bitrate=3687.3kbits/s dup=94 drop=1


When I tried it on a 1080p h264 file I got about the same resulat. Even with "threads 8"...


So... is the ffmpeg-mt working? Is mencoder working? (well...obviously not. i didn't get 100% on each core)
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Re: Expert help needed: tried it all, but still no dual core

Postby pivot » Wed Feb 10, 2010 2:47 pm

mencoder -oac copy -ovc x264 -o test.avi potus-1408.mkv

actually gives me almost full force on both cores.....
pivot
 
Posts: 60
Joined: Mon Feb 08, 2010 10:13 pm

Next

Return to Linux/Unix Support

Who is online

Users browsing this forum: No registered users and 4 guests