Hack the volume

Posted by: EmpegRulz

Hack the volume - 09/12/2000 05:18

(newbie alert) I have the production 1.01 code in my Mk. II and have done a custom install into my Mountaineer. In addition to the empeg, I installed the latest Kenwood head that also responds to the included credit card IR controller. Great! One IR for both units. When the Kenwood is in AUX mode (where I plugged in the empeg), everthing is cool except that both want to respond to the volume control. Is there someone that can hack the code so that the empeg no longer responds to the IR volume commands? Better yet, has anyone put together a mini-HOWTO on what to download and put where to compile the software? I'm used to Slackware and run a couple servers here in the house and am not afraid to tweak them. This, I want to know I've done it right the first time.
Thanks for any and all input.
John

Posted by: MarkM

Re: Hack the volume - 11/12/2000 17:21

I have instructions from Hugo for this very thing. When it's finished, I'll post it some place easily accessible. If you're a programmer, here is a copy of what Hugo suggested (keep in mind that this should work in theory and has not been tested) BTW - If someone hacks the volume first, then I'd love to receive your copy of the kernel via email. :)

The hack:

File: arch/arm/special/empeg_audio2.c (I think).

Easiest way is to simply patch mixer_setvolume() to use volume 90 (this is
100% - 100 is 10db gain) at all times. Probably best to do it like this:

dsp_write(Y_VAT,volume_table[90 /* was vol */ ].vat);
dsp_write(Y_VGA,volume_table[90 /* was vol */ ].vga);

...and not actually change the value stored in dev->volume otherwise it may confuse the player. Actually, I'm pretty sure it reads back, so the volume control might just work correctly, but be "stuck" at 100%.


Posted by: mac

Re: Hack the volume - 22/12/2000 10:45

Alternatively you could hack the IR driver so that it swallows the volume up and volume down codes sent by the remote (b914 and b915). This has the benefit of keeping volume available through the rotary control and menu.

--
Mike Crowe
I may not be speaking on behalf of empeg above :-)
Posted by: MarkM

Re: Hack the volume - 02/01/2001 12:40

I would love to have the IR for the volume and AUX input disabled. We are using Kenwood head units.

If someone can supply a kernel with these mods, let me know. Also, if you have the ability and want to offer this kernel mod at a price, please contact me.

Thanks

Mark

Posted by: tfabris

Re: Hack the volume - 02/01/2001 17:28

If someone can supply a kernel with these mods, let me know. Also, if you have the ability and want to offer this kernel mod at a price, please contact me.

Well, the kernel is open-source, so price probably isn't much of an issue...

___________
Tony Fabris
Posted by: MarkM

Re: Hack the volume - 02/01/2001 22:26

Hi Tony,

