Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#153843 - 07/04/2003 16:50 Regarding /proc 'files'..
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
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.


Edited by foxtrot_xray (07/04/2003 16:51)
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#153844 - 07/04/2003 17:05 Re: Regarding /proc 'files'.. [Re: foxtrot_xray]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
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.
_________________________
Tony Fabris

Top
#153845 - 07/04/2003 17:13 Re: Regarding /proc 'files'.. [Re: foxtrot_xray]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
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

Top
#153846 - 07/04/2003 17:15 Re: Regarding /proc 'files'.. [Re: foxtrot_xray]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
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


Edited by tman (07/04/2003 17:25)

Top
#153847 - 07/04/2003 17:17 Re: Regarding /proc 'files'.. [Re: tman]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia

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.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#153848 - 07/04/2003 17:27 Re: Regarding /proc 'files'.. [Re: foxtrot_xray]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
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

Top
#153849 - 07/04/2003 17:38 Re: Regarding /proc 'files'.. [Re: tfabris]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia

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.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top