Unoffical empeg BBS

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

Topic Options
#44534 - 01/11/2001 11:07 temperature sensor
BleachLPB
enthusiast

Registered: 01/11/2001
Posts: 354
Loc: Maryland
Has anyone tried writing any software for the player that makes use of the teperature diode? It would be cool to bring up the current temperature the diode is reading on the display.
_________________________
BleachLPB ------------- NewFace MK2a

Top
#44535 - 01/11/2001 11:18 Re: temperature sensor [Re: BleachLPB]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
Displayserver will show the sensor value on one of its pages.

I also once saw a screen shot of an info program which showed certain values on the player display including the temperature. I don't remember who did this.

As I understand it, it's very simple to implement, you just read the value from a device.
_________________________
Tony Fabris

Top
#44536 - 01/11/2001 18:47 Re: temperature sensor [Re: BleachLPB]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Send me a pointer to where I can read about the programming interface, and I'll add a temperature screen to my "userland" menu system.

-ml

Top
#44537 - 01/11/2001 18:50 Re: temperature sensor [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
I dunno about the internal interface, but the proc filesystem has an entry /proc/empeg_therm:

*shell on ttyS1*
empeg:/usr/local/bin# cat /proc/empeg_therm
27
empeg:/usr/local/bin#
_________________________
- Tony C
my empeg stuff

Top
#44538 - 01/11/2001 18:52 Re: temperature sensor [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Perfect. Thank-you.

I'll have a temperature screen up in v20 shortly.

-ml

Top
#44539 - 01/11/2001 18:55 Re: temperature sensor [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
Make sure to have it do a centigrade to fahrenheit conversion on the same screen (show both).
_________________________
Tony Fabris

Top
#44540 - 01/11/2001 19:48 Re: temperature sensor [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Okay, I suppose the USA folk might need the Fahrenheit conversion.. I'll stick it in right now.

Top
#44541 - 01/11/2001 19:58 Re: temperature sensor [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Okay, v20 is up on my site. With degrees F as well as C, and some extras..

Top
#44542 - 01/11/2001 20:04 Re: temperature sensor [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
VERY NICE.

But I think you C-F conversion is off. Mine is reading 44c/125f. According to a different conversion program I have on the PC, 44c is 111.2f.

Anyone?
_________________________
Tony Fabris

Top
#44543 - 01/11/2001 20:07 Re: temperature sensor [Re: tfabris]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
Also, my player crashed (stopped playing in the middle of a song and stopped responding to input) when the Vital Signs screen was up for a while.
_________________________
Tony Fabris

Top
#44544 - 01/11/2001 20:16 Re: temperature sensor [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Ooops.. v20 broke something.. likely running too long with interrupts masked.

Working on v21 now..

Top
#44545 - 01/11/2001 20:20 Re: temperature sensor [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Zads.. silly me. I generally work in degrees C all the time, so did a silly conversion first try.

Top
#44546 - 01/11/2001 20:33 Re: temperature sensor [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
Goodness, it's been 15 minutes, where's the new version?
_________________________
Tony Fabris

Top
#44547 - 01/11/2001 20:41 Re: temperature sensor [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Mmm.. there appears to be an issue with the Empeg-supplied "empeg_readtherm()" function..
It doesn't always seem to return!! That's the source of the lockups.

I suppose one could verify that by running these shell commands on a functioning empeg player
(the player s/w has to also be running, though..):

while ( cat /proc/empeg_therm ) ; do sleep 1; done

That should produce the same lockup, I suppose.

Oh well, I guess I'll have to remove it again.

-ml

Top
#44548 - 01/11/2001 20:53 Re: temperature sensor [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Well, v21 is up now, sans Temperature. I left the code in place for it, but with an "#if 0" around it. The empeg_readtherm() function (assembly code) seems to regularly lock up the machine; infinite loop or something I guess. If anyone can read ARM assembly, please have a look at it (arch/arm/special/empeg_therm.S).

-ml

Top
#44549 - 01/11/2001 21:22 Re: temperature sensor [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Real stupid question. How do I "diff diffs"? That is, if I have patches for, say, v20 and v21, how do I make a patch to update my v20 kernel tree to v21? The diffs are both from clean v2.0b3 installations. Right now what I do is copy in the original files manually to apply the diff, but since I also add in some of my own patches to empeg_input.c and empeg_audio.c, this is a bit of a pain to do each time. Can I do some kind processing with two consecutive patches to make an incremental patch?
_________________________
- Tony C
my empeg stuff

