persistent settings kernel hack

Posted by: borislav

persistent settings kernel hack - 14/11/2000 03:49

Hi,

I've been working lately on a kernel hack that improves the behaviour of the player with regard to savings settings across reboots. Some earlier versions got posted in the Saving settings... thread, this one supersedes them.

The behaviour of the player is changed in the following ways:

1. Dual balance, loudness and beeps personalities. The player now remembers two different settings for these in the car and at home, similarly to the way volume is handled.

2. Preserved info setting when booting in the car. The player no longer switches to "info track" if the last setting was "info off" or "info line". No more buttons needed to get to the visuals!

3. Preserved last non-off info setting. Previously, if you select "info now&next", switch to "info off" with the bottom button, reboot (at home) and hold the bottom button again, you end up in "info track". Now you are taken to your last non-off info setting, i.e. "info now&next".

There's one side effect - some fast switching of info modes happens immediately after a reboot (and a few beeps if you have them enabled).

(Update: I've now silenced the extra beeps on reboot.)

Here are the kernel images:

mk2 kernel image
mk1 kernel image
patch against the 1.01 kernel

Refer to Tony's FAQ entry about upgrading the kernel.

A few more points:

- This is a hack. None of it really belongs in the kernel, but we don't have the source for the player, so...
- It's only supposed to work with the 1.01 version of the player (and I've only tested it on a mk2). It's virtually guaranteed to break once 1.1 is released.
- Neither empeg Ltd nor SONICblue have anything to do with this hack. It's not their fault if you crash your car while watching Funnelweb. Don't sue me, either . Please.

And let me know whether it works.

Borislav

Edited by borislav on 14/11/00 04:43 AM.

Posted by: peter

Re: persistent settings kernel hack - 14/11/2000 08:04

1. Dual balance, loudness and beeps personalities. The player now remembers two different settings for these in the car and at home, similarly to the way volume is handled.

1.1 will have this feature too...

2. Preserved info setting when booting in the car. The player no longer switches to "info track" if the last setting was "info off" or "info line". No more buttons needed to get to the visuals!

... but not this one.

3. Preserved last non-off info setting. Previously, if you select "info now&next", switch to "info off" with the bottom button, reboot (at home) and hold the bottom button again, you end up in "info track". Now you are taken to your last non-off info setting, i.e. "info now&next".

Sounds like a bug to me... I'll look into it.

Peter


Posted by: flashman

Re: persistent settings kernel hack - 14/11/2000 22:38

Bravo!!! Kudos!!!
Thanks again!!

12Gb MKII 080000516 Blue
Posted by: borislav

1.02rc1 version - 09/01/2001 03:07

I was going to wait for the final 1.02 but TeeMcBee challenged me so...

1.02rc1 mk2 kernel image
1.02rc1 mk1 kernel image

Nothing has changed from the previous version, just applied the same patch to the new kernel.

Enjoy,
Borislav

Posted by: mcomb

Re: 1.02rc1 version - 10/01/2001 15:40

Cool, how about a 1.0.2 final? While I am asking would it be possible to add Frank van Gestel's Display Server IR patch in as well?

-Mike

Posted by: borislav

Re: 1.02rc1 version - 10/01/2001 16:04

Cool, how about a 1.0.2 final?

The 1.02rc1 images I posted already include the differences between 1.02rc1 and 1.02 final (workaround for an ethernet problem), so you can use them for 1.02 final too.

While I am asking would it be possible to add Frank van Gestel's Display Server IR patch in as well?

Sure, I'll do that tonight (GMT-8)

Borislav

Posted by: borislav

1.02final + irhack - 11/01/2001 05:09

These images are based on 1.02-final and also include Frank's kernel patch for displayserver.

1.02 mk2 kernel image
1.02 mk1 kernel image

Borislav


Posted by: mcomb

Re: 1.02final + irhack - 11/01/2001 12:47

Thanks! -Mike

Posted by: mcomb

Re: 1.02final + irhack - 11/01/2001 23:25

Hmmm, my empeg did not like that at all. With a nice fresh 1.02 Dev install I installed your MK2 kernel using Tony's logoedit downloader and the empeg hangs immediately after booting. I will give it another shot with empeg's download.c under FreeBSD in a minute and see if it makes a difference. Here is the serial output I am getting...

empeg-car bootstrap v1.00 20000601 ([email protected])
If there is anyone present who wants to upgrade the flash, let them speak now,
or forever hold their peace...it seems not. Let fly the Penguins of Linux!

e000 v1.03
Copying kernel...
Calling linux kernel...
(data abort vector)

Posted by: mcomb

Re: 1.02final + irhack - 11/01/2001 23:43