I realize the kernel is open-source. My challenge has been getting the dev environment set up and finding a programmer willing to spend some time with it. (I'm not a programmer) :)

Please send me an email if you're interested in making a few mods at an hourly rate or priced per project.

Thanks

Mark
[email protected]


Posted by: MarkM

Re: Hack the volume - 05/01/2001 16:34

Ok, the volume has been hacked. Now we're in the process of trying to figure out how to defeat the AUX IR (tape button on Kenwood remote).

Does anyone know the file where this lives???

BTW - I'll post the zimage when it's finished.

Posted by: tfabris

Re: Hack the volume - 05/01/2001 18:48

I'll post the zimage when it's finished.

And the source code changes, too, I hope, seeing as how you're required by the license to do so (IIRC).


Now we're in the process of trying to figure out how to defeat the AUX IR (tape button on Kenwood remote).

If you need a hint, have a poke around Frank Van Gestel's source code, he's done some hacking to the IR stuff for his Displayserver applet.

___________
Tony Fabris
Posted by: MarkM

Re: Hack the volume - 05/01/2001 18:55

Actually, since it took so long to get the system set up, I've been thinking about simply making an image of the whole drive and posting that for ftp download. Now wouldn't that save people the hassle of setting up their dev environment??

As for providing the source...no worries there. But with the conference schedule ahead, don't expect anything until late Jan, early Feb.

Posted by: fvgestel

Re: Hack the volume - 08/01/2001 02:50

I've been spending an evening hacking up the kernel and am currently testing the following hack :
create a file containing ir-mappings. In a custom init-script cat the file to /dev/ir. when a read is done on /dev/ir the mapping takes place.
an example file :

# Do not remove this line. first line should start with '#' for correct interpretation. Syntax: :
0x0000B914:100
0x0000B915:100
0x0000B91D:100
0x00007910:0x0000B900
0x00007911:0x0000B901
0x00007912:0x0000B902
0x00007913:0x0000B903
0x00007914:0x0000B904
0x00007915:0x0000B905
0x00007916:0x0000B906
0x00007917:0x0000B907
0x00007918:0x0000B908
0x00007919:0x0000B909
0x00007905:0x0000B90A
0x00007906:0x0000B90B
0x0000B90C:0x0000B90C
0x0000B90D:0x0000B90D
0x0000791A:0x0000B90E
0x0000790A:0x0000B90F
0x0000791D:0x0000B914
0x0000791C:0x0000B915
0x00007903:0x0000B91B
0x0000B91C:0x0000B91C
0x0000B91D:0x0000B91D
0x0000B91E:0x0000B91E
0x00007955:0x0000B91F
0x00007902:0x0000B95E

the example above will disable volume adjustment and the tape-button from the kenwood remote.
I also added some custom codes for my own 1000-in-one remote.
I will post the source and kernel-image this evening. (after doing some more testing)


Frank van Gestel
Posted by: fvgestel

Re: Hack the volume - 08/01/2001 13:24

the kernel can be found here

Frank van Gestel
Posted by: MarkM

Re: Hack the volume - 08/01/2001 17:53

Thanks Frank,

Good instructions.

I do have some questions after the install...here we go:
1) I lose my music database after transferring and renaming the init & IR code files via Hyperterminal. After the last player reboot, the player rebuilds the database and I see no inventory. After flashing back to a standard empeg kernel, the database is restored. I'm not sure what's happening here - you should know that I'm using very long file names. The player plays the inventory on the player, but displays "No title" along with the time.
2) The volume UP is disabled using your suggested empeg_ircodes. The DOWN volume is still active. The volume on the empeg would gradually creep down as you adjusted volume on the Kenwood head unit.
3) The TAPE (AUX) button seems to be disabled.

We're almost there. I would appreciate any suggestions on the music database vanishing.



Posted by: MarkM

Re: Hack the volume - 08/01/2001 17:55

Additional note:

The inventory shows up in Emplode software perfectly.



Posted by: fvgestel

Re: Hack the volume - 08/01/2001 18:19

I can send you a program that will display received ir-codes on hyperterm. I've got it lying around somewhere.
As for the database thing. I was just thinking that the init script is probably mounting the wrong partition for the second drive.
It probably must be /dev/hdb1; I set it up for /dev/hdb4, like on the first drive. I have only got one drive, so could anyone verify?
This would also account for some problems with displayserver on dual drive systems...

Frank van Gestel
Posted by: MarkM

Re: Hack the volume - 08/01/2001 18:27

FYI - this is a 2 drive 40GB system.

As for the Hyperterm app, that would be great. Please email it to [email protected] point to it on your site.

I assume that when you assign an IR code to "100" in the script, that this defeats that IR command. Is this correct?

I'm going to play some more with some different scripts. This is fun.

We need to get Frank another drive, that's all there is to it. I will edit the init script to /dev/hdb1 and let you know if this solves the problem.

Mark

Posted by: MarkM

Re: Hack the volume - 08/01/2001 18:49

Okay, same problem with modified script.

I've attached my boot log from Hyperterminal. Maybe someone can shed some light on the problem.

Mark

Posted by: MarkM

Re: Hack the volume - 08/01/2001 19:00

Frank,

How do I pull the standard "init" file off of the empeg through Hyperterm?

I'm flashing the developer image now to get the player functioning normally again, then I'll pull that init off the player before loading up your zimage and IR scripts.

Then I should be able to modify your init script to match my drive configuration. Sound like a good idea?


Posted by: mac

Re: Hack the volume - 09/01/2001 02:11

I will edit the init script to /dev/hdb1 and let you know if this solves the problem.

