Author Topic: Swap audio channels - use right external and left internal?  (Read 2572 times)

kitor

  • Developer
  • Senior
  • *****
  • Posts: 361
My 5d2 has broken right channel. It has 100% signal all the time. It's issue between audio controller and digic, as i checked circuit from socket to controller and it's ok.
That creates annoying effects while editing files on pc, and also makes "L:int, R:ext" option useless for me.

I looked into source code, in audio-lapis.c there's function audio_ic_set_input(int op_mode)
Am I right, that to invert this behavior (use R:ext and internal on R) all I need to change is
Code: [Select]
case 1:// L internal R extrenal
            audio_ic_write(ML_RCH_MIXER_INPUT | ML_RCH_MIXER_INPUT_SINGLE_HOT); // replace with SINGLE_COLD
            audio_ic_write(ML_LCH_MIXER_INPUT | ML_LCH_MIXER_INPUT_SINGLE_COLD); // replace with SINGLE_HOT
            audio_ic_write(ML_RECORD_PATH | ML_RECORD_PATH_MICL2LCH_MICR2RCH); //
            audio_ic_write( ML_MIC_IF_CTL | ML_MIC_IF_CTL_ANALOG_SINGLE );
            break;
?

Also, as "L internal R extrenal" requires microphone power, is it possible to modify "External stereo" to work as mono (both channels left, or at least mute right channel)?
Too many Canon cameras.

kitor

  • Developer
  • Senior
  • *****
  • Posts: 361
Re: Swap audio channels - use right external and left internal?
« Reply #1 on: July 22, 2015, 02:42:43 PM »
Ok, now I know that 5d2 uses "old" audio chip, and audio-ak.c that is poorly documented. On this controller, inputs are set using pm3 register
Code: [Select]
    int pm3[] = { 0x00, 0x05, 0x07, 0x11 }; //should this be in a header file?
/* few lines later */
    audio_ic_write( AUDIO_IC_PM3 | pm3[input_source] );

but as those values are hardcoded without comment, I have no idea what other values are possible.

[edit]
Ok, with help of AK4646 datasheet I was able to rewrite a code a bit to meet audio-lapis.c style (#define, etc) and add two additional options: External mono left and External mono right.
No luck with swaping behavior of L:int, R:ext, as internal microphone seems to be connected only to left internal channel (no signal at all on right internal), but by looking at the original code, it was already coded like this.
Also, when I switch right (broken) channel to internal, this 100% signal disappears, so I need to trace problem once again, since it lies between connector and audio controller itself.
Too many Canon cameras.