Guess that is what a get for trying to do something under windows. A fresh download of your kernel from FreeBSD and an upload with download.c and everything is happy again.

-Mike

Posted by: flashman

Re: 1.02final + irhack - 12/01/2001 00:00

Thanks again for the upload....
I can't seem to bring up the display server in explorer.
All I am doing is entering the players IP in Explorer.
Java console is enabled. All I get is "The page cannot be displayed" and explorer has "res://c:\win98\system\SHDOCLC.DLL/dnserror.htm#http://115.105.15.15/"
Any clues?
Am I missing a step?

12Gb MKII 080000516 Blue
Posted by: borislav

Re: 1.02final + irhack - 12/01/2001 00:50

I can't seem to bring up the display server in explorer. All I am doing is entering the players IP in Explorer. Java console is enabled. All I get is "The page cannot be displayed" and explorer has "res://c:\win98\system\SHDOCLC.DLL/dnserror.htm#http://115.105.15.15/"

I tried that just now and it works as expected (with explorer, entering the IP address on a fresh install of 1.02 + my kernel image + displayserver). No idea what's going wrong, hopefully Frank or somebody more familiar with Windows can provide some insights.

Borislav


Posted by: fvgestel

Re: 1.02final + irhack - 12/01/2001 08:36

> I can't seem to bring up the display server in explorer. All I am doing is entering the players IP in Explorer. Java console is enabled.
> All I get is "The page cannot be displayed" and explorer
> has "res://c:\win98\system\SHDOCLC.DLL/dnserror.htm#http://115.105.15.15/"

It sounds like displayserver isn't running...
You can test by using windows telnet :
host name : empeg-ip
port : 80
If it can connect, displayserver is running.
set "local echo" to yes in terminal options and enter the following in the telnet window :

GET / HTTP/1.0

and press "enter" twice.
You should see some HTML-stuff come by in the telnet window
When you initially installed displayserver, it was probably installed under /usr/local/displayserver, which was overwritten by the 1.02 upgrade.
Did you reinstall displayserver?


Frank van Gestel
Posted by: flashman

Re: 1.02final + irhack - 12/01/2001 08:52

Ok I may in fact be missing somthing... I do not think my problem is related to windows as
you mention "a fresh install of 1.02 + my kernel image + displayserver" I also have a fresh install of 1.02 + your kernel image but I do not have displayserver" I thought all I needed was just the 1.02 image and your kernel image, Where is the display server piece??
Sorry for my ignorance.

12Gb MKII 080000516 Blue
Posted by: fvgestel

Re: 1.02final + irhack - 12/01/2001 11:38

In reply to:

"res://c:\win98\system\SHDOCLC.DLL/dnserror.htm#http://115.105.15.15/"



In reply to:

somebody more familiar with Windows can provide some insights



I suspect Microsoft would be telling the user to call their sysadmin for a "Major DNS-problem on IP 115.105.15.15" hehe...

Frank van Gestel
Posted by: tfabris

Re: 1.02final + irhack - 12/01/2001 12:38

I'm concerned that my windows program failed to send the kernel properly. I haven't had anyone report any issues with it that made a kernel fail, assuming it was a good kernel file and the COM port was working right.

Did it show a big "happy face" symbol at the end of the download, but it failed anyway?

