Author |
Message |
benjohnson
|
Posted: Wed Jun 22, 2005 6:09 pm |
|
Joined: Wed Jul 21, 2004 7:09 pm
Posts: 71
Location:
Mounds View, MN (burbs of MSP)
|
A previous post (Athlon CPU) got me curious, so I started benchmarking playback of 480p, 720p, and 1080i streams on my backend/frontend 3000+ box. I used the command
Code: top -b -p6374 > cpu.log
Where the -p6374 is the process number of mythfrontend. So while I was playing back the first 1080i stream(a recent pbs show about China) all was good I was seeing 31.3% max usage for mythfrontend and 96.3% us and 2.7% sy. Now where is that extra processing power going I was wondering. I tried a different stream Oprah, the bane of my mythbox, the only show besides Dr. Phil that ever causes either of my myth boxes to stutter. ( I tape them for my wife, and she isn't happy about the stuttering when it happens) What I can figure out is that why a 1080i show that has big black boxes on each side can cause my boxes to stutter and why pbs shows of 1080i never give me a problem, but that is a mystery for another day. Again, mythfrontend is maxing out at about 31% cpu usage. so I change my strategy, I log the whole output of top Code: top -b > cpu.log
This time the playback start stuttering, and low and behold what do I see, but kswapd0 taking up 88.5% of the cpu time.
So I check out my memory situation by looking at /prc/meminfo and I find that:
MemTotal: 514276 kB
MemFree: 2264 kB
Buffers: 3604 kB
Cached: 329884 kB
I'm starting to put the pieces together. Why does my backend always behave better when it is rebooted? Why does my "Frontend only" box skip when cpu utilization is low?
Question the first. I know linux likes to use every available free byte of memory to do disk caching and such to maximize the performance of the machine, but isn't this counter to the typical mythbox setup where everything that is going to run is already in memory and all data is time sensitive. What is there to cache that should take all 512MB of memory? Or is this some sort of leak?
I have noticed that the longer my box runs the less free memory I have and the more swap space I have used.
Question the Second: Is there a way to reserve real memory for critical processes so that swapping doesn't occur in the middle of decoding a 1080i stream? Or even turn off disk caching?
If anybody is interest in some raw performace data I can post it later.
_________________ FRONTEND 1 - R5A16, Athlon 3000+, NVidia Motherboard, SB live, GeForce 5200, AA 9A60
FRONTEND 2 - R5A16, Athlon 2500+, Nvidia Motherboard, SB Live, GeForce 440MX, TV-OUT
BACKEND - R5A16, Althon 1700+, Nvidia MB, 2- HD3000's, 450GB LVM partition
|
|
Top |
|
|
Liv2Cod
|
Posted: Wed Jun 22, 2005 11:37 pm |
|
Joined: Fri May 21, 2004 11:55 pm
Posts: 1206
Location:
Silicon Valley, CA
|
I noticed my HDTV box was swapping with 512M. It seemed to be exacerbated by the commercial flagging. I turned off flagging and the performance was much better. I fixed it the old fashioned way -- a trip to Fry's and 512M more memory. Never a problem since.
_________________ Do you code to live, or live to code? Search LinHES forum through Google
|
|
Top |
|
|
Greg Frost
|
Posted: Wed Jun 22, 2005 11:53 pm |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
Interesting results though. I guess the requirement for HD should be upgraded from a 3G class CPU to a 3G class cpu with 1G memory.
|
|
Top |
|
|
benjohnson
|
Posted: Thu Jun 23, 2005 10:50 am |
|
Joined: Wed Jul 21, 2004 7:09 pm
Posts: 71
Location:
Mounds View, MN (burbs of MSP)
|
After much digging, because admittedly I didn't know much about virtual memory, I found this page: http://gentoo-wiki.com/FAQ_Linux_Memory_Management
Evidently with 2.6.x kernel you can chnage the behavior of virtual memory by setting a variable
Code: # sysctl -w vm.swappiness=30
from 0 (use cache shrinking) to 100 (swapping inactive pages). Now I think the ideal behaviour for a mythbox is going to be 0. I have temporarily set this to 0 on my Backend/frontend box and will see if it makes any difference. Unfortunately, I have to wait until this afternoon becuase my wife deleted that last Oprah on the box and I don't have any other CBS 1080i wideboxed program to test. It doesn't seem to do anything harmful to any other playback though.
_________________ FRONTEND 1 - R5A16, Athlon 3000+, NVidia Motherboard, SB live, GeForce 5200, AA 9A60
FRONTEND 2 - R5A16, Athlon 2500+, Nvidia Motherboard, SB Live, GeForce 440MX, TV-OUT
BACKEND - R5A16, Althon 1700+, Nvidia MB, 2- HD3000's, 450GB LVM partition
|
|
Top |
|
|
ceenvee703
|
Posted: Thu Jun 23, 2005 10:58 am |
|
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location:
Virginia, USA
|
One note: are you sure that Oprah is a HD program? I don't think it is, and that could be why its playback is causing a problem. I had a similar problem with a SD recording I made (I almost always record HD when I record on the HD3000)... playback stunk. This may be related to whether you are recording transport streams vs program streams... Xsecrets has posted about this in the past.
|
|
Top |
|
|
benjohnson
|
Posted: Thu Jun 23, 2005 1:42 pm |
|
Joined: Wed Jul 21, 2004 7:09 pm
Posts: 71
Location:
Mounds View, MN (burbs of MSP)
|
No I'm not sure , but here is what it says when I play it.
Code: 2005-06-22 18:01:04.989 AVFD: Opening Stream #0: codec id 2 2005-06-22 18:01:04.989 Using libmpeg2 for video decoding 2005-06-22 18:01:04.989 detectInterlace(Detect Scan, Detect Scan, 29.97, 1088) ->Interlaced S can 2005-06-22 18:01:04.990 Interlaced: Interlaced Scan video_height: 1088 fps: 29.97 2005-06-22 18:01:04.990 AVFD: Looking for decoder for 2 2005-06-22 18:01:04.990 AVFD 2005-06-22 18:01:04.990 AVFD: Opening Stream #1: codec id 86020 2005-06-22 18:01:04.990 AVFD: Looking for decoder for 86020 2005-06-22 18:01:04.991 Estimated bitrate = 18884 2005-06-22 18:01:05.218 Position map filled from DB to: 107768 2005-06-22 18:01:05.218 SyncPositionMap prerecorded, from DB: 7699 entries 2005-06-22 18:01:05.218 Position map found 2005-06-22 18:01:05.222 Opening audio device 'iec958'. 2005-06-22 18:01:05.364 Over/underscan. V: 0, H: 0.02, XOff: 0, YOff: 0 2005-06-22 18:01:05.368 Using XV port 177 2005-06-22 18:01:05.372 Image size. dispxoff 0, dispyoff: 0, dispwoff: 960, disphoff: 540 2005-06-22 18:01:05.372 Image size. imgx 38, imgy: 0, imgw: 1843, imgh: 1080 2005-06-22 18:01:07.061 Using deinterlace method kerneldeint 2005-06-22 18:01:07.061 Changing from None to WatchingPreRecorded 2005-06-22 18:01:07.062 Using realtime priority. 2005-06-22 18:01:07.183 nVidiaVideoSync: VBlank ioctl did not work, unimplemented in this dri ver? 2005-06-22 18:01:07.228 DRMVideoSync: Could not open device /dev/dri/card0, No such device or address 2005-06-22 18:01:07.228 RTCVideoSync: Could not set RTC frequency, Permission denied. 2005-06-22 18:01:07.228 Using audio as timebase 2005-06-22 18:01:07.228 Video timing method: USleep with busy wait 2005-06-22 18:01:07.228 Refresh rate: 16790, frame interval: 33366 2005-06-22 18:01:07.228 waiting for prebuffer...
I was assuming since I saw a video height of 1088 and Estimated bitrate of 18884, that it was either filmed in HD or upconverted.
I'm not really sure about transport streams vs program streams. I'll have to dig into that one.
Quote: I had a similar problem with a SD recording I made (I almost always record HD when I record on the HD3000)... playback stunk
I'm not sure I understand that line. Are we talking NSTC vs ASTC or 480p vs 720p,1080i? I've never had any problems with either 480p or 720p programs (well other that my damn tree that blocks KSTP (ABC) when it rains) In fact I do quite a bit of 480p recording (PBSyou is great).
_________________ FRONTEND 1 - R5A16, Athlon 3000+, NVidia Motherboard, SB live, GeForce 5200, AA 9A60
FRONTEND 2 - R5A16, Athlon 2500+, Nvidia Motherboard, SB Live, GeForce 440MX, TV-OUT
BACKEND - R5A16, Althon 1700+, Nvidia MB, 2- HD3000's, 450GB LVM partition
|
|
Top |
|
|
ceenvee703
|
Posted: Thu Jun 23, 2005 1:59 pm |
|
Joined: Fri Apr 02, 2004 10:08 am
Posts: 1637
Location:
Virginia, USA
|
Quote: I was assuming since I saw a video height of 1088 and Estimated bitrate of 18884, that it was either filmed in HD or upconverted
There's very little daytime programming that is being broadcast in HD. I think the only program is The Young and The Restless on CBS. I'm virtually positive none of the syndicated shows are in HD.
If you go to MythWeb as of 0.18, the Searches link at the top includes a way to search for "All HDTV" and it will pull out shows that are specifically HD signals.
Anyhow, I'm also pretty sure that stations aren't upconverting 480p (or i) ATSC to 1080i or 720p. Seems like a waste of bandwidth. But this I'm less sure about. Even less sure how the HD3000 handles it... maybe it's doing the upsampling?
|
|
Top |
|
|