temperature sensor

Posted by: BleachLPB

temperature sensor - 01/11/2001 11:07

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.
Posted by: tfabris

Re: temperature sensor - 01/11/2001 11:18

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.
Posted by: mlord

Re: temperature sensor - 01/11/2001 18:47

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
Posted by: tonyc

Re: temperature sensor - 01/11/2001 18:50

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#
Posted by: mlord

Re: temperature sensor - 01/11/2001 18:52

Perfect. Thank-you.

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

-ml
Posted by: tfabris

Re: temperature sensor - 01/11/2001 18:55

Make sure to have it do a centigrade to fahrenheit conversion on the same screen (show both).
Posted by: mlord

Re: temperature sensor - 01/11/2001 19:48

Okay, I suppose the USA folk might need the Fahrenheit conversion.. I'll stick it in right now.
Posted by: mlord

Re: temperature sensor - 01/11/2001 19:58

Okay, v20 is up on my site. With degrees F as well as C, and some extras..
Posted by: tfabris

Re: temperature sensor - 01/11/2001 20:04

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?
Posted by: tfabris

Re: temperature sensor - 01/11/2001 20:07

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.
Posted by: mlord

Re: temperature sensor - 01/11/2001 20:16

Ooops.. v20 broke something.. likely running too long with interrupts masked.

Working on v21 now..
Posted by: mlord

Re: temperature sensor - 01/11/2001 20:20

Zads.. silly me. I generally work in degrees C all the time, so did a silly conversion first try.
Posted by: tfabris

Re: temperature sensor - 01/11/2001 20:33

Goodness, it's been 15 minutes, where's the new version?
Posted by: mlord

Re: temperature sensor - 01/11/2001 20:41

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
Posted by: mlord

Re: temperature sensor - 01/11/2001 20:53

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
Posted by: tonyc

Re: temperature sensor - 01/11/2001 21:22

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?
Posted by: mlord

Re: temperature sensor - 01/11/2001 22:08

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
Posted by: tonyc

Re: temperature sensor - 01/11/2001 22:19

patch --reverse works perfect. How I missed that in the man page is beyond me.
Posted by: Terminator

Re: temperature sensor - 01/11/2001 23:48

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
Posted by: altman

Re: temperature sensor - 02/11/2001 04:41

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...)
Posted by: mlord

Re: temperature sensor - 02/11/2001 08:23

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
Posted by: altman

Re: temperature sensor - 02/11/2001 09:16

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
Posted by: BleachLPB

Re: temperature sensor - 02/11/2001 13:05

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.
Posted by: Diznario

Another Temperature Idea... - 02/11/2001 18:54

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...
Posted by: Diznario

Re: Another Temperature Idea... - 02/11/2001 19:07

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.