Car Kit Behaviour - SaveAux/RestoreSrc

Posted by: sein

Car Kit Behaviour - SaveAux/RestoreSrc - 08/04/2006 10:03

Hey guys,

A couple of days ago I had some quality time with my car dashboard and the Nokia CK-7W Bluetooth Handsfree Kit.

I used this cable to hook it up to the Empeg (running 2.00) Aux input, hooked up the phone-mute cable, and fiddled with Hijack (v450) a little (extmute_on=RestoreSrc, extmute_off=SaveAux, volume_boost_AUX=25). It pretty much works as it should, the sound quality is pretty good, and the switching over to Aux *almost* works.

When the Empeg is sleeping, an incoming phone call does wake it up, but doesn't switch over to Aux. At the end of the call, the Empeg doesn't go back to sleep. Is this something that can be fixed in Hijack?

Also, the CK-7W manual says
Quote:
When a call is accepted, the Advanced Car Kit switches the yellow line (MUTE) to ground, muting the car radio. When the call is ended, the yellow line is separated from ground and the car radio is unmuted.

This works about 70% of the time. Is there any way of making it work better? I know there are a few of you guys and girls out there with CK-7W kits, what are your experiences? I think I need to do this, right?
Posted by: mlord

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 08/04/2006 10:53

When the player is sleeping, it tosses the first button code that is seen (either Hijack or the player s/w do this, I forget which, but it happens).

So, if you want it to wake from sleep and do the saveaux thing, just add an innocuous button code in front: extmute_off=SelectMode,SaveAux

To get it to go back to sleep automatically is not possible, as the current interface does not know what the original state was. We'd have to add a new feature to Hijack for that.

Now, Hijack itself *usually* has a good idea of whether the player is sleeping or not, so maybe we could just add two more virtual button codes to manage this. Something like "SleepWake" and "SleepResume" or something. Anyone got some better name suggestions? With those, one might do this:

extmute_off=SleepWake,SaveAux
extmute_on=RestoreSrc,SleepResume


Cheers
Posted by: JBjorgen

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 08/04/2006 18:02

I'm assuming that SleepWake and SleepResume would have no affect at all on a player that wasn't sleeping, correct?

If so, how does Hijack know when SleepResume is called that the player was formerly sleeping? Possibly if the source hasn't changed since the last SleepWake call?
Posted by: mlord

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 08/04/2006 18:14

Quote:
I'm assuming that SleepWake and SleepResume would have no affect at all on a player that wasn't sleeping, correct?

Yes.

Quote:
If so, how does Hijack know when SleepResume is called that the player was formerly sleeping? Possibly if the source hasn't changed since the last SleepWake call?

The idea is that Hijack would make note of the current sleep state when executing SleepWake, and then restore the player to that state upon SleepResume. It might be a good idea to have it skip the restore if the user switches sources before the SleepResume is requested.

Cheers
Posted by: matthew_k

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 08/04/2006 18:19

Quote:
If so, how does Hijack know when SleepResume is called that the player was formerly sleeping? Possibly if the source hasn't changed since the last SleepWake call?

Presumably, if the last SleepWake woke it up, a SleepResume would sleep it. If it was awake for the last SleepWake, a SleepResume wouldn't do anything.

The Save/Restore Aux have been working well for me. It's not 100%, but I assume that's my car kit switching things too quickly for the empeg to handle. I should look into some sort of delay circuit, but it works well enough that I'll never get around to it.

Just a note, but using hijack's volume adjust for the various sources is a great combination with this feature.

Matthew
Posted by: sein

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 08/04/2006 19:48

Quote:
So, if you want it to wake from sleep and do the saveaux thing, just add an innocuous button code in front: extmute_off=SelectMode,SaveAux

Magic. Thanks Mark

Quote:
The idea is that Hijack would make note of the current sleep state when executing SleepWake, and then restore the player to that state upon SleepResume. It might be a good idea to have it skip the restore if the user switches sources before the SleepResume is requested.

Personally, I think this would be a great feature.
Posted by: mlord

Hijack v452: WakeUp and RestoreSleep - 08/04/2006 21:50

Now available, as per subject line.

-ml
Posted by: petteri

Re: Hijack v452: WakeUp and RestoreSleep - 09/04/2006 02:52

Damn, that's just Service with a capital "S"!!!! Mark, thanks for the great work you've done with Hijack and this community in general. I've done little here but gather bits and pieces to help me with my Empeg player and other various tidbits, but I just wanted to say thanks! This is exacly the kind of spirit that makes this sucha great forum to just browse through.



...and that concludes this nights episode of "cruising the Empegbbs while intoxicated"* episode!

But again thanks Mark and to all of you who share your knowledge here!

*shamefully stolen from the AVSforum BBS...
Posted by: sein

