zoneminder mixing up my sources

Support and queries relating to all previous versions of ZoneMinder
mdaughtrey
Posts: 32
Joined: Sat Sep 17, 2005 4:10 pm

Post by mdaughtrey »

Friends, the mistake is mine.

Turns out I had entered the shared memory id as 0x7a6d200e instead of the default 0x7a6d2000. The zmc modules create their shared memory id by ORing their monitor id with the key. Problem is that the result of that ORing is the same for more than one module for example 0x0e | 0xc = 0x0e, and 0x0e | 0x0a also = 0x0e. So, some of my zmc modules were sharing the same shared memory, which is why my sources were getting mixed up.

Phil/Cordel, I would suggest that this is a piece of code that could be made a little more robust, perhaps by masking off those lower 8 bits before the OR.

Anyway, we found a bug along the way, and I'm happy to have this system running at long last.
Thanks for your help (you too, James).
Matt
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Glad to hear it Matt and thank you for the report, I can finally stop beating my head in since I was not able to reproduce it. Now I may be able to but don't see the need for the moment. I'm sure it will get handled correctly by Phil. I just wish that it may have been found earlier as I didn't even think to ask about the shared key, my bad.
Again thank you for all your time into this and the final report.
Regards,
Cordel
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Aaaah! It all fits now. The shared memory key is one of those things that was made configurable but that I really never expected anyone to ever change ( :lol: ). I will add a comment to the docs to the effect of only changing the top bytes and also add a mask as you have suggested. Thanks for letting us know the solution.

Phil
Locked