Also, sometimes there are issues with downloaded files- did you by any chance try to send it the gzipped version of the file without unzipping it first? (I dunno, linux might automatically unzip the file for you whereas windows doesn't?) Or perhaps the file got downloaded in ascii mode instead of binary or something?

___________
Tony Fabris
Posted by: BillB

Re: 1.02final + irhack - 12/01/2001 14:41

FWIW - I tried to download a custom kernel the other night, and had an identical error upon reboot. I assumed it was a problem with my kernel, but...

And, for the record, I got a smiley after download.


Bill B.
Mk.2 SN 080000183 - 38 GB /
Green
Posted by: tfabris

Re: 1.02final + irhack - 12/01/2001 15:21

Can you report anything else that might help me?

For example, have you been able to properly send kernels to the Empeg in the past, or is this your first time?

If it is your first time, can you get Hyperterminal to talk to the Empeg OK on that COM port?

If it has worked in the past, can you try some different kernel files and see if it works for some but not for others?

___________
Tony Fabris
Posted by: borislav

Re: 1.02final + irhack - 12/01/2001 20:36

I also have a fresh install of 1.02 + your kernel image but I do not have displayserver" I thought all I needed was just the 1.02 image and your kernel image

That must be it. There are several parts to displayserver, the kernel image is only one of them (I'm just providing a substitute for this part that also includes the hack for the visuals). You can find the rest and instructions for installing it from Frank's page. I remember more detailed installation instructions posted on the BBS but I can't find them.

Borislav


Posted by: flashman

Re: 1.02final + irhack - 13/01/2001 01:13

Thanks....
Ill get to work on setting it up soon.
Aside from that issue I am still sort of concerned somewhat due to the other side of things: "persistant Settings" is not working either. I can not get the unit to keep visuals comming up after power cycles.
I also used Mr. tfabris's Logo edit program to load the image on top of 1.02 developer - Got smiley face too.. Are there any other kernal download methods are available for us windows users??
I know Im doing this right because it used to work for me in 1.01

Thanks for your time and help.

12Gb MKII 080000516 Blue
Posted by: mcomb

Re: 1.02final + irhack - 13/01/2001 01:13

The kernels that Borislav posted where not gzipped so that is not the problem. My guess is that Netscape under windows translated the line feeds in the kernel file (downloaded it as ascii) which Netscape under unix did not do. I did get the smiley face from your program and I could connect fine on com1 via hyperterminal. I don't normally run windows (I just happened to be running it at the time so I thought I would try your program) so I am not sure what Netscape's default behavior for things like this is. In short, I am more that willing to blame it on windows or Netscape if no one else has seen this problem with your program. Would it be possible for your program to verify the kernel file before uploading it? If you wanted to try you could duplicate some of the functionality of the unix 'file' program to verify that it is a kernel file before uploading. Probably more trouble that it is worth though. -Mike

Posted by: borislav

Re: 1.02final + irhack - 13/01/2001 01:31

I can not get the unit to keep visuals comming up after power cycles.

It should come up with the setting it was on when you shut it down (hence persistant). Have you tried this in the car? Pull it out with visuals on, insert it again, it should switch the visuals on immediately after boot.

To test it at home, go to "now&next", then hold the bottom button to turn visuals on. Power cycle. Hold down the bottom button again. Without my patch you end up in "info track", with it you get "now&next".

Borislav

Posted by: borislav

Re: 1.02final + irhack - 13/01/2001 01:35

The kernels that Borislav posted where not gzipped so that is not the problem.

Maybe I should gzip them in the future. They don't compress much but if they uncompress at all you can be pretty certain they were not corrupted in transit.

Borislav

Posted by: mcomb

Re: 1.02final + irhack - 13/01/2001 01:53

Then you may run into a problem that I have had in the past where Netscape under linux tries to uncompress the file for you and mangles it in the process. -Mike

Posted by: borislav

Re: 1.02final + irhack - 13/01/2001 01:58

Then you may run into a problem that I have had in the past where Netscape under linux tries to uncompress the file for you and mangles it in the process.

True - that's an old favourite. I've never seen it actually mangle files, usually it just uncompresses them but leaves the .gz on. Mildly confusing, these days I'm trained to watch for it.

Borislav

Posted by: tfabris

Re: 1.02final + irhack - 13/01/2001 11:58

My guess is that Netscape under windows translated the line feeds in the kernel file (downloaded it as ascii) which Netscape under unix did not do.

In my first attempts at installing RJLov's volume adjustment kernel, that is precisely what happened to me. I made Richard PKZip the files to solve the problem.

Although Linux users might not like the extra step involved in having to unzip the files, it does guarantee (on all platforms) that the file won't be corrupted by downloading issues. If the file can be unzipped, then you know for sure that it is byte-for-byte what the sender intended it to be.

Would it be possible for your program to verify the kernel file before uploading it?

Yes, if there was some way to scan the file for certain bytes to verify its integrity. However, since it's basically just a compiled ARM executable, and all executables can be different (everyone compiles their own code in, that's the point of a replaceable kernel), I'd guess that this would be very difficult.

Does anyone have any idea how I might go about scanning the kernel file to verify its integrity? I know nothing about this unix "file" program that was mentioned.

___________
Tony Fabris
Posted by: bonzi

Re: 1.02final + irhack - 13/01/2001 18:15

Does anyone have any idea how I might go about scanning the kernel file to verify its integrity? I know nothing about this unix "file" program that was mentioned.

File command does not generaly help detect corrupted files. It just inspects file content for known file type 'signature' at fixed location as described in its configuration file appropriatelly called 'magic' (generally near the beginning of the file - for example, MPEG audio stream files are supposed to have the first twelve bits 1).

Short of introducing checksums (as, for example, guys at SETI@home do), your method of zipping is about best that can be done.

Cheers!

Dragi "Bonzi" Raos
Zagreb, Croatia
Q#5196, MkII#80000376, 18GB green
Posted by: mcomb

Re: 1.02final + irhack - 14/01/2001 03:30

File command does not generaly help detect corrupted files. Right, but if it tells you that it is a kernel image at least you know that it is not still gzipped and that the user did not accidentally select the wrong file. -Mike

Posted by: bonzi

Re: 1.02final + irhack - 14/01/2001 03:47

File command does not generaly help detect corrupted files.
Right, but if it tells you that it is a kernel image at least you know that it is not still gzipped and that the user did not accidentally select the wrong file. -Mike


Ah, the Unix version of uploading utility could check whether the file is in some of several compressed formats, call apropriate decompressor, perhaps check whether the result is indeed executable with correct magic... I haven't thought of that.

Which reminds me: it would be nice to incorporate an option in the file command to check whether every occurence of LF is preceded by CR (in the whole file or reasonably long first part of it), and, if magic otherwise points to binary file, warns of possible ftp corruption.

Actually, uploader could do that check, following the check for the correct magic (note for non-unixers: magic is nothing more than few bytes of signature - characteristic content - the file command uses to recognise.file types).

Cheers!

Dragi "Bonzi" Raos
Zagreb, Croatia
Q#5196, MkII#80000376, 18GB green
Posted by: borislav

Re: 1.02final + irhack - 19/01/2001 23:00

Aside from that issue I am still sort of concerned somewhat due to the other side of things: "persistant Settings" is not working either.

Did you get this to work in the end? If there's a bug there then it needs fixing...

Borislav

Posted by: flashman

Re: 1.02final + irhack - 23/01/2001 13:08

Sorry for the late reply.... life interrupted (life does that)
Anyhow, no I was not able to get this to work any longer since 1.02. I gave it a shot again last night.
1st = loaded 1.02 developer from empegs site self exe. went fine.
2nd = loaded your latest build using the latest Tfabris logo editor.. got smiley face and all looked ok as it did before when all of this used to work for me.
3rd = booted player in car, held down button to display funnelweb and then removed and reinserted the player.
the player acts just as nothing has changed, boots but back to info mode as before.
I should also mention that this exact same method worked for me before so i don't think there is an issue with the downloaded file but more of an issue with my player.

What can I get to you to help debug?
Is there something I can check for you internally using terminal server?
I understand what I was missing before with the Displyserver stuff so I will try to install that again but I hoped the graphics persistant settings would keep working. *sigh*

Thanks for all you help. it is most appreciated.

12Gb MKII 080000516 Blue
Posted by: borislav

Re: 1.02final + irhack - 24/01/2001 03:51

life interrupted (life does that)

Life always gets in the way, annoying that.

What can I get to you to help debug? Is there something I can check for you internally using terminal server?

Not that I don't trust Tony's editor, but it's easiest to eliminate that first - check whether it's really running my kernel.

Connect the serial cable, run HyperTerminal, set to "Direct to Com1(or Com2)", 115200 bits per second, no parity, 1 stop bit, flow control none. Power cycle the player, you should see lots of stuff scroll by. Near the beginning there will be a line that says "Linux version 2.2.14-rmk5-np17-empeg41 (borislav@aero) ...". If it's not my kernel it'll say something else instead of "borislav@aero".

If it is my kernel I'll have to send you an image with more debugging output to figure out why it's not doing anything.

Borislav


Posted by: fvgestel

Re: 1.02final + irhack - 24/01/2001 05:18


3rd = booted player in car, held down button to display funnelweb and then removed and reinserted the player.


AFAIK, the player doesn't store it's settings when it's removed from the sled while playing. It should be set in standby mode first by switching off the ignition.



Frank van Gestel
Posted by: flashman

Re: 1.02final + irhack - 24/01/2001 19:52

Ok it appears that your kernel is installed. I included the entire boot log with this reply.
I also tried every concieveable boot combination i could think of. It's having troubles... still no persistant settings. everything else seems ok.

Thanks again for your assistance.
Note:
The only problem I ever had with my player was the disk full issue that prevented me from syncing.
that post is under bug reports as "EEK 1.02rc1 Stage 5 error "
(sorry i don't know how to link posts.)
not sure if this is even related but I thought I would include the info.

12Gb MKII 080000516 Blue
Posted by: borislav

Re: 1.02final + irhack - 24/01/2001 22:02

AFAIK, the player doesn't store it's settings when it's removed from the sled while playing. It should be set in standby mode first by switching off the ignition.

I believe it stores the settings at least every time you change the info mode, which is the only thing I care about in this case.

Borislav

Posted by: tanstaafl.

Re: 1.02final + irhack - 25/01/2001 15:43

(sorry i don't know how to link posts.)

Aaahhh... finally a technical question I know how to answer!

When you reply to a post, look in the upper right area of your screen and you will see a highlighted phrase "markup in your posts". Click on this, and you will go to a page that gives clear and simple instructions for adding 's and the like, and also how to bold, italicise etc, set links to other posts, use different color text, and so forth.

Tony Fabris had to show me how to do these things, so you're not the only one who didn't know.

tanstaafl.

"There Ain't No Such Thing As A Free Lunch"
Posted by: flashman

Re: 1.02final + irhack - 25/01/2001 22:36

so you're not the only one who didn't know....

I do now!
Thanks!!


12Gb MKII 080000516 Blue
Posted by: flashman

Re: 1.02final + irhack - 25/01/2001 23:06

Observed new behavior…
I’ve seen this at least three times now….
#1 start vehicle and player comes up as Info mode.
#2 hold the down button to get visuals (funnel web).
#3 “strange part” After one or two songs completes, in the middle of the next song, it looks as if it processes a some kind of script (to fast to read) and then flips back to Info mode.
#4 Puzzled, and making sure I’m not nuts, I hold the down button again to get visuals back.
#5 Player stays in visuals and no longer acts up. (at least for several hours)

So, it seems like as if your script is running late, or seems out of sync as I have noticed the script like behavior before at boot when persistant settings used to work for me.
Does that help any?
Thanks

12Gb MKII 080000516 Blue
Posted by: borislav

Re: 1.02final + irhack - 25/01/2001 23:47

So, it seems like as if your script is running late, or seems out of sync as I have noticed the script like behavior before at boot when persistant settings used to work for me. Does that help any?

Yes, it does. Sounds like whatever I'm using to detect that the player has fully started is triggering way late.

I haven't forgotten about sending you a debugging kernel, just busy. I should get around to it tomorrow, please bear with me a bit longer.

Borislav

Posted by: flashman

Re: 1.02final + irhack - 26/01/2001 18:16

No worries....
Take your time....
I just think it's really cool how this Whole Empeg community helps one another.
Just glad that I can participate.

12Gb MKII 080000516 Blue
Posted by: flashman

Re: 1.02final + irhack - 30/01/2001 22:03

New Log...

12Gb MKII 080000516 Blue
Posted by: borislav

1.03 final - 25/06/2001 00:31

A version of the persistant settings patch for 1.03 final is now available. This version fixes a bug in the previous patch that prevented it from working correctly with songs which don't have the Artist field set.

Patch and kernel images are on sourceforge. The other patches included in these images are 1disk (no changes needed since 1.02) and Frank's ir_trans patch. When a voladj patch for 1.03 surfaces I'll compile images with it too.

Have fun,
Borislav


Posted by: mcomb

Re: persistent settings kernel hack - 28/10/2001 00:35

Borislav, have you had a chance to update this for 2.0b3? It looks like some of the kernel ir code has been moved around and the old patch does not apply cleanly. I mis this "functionality".

-Mike
Posted by: charcoalgray99

Re: persistent settings kernel hack - 28/10/2001 00:46

I'll second this request :)

Tom
Posted by: borislav

Re: persistent settings kernel hack - 28/10/2001 02:41

Borislav, have you had a chance to update this for 2.0b3?

No, and I probably won't get a chance for another 2-3 weeks (currently on a business trip and I'll be neck deep in work after I go back). I'm also hoping there'll be another beta out by the time I try to update this hack since the behaviour of info modes across reboots in 2.0b3 is somewhat bizarre.

Borislav
Posted by: smu

Re: persistent settings kernel hack - 17/02/2002 14:23

Hi Borislav.

How did you do this patch for 1.03 back then? I seem to recall it had something to do with the partially linked binary of the player itself. Or am I confusing something here?

cu,
sven
Posted by: borislav

Re: persistent settings kernel hack - 17/02/2002 23:36

How did you do this patch for 1.03 back then? I seem to recall it had something to do with the partially linked binary of the player itself. Or am I confusing something here?

No, it was a kernel patch only. It tapped into a bunch of different drivers:

- the power driver, to figure out if we in the car
- the state driver, to read the last info setting
- the display driver, to figure out when the player has started up
- the input driver, to feed initial button codes to the player

Regardless of the initial info setting, the kernel patch changes it to
'info track' (when in the car). Then it starts waiting for the player to
start, looking for the big horizontal line in the 'info track' mode (on
each screen update in the display driver). When it sees that line, it sticks
a few button presses in the buffer of the input driver.

This is from memory, let me know if you need more details and I'll look at the
patch. I haven't looked at the 2.0 kernels at all, some things have probably
changed since 1.03.

Borislav