Re: Hijack v452: WakeUp and RestoreSleep - 09/04/2006 07:11

Quote:
Now available, as per subject line.

Mark, hope you can make it to Cambridge in September - a drink is on me.
Posted by: sein

Re: Hijack v452: WakeUp and RestoreSleep - 09/04/2006 17:44

I think something may be broken.

Previously I was running v450 with the config file attached. SaveAux and RestoreSrc were working for me (most of the time), and it was pretty cool.

A few hours ago I installed v452 and changed my config to:

Quote:
extmute_off=WakeUp,SaveAux
extmute_on=RestoreSrc,RestoreSleep

Things were not right. Switching sources was not working. If you were in Player when the phone rings it would not switch to Aux, and it would switch to Tuner on hangup. It would not sleep on hangup if it was woken by the phone - and when woken by the phone it would not switch to Aux.

I tried to break it down. I tried just the new features to see whether it would Wake and Sleep correctly, forget switching to the correct source. I tried this:

Quote:
extmute_off=WakeUp
extmute_on=RestoreSleep

I got a hijack config error. I should have double checked my config.ini file, but I admit that I did not.

Anyway. I put back the original config file (as attached) that I was using with v450. SaveAux and RestoreSrc were not working - the Empeg did not switch to Aux when in Player with the phone ringing, and on hangup it would switch to Tuner.

I downgraded to Hijack v451 and had the same problem.

Downgraded back to v450 (without touching the config.ini file) and it is all working as before.

While I've been messing about, I had been editing the config.ini file with vi over Telnet. A couple of times I used Jemplode instead because it was a bit faster (running rwm in the shell takes a while). I loaded v452 with Jemplode, and downgraded to v451 and v450 with Tony's Logo Editor. I may still be doing something wrong, I'm not sure.
Posted by: mlord

Re: Hijack v452: WakeUp and RestoreSleep - 09/04/2006 21:46

Oh, I know what most of the problem likely is.

The extmute_on and extmute_off codes are supposed to be single buttons, not lists of buttons. Ooops. Plus, there was a cut'n'paste bug in the restore code.

Mmm.. I think the easiest thing then, is to just rework the two new codes so that they are internally combined with the SaveAux and RestoreSrc codes.

So I'll just do away with the WakeUp and RestoreSleep codes altogether, and build that functionality into the existing codes.

Thanks for testing it!

Cheers
Posted by: mlord

Hijack v453: Auto-wakeup/sleep for SaveAux and RestoreSrc - 09/04/2006 21:53

As per the subject line.

Cheers
Posted by: matthew_k

Re: Hijack v452: WakeUp and RestoreSleep - 09/04/2006 22:56

Quote:
The extmute_on and extmute_off codes are supposed to be single buttons, not lists of buttons.

That can be solved by creating a fake button code that IR_Translate translates into a list of buttons. That always worked fine for me. Of course, the current method is even better.

Matthew
Posted by: sein

Re: Hijack v453: Auto-wakeup/sleep for SaveAux and RestoreSrc - 10/04/2006 10:16

Quote:
So I'll just do away with the WakeUp and RestoreSleep codes altogether, and build that functionality into the existing codes.

Very neat! I'm looking forward to trying it out tonight.
Posted by: jarob10

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 10/04/2006 11:46

Quote:
A couple of days ago I had some quality time with my car dashboard and the Nokia CK-7W Bluetooth Handsfree Kit.



Out of interest, did you have to install a pull up resistor to the mute line?
Posted by: sein

Re: Car Kit Behaviour - SaveAux/RestoreSrc - 10/04/2006 20:27

Quote:
Out of interest, did you have to install a pull up resistor to the mute line?

I did not do that in the end. I was driving around today (listening to the Player, with Hijack v450) and got a couple of calls. Both times the Empeg switched over perfectly, and switched back again at the end of the call. It's working great at the moment, so I won't fix it.
Posted by: sein

Re: Hijack v453: Auto-wakeup/sleep for SaveAux and RestoreSrc - 11/04/2006 18:38

I'm still having a few problems with this. I may not have something set up right or there could be a bug.

(1) When a call comes through when my Empeg is playing, RestoreSrc sends my Empeg to sleep when it ends.

EDIT: below changed to what I actually wanted to say:

(2) Also, SaveAux gets eaten by something when the Empeg is woken from sleep by it with extmute_off=SaveAux. If I use the innocuous button trick extmute_off=SelectMode,SaveAux, will SaveAux correctly record the power state when that line is invoked?
Posted by: mlord

Re: Hijack v453: Auto-wakeup/sleep for SaveAux and RestoreSrc - 11/04/2006 20:01

Upgrade. WakeUp got removed from Hijack in the most recent version.

-ml
Posted by: sein

