Regarding /proc 'files'..

Posted by: foxtrot_xray

Regarding /proc 'files'.. - 07/04/2003 16:50

Hey guys.. I'm asking this in anticipation for working on the program side to my External VFD project.. Pardon if they're rather dumb questions, I'm not that hevily trained in C.

First I'm going to be just parsing /proc/empeg_notify, more than likely to just get the FID, and then pull MP3 tags from the file directly. My first question is this: Since it's a proc file, when is the date/time updated for the file? Whenever data in it is changed? Or does it always have the 'current' date/time?
I don't want to go into a infinte loop, re-reading the same data over and over, just waiting for the FID to change (suck up way too much cpu time.) I thought about looping just to check the date/time (again, slowing it down so it dosn't suck up CPU..), waiting to see when it changes, and then when it does, re-parse the FID. But somehow I don't think that will work.

Second question, is there a /proc file (or maybe some hijack function I can call?) that will tell me the status of the headlight sence?

Gratzi!
Me.
Posted by: tfabris

Re: Regarding /proc 'files'.. - 07/04/2003 17:05

more than likely to just get the FID, and then pull MP3 tags from the file directly.
If possible, if you don't REALLY need to read the tags, then proc/notify is better. Reason: Drives don't have to spin up in order for you to read proc/notify.
Posted by: tman

Re: Regarding /proc 'files'.. - 07/04/2003 17:13

All of the timestamps should be whatever the current time is according to the empeg.
Read /proc/empeg_power for the headlight sense line.

- Trevor
Posted by: tman

Re: Regarding /proc 'files'.. - 07/04/2003 17:15

Oh yeah. One more thing. Since the FID should[edit]n't[/edit] change more than once a second you don't need to check it that often.
Once or twice a second is sufficient and you just sleep for the rest of the time.

- Trevor
Posted by: foxtrot_xray

Re: Regarding /proc 'files'.. - 07/04/2003 17:17


Oh yeah. One more thing. Since the FID should change more than once a second you don't need to check it that often.
Once or twice a second is sufficient and you just sleep for the rest of the time.


Uhm.. I think you mean once every 3 seconds?

But yeah, i was just using the one second for an example..

Thanks!
Me.
Posted by: tman

Re: Regarding /proc 'files'.. - 07/04/2003 17:27

Ick. Edited my post to include the missing "n't" after "the FID should"
I don't think there is any way of making the player application or Hijack notify you when something changes without just continaully looking at the empeg_notify file. I guess Mark could make it so that you'd get a signal from the kernel...

- Trevor
Posted by: foxtrot_xray

Re: Regarding /proc 'files'.. - 07/04/2003 17:38


If possible, if you don't REALLY need to read the tags, then proc/notify is better. Reason: Drives don't have to spin up in order for you to read proc/notify.

Good point. I was going to originally read everything from the empeg_notify, but thought that people might want to put in other tags, not kept in there. For starters, I will probably just read from empeg_notify.

Thanks.
Me.