No it won't. It should be hdc4. To make things portable between Mark I and Mark II players the second drive is hdc even though by Linux convention it should be hdb.

HTH

--
Mike Crowe
I may not be speaking on behalf of empeg above :-)
Posted by: MarkM

Re: Hack the volume - 09/01/2001 12:28

Okay, I've almost got it.

AUX (tape button on Kenwood remote) is disabled.
Volume UP is disabled.
Volume DOWN is still functioning.

I'm posting the init & empeg_ircodes files.

Keep in mind that this is now working on my 40GB (2) drive empeg.

Mark

Posted by: fvgestel

Re: Hack the volume - 09/01/2001 13:04

a solution is much simpler : do not mount the drives at all. As long as all relevant files and commands are installed on the root partition, everything will work fine; the exec'ed init will mount the drives correctly...
I hadn't thought of this because I threw out the original init a few weeks after I got my empeg. This also explains some of the problems with displayserver.
It's kind of strange to see /dev/hdb in the boot messages and use /dev/hdc in the OS. Is there just some device-file rename going on ?

Frank van Gestel
Posted by: MarkM

Re: Hack the volume - 09/01/2001 14:40

Looking at the FSTAB file in the etc directory.

#
# /etc/fstab
#
#
/dev/hda5 / ext2 defaults,ro 1 1
/dev/hda4 /drive0 ext2 defaults,ro 1 1
none /proc proc defaults

How should this be modified to mount the second drive? Or am I in the wrong place...an error led me to this file.

Here's the error:
mount: can't find /drive1 in /etc/fstab or /etc/mtab

Thnx

Posted by: fvgestel

Re: Hack the volume - 09/01/2001 14:48

where did the message came from?
If you are in the shell you could use "mount /dev/hdc4 /drive1" or add a line:
/dev/hdc4 /drive1 ext2 defaults,ro 1 1

to /etc/fstab and use mount -a
As I said in another thread, the empeg init doesn't use /etc/fstab for mounting the empeg's drive ( I think )

Frank van Gestel
Posted by: fvgestel

Re: Hack the volume - 09/01/2001 15:13

In reply to:

I can send you a program that will display received ir-codes on hyperterm



Look in the attachment.

Frank van Gestel
Posted by: 94cobra

Re: Hack the volume - 09/01/2001 20:02

So it will output the IR codes from ANY remote?

If so, couldn't you then reprogram the Empeg to work with other remotes.

I am a basic Linux user. Anyway you could throw together a more complete solution? Instructions on getting it all loaded to the Empeg correctly.

BTW, I did get the DisplayServer installed and working. Nice piece of work. It was easy to install for a novice Linux user like myself.

Proud Owner of MK2 080000558 - 18gb Blue
Posted by: MarkM

Re: Hack the volume - 10/01/2001 13:00

Cobra -

Did you get the Displayserver working correctly on a two drive empeg player?

Mark

Posted by: MarkM

Re: Hack the volume - 10/01/2001 14:43

Cobra -

Instructions for the intercept program are in the 'intercept.c' file.

Posted by: fvgestel

Re: Hack the volume - 10/01/2001 15:49

No it doesn't output all remotes codes, probably only the ones that transmit at the same frequency.
I've been looking at the kernel-source, but the hardware stuff goes over my head...
It does work for this for my 100-in-one remote, which can be programmed for various brands of TV's, Videos and CD-players.
I didn't have the documentation of the remote, so I hacked up intercept.c to output the incoming ir-code. I then started pushing the buttons of the remote to see if anything would be recognized. I had succes with some CD-player configuration, probably kenwood... I've been using it for about a week now, without problems.

Frank van Gestel
Posted by: MarkM

Re: Hack the volume - 10/01/2001 18:23

AUX Volume Hack files
Here's a modified linux kernel for the empeg-player created to deal with IR conflicts when you're using a Kenwood head unit. This has only been tested on a two drive empeg player, I cannot confirm that this will function correctly in a single drive player. Use it at your own risk.

I couldn't reliably defeat the volume using the IR Translator, so the volume 0db lock is a kernel mod. I'm sure that this could be accomplished using Frank van Gestel's IR Translator with further testing.

