Hijack SaveAux / RestoreSrc Revisited

Posted by: sein

Hijack SaveAux / RestoreSrc Revisited - 25/02/2007 11:05

Hey all, or should I say, Hey Mark

A few weeks ago I got a new phone (replaced the trusty Treo 650 with a Nokia E61). The new phone has more 'integrated' Bluetooth features which has showed up a few little glitches in the way the Empeg switched sources through SaveAux and RestoreSrc.

To understand the problem, I'll explain a couple of differences between the Nokia and Treo:
  • Navigation Audio - I have TomTom running on both of these phones. On the Treo the turn-by-turn instructions always comes out of the speaker on the back of the device (It can not be paired by Bluetooth to both the car kit and the GPS). On the Nokia, the sounds are actually routed through the car kit (it can handle multiple Bluetooth connections at the same time).
  • Voice Commands - The Treo did not have any voice activation as standard, I think there was some 3rd party software which I didn't get on with. The Nokia actually does real voice recognition and speech synthesis - say the name of anyone in the phone book and it will dial without setting any tags. When you receive a call, it says the persons name through the speakers while ringing. Pretty cool.
There are a few other minor differences, but these will help illustrate the problem which is (1) The Empeg does not switch fast enough and (2) When the Empeg is manually set to Aux it seems SaveAux and RestoreSrc is not being ignored. I think it could be switching the Empeg from Aux to Aux which is cutting out the sound for a second.

Reguardless of which 'state' the Empeg is in (even if manually switched to Aux) parts of the TomTom instructions are cut off. "In 300 yards turn right" becomes "yards turn right". It is difficult to use the speech recognition because the 'beep' to signal the start of a voice command is cut off. If someone calls, the phone says their name but I normally only get the last few syllables.

Today I unplugged the Car Kit -> Empeg audio cable and plugged in the little speaker that came with the car kit. All the sounds came through quite nicely and there doesn't seem to be any lag in the Bluetooth connection.

In terms of priority, it is more useful for me to get the 'Sound glitches when manually switched to Aux' problem fixed so the Navigation Audio works. Maybe a line in both SaveAux and RestoreSrc to check "if the previous state and the future state are the same, do nothing" will do it?
Posted by: mlord

Re: Hijack SaveAux / RestoreSrc Revisited - 25/02/2007 11:25

Quote:
Maybe a line in both SaveAux and RestoreSrc to check "if the previous state and the future state are the same, do nothing" will do it?


That line is already there:Code:

static void
switch_to_src (int from_src, int to_src)
{
if (from_src != to_src) {
unsigned int button = 0;
switch (to_src) {
case INPUT_AUX:
if (from_src != INPUT_PCM) {
if (!kenwood_disabled) {
button = IR_KW_TAPE_PRESSED;
break;
}
hijack_enq_button_pair(IR_RIO_SOURCE_PRESSED);
}
// fall thru
case INPUT_PCM:
button = IR_RIO_SOURCE_PRESSED;
break;

case INPUT_RADIO_AM:
if (from_src != INPUT_RADIO_FM)
hijack_enq_button_pair(IR_RIO_TUNER_PRESSED);
// fall thru
case INPUT_RADIO_FM:
button = IR_RIO_TUNER_PRESSED;
break;
}
if (button)
hijack_enq_button_pair(button);
}
}

Posted by: sein

Re: Hijack SaveAux / RestoreSrc Revisited - 25/02/2007 20:10

Thanks Mark.

I had another fiddle around and think I have identified the problem. When the player detects silence it shows a 'Pause' icon on the screen. When the Empeg receives some input from Aux it takes a second to switch to the 'Play' icon which crops the audio a bit (and causes an annoying pop in the speakers).

Is there any way of stopping the silence detection?
Posted by: mlord

Re: Hijack SaveAux / RestoreSrc Revisited - 25/02/2007 21:12

Quote:

Is there any way of stopping the silence detection?


Mmmm... dunno. Maybe detect it in Hijack and then substitute a slight noise signal, enough to trick the player?

??
Posted by: julf

Re: Hijack SaveAux / RestoreSrc Revisited - 26/02/2007 08:27

A really crude solution would be to edit the TomTom soundfiles (they are ogg) to add a bit of leading silence/pilot sound.
Posted by: sein

Re: Hijack SaveAux / RestoreSrc Revisited - 26/02/2007 09:17

Julf, nice bit of lateral thinking but I think the result may be a bit messy. Often it strings together bits of speech which would then have strange pauses in there. Also when it mentions distances there would be all kinds of errors as it pauses before saying something. I'd be much more likely to miss a turning or take a wrong one.

Mark, maybe the signal to the player to hush/mute/pause (?) when there is silence could be 'caught' or even redefined to do nothing. I know virtually nothing on how button presses and events occur in the Empeg so may well be talking out of my ass.
Posted by: sein

Re: Hijack SaveAux / RestoreSrc Revisited - 26/02/2007 12:14

There is a FAQ Entry on the AUX display which has some useful info on the way the Empeg handles AUX input. It seems very smart, but obviously in this case a bit too smart
Posted by: julf

Re: Hijack SaveAux / RestoreSrc Revisited - 01/03/2007 13:51

Quote:
Julf, nice bit of lateral thinking but I think the result may be a bit messy. Often it strings together bits of speech which would then have strange pauses in there. Also when it mentions distances there would be all kinds of errors as it pauses before saying something.


OK, even kludgier - figure out which sound samples can start a sentence, and which can't, and only add the prelude to the "start-of-sentence" sounds. As an example, distances and numbers will never be spoken at the start of a verbal instruction.

OK, I know, stretching it...