Top
#44550 - 01/11/2001 22:08 Re: temperature sensor [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Mmm.. the only way I know to get incremental diffs would be to apply each separately to pristine source trees, and then diff the two source trees, producing the desired incremental patch. Then you could apply the incremental to your (third) master tree on top of prior patches.

Or, use "patch --reverse" to remove the old patch (eg. v20), and then apply the new one (eg. v22) to your custom tree. That might be simpler for you.

I currently don't supply incremental patches for my stuff, which would otherwise be the best solution.

-ml

Top
#44551 - 01/11/2001 22:19 Re: temperature sensor [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
patch --reverse works perfect. How I missed that in the man page is beyond me.
_________________________
- Tony C
my empeg stuff

Top
#44552 - 01/11/2001 23:48 Re: temperature sensor [Re: mlord]
Terminator
old hand

Registered: 12/01/2000
Posts: 1079
Loc: Dallas, TX
Thanks for the patch, this menu is starting to look pretty slick! Its cool to be able to hear and see the results of the different auto adjust settings. The screen blanker is awesome idea, sometimes at work I will come to the end of a playlist and I'll be too busy to put something else on right away.

Hmm looks like im an addict now. Maybe I spend too much time reading this board.

Sean


Edited by Terminator (01/11/2001 23:50)

Top
#44553 - 02/11/2001 04:41 Re: temperature sensor [Re: mlord]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
It should disable interrupts around the thermometer reading - not sure if the production code actually does at the moment (it's fixed here, though). The device requires very tight (~20us or so) timings on the 1-wire serial bus otherwise things can go screwy.

You shouldn't read it too often - no more than once every few seconds too. It's not a fast device...

Hugo
(who can't work out why he didn't just use an LM77...)

Top
#44554 - 02/11/2001 08:23 Re: temperature sensor [Re: altman]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
I think I found the bug in empeg_therm.S.

All of the loops inside those assembly routines are very careful to do "blt" when comparing timers while waiting for things.. all loops except one, that is. It uses "bne" instead, and if it gets "lucky" it may miss the timer roll-over. So I have changed it to "blt" like the others, and we'll see if that fixes the problem (appears to for me, anyway).

If it remains stable here, I'll grind out v23 of my patches shortly, with the thermometer reading reinstated.

-ml

Top
#44555 - 02/11/2001 09:16 Re: temperature sensor [Re: mlord]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
Good catch! Didn't see that. Strange that it misses it, though, as nothing should interrupt the code and it's running ~60 cpu cycles per clock tick!

Looking at it, I'm only doing a save_flags_cli, it should be save_flags_clif (FITNR). FIQs are used for the CS4231, which means reading the temperature may fail on v2 when in AUX/radio mode.

Basically, if the timings go out nasty things might happen - worst-case is writing to the config register in the chip which makes it enter thermometer mode...

Hugo

Top
#44556 - 02/11/2001 13:05 Re: temperature sensor [Re: altman]
BleachLPB
enthusiast

Registered: 01/11/2001
Posts: 354
Loc: Maryland
Hey thanks for the response!! This kicks ass. I knew the temperature thing could be done just didn't know it was that easy. . This player rocks.. I haven't gotten into programming stuff for it yet but stand to learn a few things about it. This player obviously has a lot of flexibility.

mlord: v23 is warming up on my player right now.

I don't miss lugging cds to my car and fumbling with changing them when driving.

Thanks again.
_________________________
BleachLPB ------------- NewFace MK2a

Top
#44557 - 02/11/2001 18:54 Another Temperature Idea... [Re: BleachLPB]
Diznario
enthusiast

Registered: 17/10/2001
Posts: 265
Loc: Portland OR
This may be at least partially implemented in the unit allready, but in case it isn't...

MLord,
Since you can check the temperature now, what about giving us a warning message if it gets too hot? Or, make the unit shut down?

The fact that the unit even has a temp sensor in it hints to this ability, but alas, one can never be too sure...

Enter bad joke about clock here

So, the hardware is there, but maybe not the software?

Just a thought...


Edited by Diznario (02/11/2001 18:55)
_________________________
Dario
MK2 in an Impreza 2.5RS

Top
#44558 - 02/11/2001 19:07 Re: Another Temperature Idea... [Re: Diznario]
Diznario
enthusiast

Registered: 17/10/2001
Posts: 265
Loc: Portland OR
OK, So I read around the board a little more, and Voila! The Temp Sense v2 thread!

So, it looks like you're already on it...

You guys are just tooo good at this.
_________________________
Dario
MK2 in an Impreza 2.5RS

Top