1) TomG programmed the kernel per Hugo Fiennes' idea. The kernel defeats the Volume completely, it is locked at 0db no matter what happens, whether using the IR remote or manually turning the volume control. If you don't want this feature, you should not install this kernel. Keep in mind that the empeg volume display is not defeated at this time.

2) Frank van Gestel created the patch for the IR Translator. The AUX (Tape button on Kenwood remote) is disabled using this method. The included 'empeg_ircodes" file kills the AUX (Tape button on Kenwood remote).

A modified version of Frank's original instructions are also included in the zip file.

Thanks to all who have helped! Frank, TomG, Hugo, tfabris and others!

MarkM

------------------------------------------

Volume Hack from Hugo Fiennes:

arch/arm/special/empeg_audio2.c

Easiest way is to simply patch mixer_setvolume() to use volume 90 (this is 100% - 100 is 10db gain) at all times. Probably best to do it like this:

dsp_write(Y_VAT,volume_table[90 /* was vol */ ].vat);
dsp_write(Y_VGA,volume_table[90 /* was vol */ ].vga);

...and not actually change the value stored in dev->volume otherwise it may confuse the player. Actually, I'm pretty sure it reads back, so the volume control might just work correctly, but be "stuck" at 100%.


Posted by: 94cobra

Re: Hack the volume - 11/01/2001 08:35

Did not try on a dual drive as I only have a single at this time.

Working hard to fill it up first.

Proud Owner of MK2 080000558 - 18gb Blue
Posted by: 94cobra

Re: Hack the volume - 11/01/2001 08:38

I am just learning Linux, so the installation of the files to the Empeg is what I can't understand. I did manage to get The displayserver installed, but Franks directions were pretty simple and complete. Can you post exactly what you do to install?

Proud Owner of MK2 080000558 - 18gb Blue
Posted by: fvgestel

Re: Hack the volume - 11/01/2001 10:51

unzip the files on your pc
use hyperterm to upload file 'intercept' to your empeg ("send file" menu-option)
then type the following commands :

# chmod +x intercept
# ./intercept

now try your empeg remote or push the fascia-buttons.
You should see the codes come by in hyperterm

Frank van Gestel
Posted by: MarkM

Re: Hack the volume - 11/01/2001 13:28

94cobra-
I'm new to Linux as well, but learning fast. I didn't have luck with displaying the IR codes on Hyperterm. I'm sure that it's just a matter of configuring the init properly. I had the init configured for the IR remapping software and adding the additional line to the init to execute the Intercept file made for a very weird boot where I had to type init.empeg in Hyperterm to boot the player.

I'm going to bust out a new player later and do some hacking on that unit. I don't want to change anything on the player with the AUX/Volume disabled.

Maybe Frank can post some Newbie instructions for those of us with just enough Linux knowledge to be dangerous.

Mark


Posted by: fvgestel

Re: Hack the volume - 11/01/2001 17:14


# chmod +x intercept
# ./intercept

to end press CTRL-C...
Give command

# ro

You can now reboot the unit

Frank van Gestel
Posted by: 94cobra

Re: Hack the volume - 11/01/2001 20:26

Thank you.

I figured that out now.

Proud Owner of MK2 080000558 - 18gb Blue
Posted by: MarkM

Re: Hack the volume - 12/01/2001 16:37

Frank-

Thanks for the instruction on the IR Intercept program.

I found out why I couldn't remap the Volume IR reliably.

If you hold the Volume buttons down, new codes appear as very fast IR pulses. So, we need to remap these pulses as well.

Volume Up code is: 47380
The repeat pulse for Volume Up is -2147436268
Volume Down code is: 47381
The repeat pulse for Volume Down is -2147436267

Check it out.

Mark



Posted by: MarkM

Re: Hack the volume - 15/01/2001 17:53

This seems to solve the above issues with the volume.

Put this into your empeg_ircodes file. Some IR codes are disabled, others are remapped to the CD button. When the CD button is hit during playback, nothing happens except that the little play indicator triangle lights up.

#
0x0000B914:0x0000B91E
0x0000B915:0x0000B91E
0x0000B91D:100
47379:100
-2147436268:100
-2147436267:0x0000B91E