CPU optimization - video went idle?

Support and queries relating to third party Live CDs and DVD, VM images and other packaged distributions
Post Reply
jonathanbrickman0000
Posts: 8
Joined: Wed Jan 31, 2007 3:49 pm
Location: Topeka, Kansas, USA

CPU optimization - video went idle?

Post by jonathanbrickman0000 »

I'm using the LiveCD installed to hard drive, updated to .3, delightfully. Athlon 1GHz with 1G RAM, a quad-BT878 card. CPU usage seems to sit at 50% with one camera. Haven't tried camera two yet, but will be doing so shortly, I would like to see how many cameras I can pack into one 1GHz box. Thought I would attempt CPU optimization of the C/C++ code first (kernel already done). So I got the source, unpacked, set CFLAGS and CXXFLAGS at "-march=athlon -O2" as part of the configure, did it, no errors, then 'make'; no errors. Found the ELF binaries (zma, zmu, etcetera). Shut down the zoneminder service. Copied my Athlon-optimized binaries to the working locations manually, in order to not mess things up beyond my ability to repair! :) Started the zoneminder service. The web service worked fine, but my video device was listed as "Idle", even though it was still "Enabled". I also could not "Disable" the device in order to "Enable" it again. Also could not figure out why this was happening. Anyone have an answer?

I ended up shutting the service down again, running rpm -U --force on the .3 RPM file, and doing a reboot, which got everything up again, albeit non-optimized.
User avatar
MJN
Posts: 251
Joined: Wed Jan 17, 2007 10:29 am
Location: Wiltshire, UK

Post by MJN »

I could be way off the target here (as it sure sounds like you know what you're doing!) but isn't the 'Idle' referring to the state as in not 'alarm' or 'alert'? Or had you triggered it (motion or forced alarm) yet it still didn't change?

Mathew
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Try it this way.
Snag the src.rpm here:
http://www.fairpoint.net/~rdmelin/RPMS/SRPM/

rebuild it with:
"sudo rpm --rebuild --target=athlon zm-1.22.3-4_20060mdk.src.rpm"

And install with rpm -U --force

I think you will see a greater performance boost by installing the jpeg-mmx enabled rpms found here:
http://www.fairpoint.net/~rdmelin/RPMS/ ... jpeg-simd/

Have fun :)
jonathanbrickman0000
Posts: 8
Joined: Wed Jan 31, 2007 3:49 pm
Location: Topeka, Kansas, USA

Post by jonathanbrickman0000 »

Well, I know a little bit...just enough to get myself into lots of trouble and do some good :)

I just installed the MMX-enabled jpeg libraries. Very interesting result. CPU usage is just a tad lower, but memory usage is half. Half! Quite an advantage! Thanks much!

I'll try the other shortly :)
Last edited by jonathanbrickman0000 on Thu Feb 01, 2007 8:25 pm, edited 1 time in total.
jonathanbrickman0000
Posts: 8
Joined: Wed Jan 31, 2007 3:49 pm
Location: Topeka, Kansas, USA

Post by jonathanbrickman0000 »

Help? Also, --rebuild itself doesn't seem to be an option published in the rpm man file?

Code: Select all

[avscshop Desktop]$ sudo rpm --rebuild --target=athlon zm-1.22.3-4_20060mdk.src.rpm
--target=athlon: unknown option
[avscshop Desktop]$
jonathanbrickman0000
Posts: 8
Joined: Wed Jan 31, 2007 3:49 pm
Location: Topeka, Kansas, USA

Post by jonathanbrickman0000 »

rd, are there any other system optimizations you might recommend? There used to be kernel optimizations for heavy PCI bandwidth, and maybe other things similar. I wonder also what would happen if I switched to Gnome or XFCE. Gnome packages seem to exist for this Mandrake, but not XFCE, I imagine I would have some trouble getting that to work.
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin »

Sorry, it should be "sudo rpmbuild --rebuild ..."

I put up a athlon zm RPM at the same site if you just want to grab it.
I wonder also what would happen if I switched to Gnome or XFCE.
If you're going for performance the lightest window manager would be icewm which is installed already. Either gnome or xfce could be installed using the package manager.

You can reduce load alot by not running an X server. If you need to run the frontend on the same box I find I can reduce load by switching to mpeg streaming. Konqueror with kmplayer works better for this than firefox with mplayer-plugin. Konq doesn't do streaming mjpeg though.
jonathanbrickman0000
Posts: 8
Joined: Wed Jan 31, 2007 3:49 pm
Location: Topeka, Kansas, USA

Post by jonathanbrickman0000 »

That's astonishing, I would have thought the MPEG overhead would be highest of all. I'll hopefully have time to try it today.

It seems that my 1GHz / 0.5G RAM box is something akin to one-camera-sufficient horsepower, I'm not certain I can optimize it enough for two cameras unless I go down to 5 fps each. What do you think?
jonathanbrickman0000
Posts: 8
Joined: Wed Jan 31, 2007 3:49 pm
Location: Topeka, Kansas, USA

Post by jonathanbrickman0000 »

One more speed increase: Just updated my glibc and related libraries, automatically using urpmi (I did have to set update repository names). Cut one-camera CPU modect no-alarm from 50% to 25%. Apparently they really worked on that glibc for the updates. I might try to optimize that for athlon and see what happens.
chalo
Posts: 5
Joined: Tue Feb 13, 2007 5:05 am

Post by chalo »

Hi guys,

just to let you know, my cpu load got noticeably reduced by unchecking the ZM_CREATE_ANALYSIS_IMAGES option. I did it to reduce disk usage, but got a significant cpu load decrease as a bonus!

Regards,

Gonzalo
Post Reply