Re: Hijack v453: Auto-wakeup/sleep for SaveAux and RestoreSrc - 12/04/2006 04:49

Doh! Sorry, I did upgrade to v453, and I am not using WakeUp or RestoreSleep. My config file only has the following relevant lines:

extmute_off=SaveAux
extmute_on=RestoreSrc


I just posted incorrectly. Edited my post now.
Posted by: mlord

Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking up - 12/04/2006 20:37

Doh!

I put the save logic into the SaveSrc code, but not the SaveAux code. Doh!

Fixed. It's now in both places (actually, one common place).

-ml
Posted by: sein

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 16:46

It took me a little while to test out all the new code, but I have played around in the last few days. Its really cool, and very usable! The waking and sleeping thing is working well, and the normal input switching is working perfectly when the Empeg is on.

One little bug that I can't seem to fix is when the Empeg is woken from sleep by the phone, it does not switch to Aux by itself, I have to do that manually. I tried using lines such as:

Quote:
extmute_off=SaveAux,Aux
or
Quote:
extmute_off=SelectMode,SaveAux

but (confusingly) it still doesn't work.
Posted by: mlord

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 16:56

Quote:

One little bug that I can't seem to fix is when the Empeg is woken from sleep by the phone, it does not switch to Aux by itself, I have to do that manually. I tried using lines such as:

Quote:
extmute_off=SaveAux,Aux
or
Quote:
extmute_off=SelectMode,SaveAux

but (confusingly) it still doesn't work.


It should just work with extmute_off=SaveAux, as of Hijack v454.
Posted by: sein

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 19:31

Quote:
It should just work with extmute_off=SaveAux, as of Hijack v454.

That is exactly what I have at the moment, and it doesn't switch to Aux when it is woken from sleep by the phone. If it is definately supposed to work, can someone else also try this to see whether it is just me?
Posted by: mlord

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 19:38

Quote:
Quote:
It should just work with extmute_off=SaveAux, as of Hijack v454.

That is exactly what I have at the moment, and it doesn't switch to Aux when it is woken from sleep by the phone. If it is definately supposed to work, can someone else also try this to see whether it is just me?


Mmm.. I've only tested it here by remapping buttons on the Rio Remote. To use the actual extmute line, what voltage should I be applying to it? (+12VDC?)
Posted by: matthew_k

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 19:59

Yup. +12V should do it.

Matthew
Posted by: sein

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 20:00

Quote:
Mmm.. I've only tested it here by remapping buttons on the Rio Remote. To use the actual extmute line, what voltage should I be applying to it? (+12VDC?)

I suspect my Nokia kit switches the line from open circuit to ground on an incoming call. I am not 100% certain of this as the manual is a bit ambiguous.
Posted by: mlord

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 20:00

Quote:
Yup. +12V should do it.

Matthew


MMm... seems to want "GROUND" to trigger "extmute_off" here. And yes, I see it not switching sources also. I'll fix it now.

Cheers
Posted by: mlord

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 21:08

A thousand curses on whomever decided it would be cute to wire up the external MUTE line to the in-car DB-9 harness. UGHHH!!!

Yes, I know it's using one of the serial port signals as "external MUTE", but it already has a separate wire for it on the ISO connector -- having it also on the DB-9 is very very silly.

Time to make a 3-wire patch cord, I guess..
Posted by: mlord

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 24/04/2006 22:43

Fixed (and tested!) in Hijack v455. See the full announcement in the General forum.

Cheers
Posted by: jarob10

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 26/04/2006 11:10


I am not 100% certain of this as the manual is a bit ambiguous.


You are right it is ambiguous, so I checked my CK-7W with an avo. The mute line is normally floating, then switches to ground when a call is made.

I had to use a pull-up resistor (hacked into the CK-7W harness) to get the empeg to recognise an incoming call.
Posted by: sein

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 26/04/2006 11:44

Quote:
You are right it is ambiguous, so I checked my CK-7W with an avo. The mute line is normally floating, then switches to ground when a call is made.

I had to use a pull-up resistor (hacked into the CK-7W harness) to get the empeg to recognise an incoming call.


Cool. But note that my CK-7W is working great without this mod. The 'Sense' section of the config.ini on my player contains this:

[sense]
muteaction=0
mute=-1


I presume this is the magic that makes it work.
Posted by: mlord

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 26/04/2006 12:57

Quote:
I had to use a pull-up resistor (hacked into the CK-7W harness) to get the empeg to recognise an incoming call.


From what I saw while debugging this, it makes perfect sense (needing the pull-up, or pull-down as the case might be).

Cheers
Posted by: schofiel

Re: Hijack v454: Doh! might even work for SaveAux/RestoreSrc & waking - 27/04/2006 07:13

The installation instructions for my Nokia CARK-9 kit recommended the use of a pull up.