[solved] Audio in is not stereo!

Discussion in 'General Discussion' started by DonGateley, Oct 20, 2013.

  1. DonGateley

    DonGateley New Member

    Joined:
    Sep 10, 2013
    Messages:
    13
    Likes Received:
    0
    Looking at the UDOO schematic, the audio input jack is connected to MIC1 and MIC2 (Pins 21 and 22) of the Via VT1616 audio codec. Looking further at the Via VT1616 data sheet it can be seen that these go through a mux that selects one or the other before adding 20 dB gain and presenting it in MONO to the input selection mux. This is to allow the selection of either one of two microphones and _not_ a stereo channel. Put a stereo mic into the current jack and you'll be able to select either the left channel or the right channel but not a stereo channel. Stereo line-in is more appropriate for this device than is mono mic-in as it is currently designed.

    This simply must be revved to bring the audio input jack into LINE_IN_L and LINE_IN_R (pins 23 and 24) to be able to get a stereo signal into the board. Another input to MIC would be a good idea however.
     
  2. saidol

    saidol New Member

    Joined:
    Oct 3, 2013
    Messages:
    24
    Likes Received:
    0
    Re: Audio in is not stereo!

    Hi,
    I'm not sure, but I think you can obtain an input stereo audio flow (from input microphone) by setting register 76h of vt1613 codec to the value 0x2100.

    Current kernel image has not yet that setting, so peoples who use a stereo microphone have to edit kernel source in file
    sound/soc/codecs/vt1613.c adding such a line:
    Code:
    snd_soc_write(codec, 0x76, 0x2100);
    in "vt1613_driver_probe" function.

    bye
    Giuseppe
     
  3. DonGateley

    DonGateley New Member

    Joined:
    Sep 10, 2013
    Messages:
    13
    Likes Received:
    0
    Re: Audio in is not stereo!

    I believe that just chooses which of the two mono microphone inputs is active, not mono/stereo. The block diagram in the VT1616 data sheet shows two mic inputs going into a two to one mux and emerging as a mono signal to be fed to the larger input mux. The descriptive text also says that there are 4 stereo inputs and one mono which would bolster that interpretation.

    Can you test this on a working device?
     
  4. saidol

    saidol New Member

    Joined:
    Oct 3, 2013
    Messages:
    24
    Likes Received:
    0
    Hi DonGateley,
    I've just tested and I can confirm that uDOO audio input is stereo.
    This is the instruction I've followed for test:

    A - modify kernel source adding following line to file: "sound/soc/codecs/vt1613.c" :

    Code:
            SOC_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 6, 1, 0),
            SOC_SINGLE("Mic Loopback Switch Mic L",AC97_MIC,15,1,1),
            SOC_SINGLE("Mic Loopback Switch Mic R",AC97_MIC,7,1,1),
            SOC_DOUBLE("Select capture device",AC97_REC_SEL,8,0,7,0),
    
    ......
            snd_soc_write(codec, AC97_LINE, 0x0A0A);
            snd_soc_write(codec, 0x5A, 0x0400); // <-- [gp000q7] Noise reducing during mic recording on vt1613
            snd_soc_write(codec, 0x76, 0x2100); // <-- [gp000q7] Stereo mic input with MIC1 on left channel, MIC2 on right channel]
    B - Compile and use new kernel for booting uDOO (instuction are available in Starting Manual]

    C - Connect PC audio output with MIC input line using a stereo cable [male to male]

    D - Execute "speaker-test -c2 -tsine -l3" command on my pc

    E - Execute:
    • amixer sset 'Select capture device',0 0
    and
    • arecord -fcd -d 10 > sound.wav
    on uDOO console.

    F - Listen stereo audio file on headphones: "aplay sound.wav"

    P.S. I've marked solved the issue, if you can, please confirm us that input audio stereo also works for you !
    bye
    Giuseppe
     
  5. DonGateley

    DonGateley New Member

    Joined:
    Sep 10, 2013
    Messages:
    13
    Likes Received:
    0
    Excellent, Giuseppe! I don't have hardware to test it on but having you verify that stereo in->out works pretty much guarantees I will as soon as I can buy it (after the Kickstarter backers have been satisfied.) I know nothing yet about compiling kernels but if one can do it on the UDOO itself I should be able to hack it with this information (being an old embedded controller hand.)

    The line:

    SOC_SINGLE("Mic 20dB Boost Switch", AC97_MIC, 6, 1, 0)

    seems to indicate that the mic boost can be turned off or on. Correct? If so, which way is off since I will want to be inputing and outputing line levels to attempt a real time 2->4->2 convolutional DSP transform with limiter as a line level analog insert.

    Also, do you know whether or not the VT1616 line-out you bring to the jack has enough drive for headphones?

    Many thanks for your attention. All the more reason I'll be buying one as soon as I possibly can. I've been waiting for a compact system with the potential to do what I described for quite a number of years. 44 years to be exact. :)
     
  6. Lifeboat_Jim

    Lifeboat_Jim New Member

    Joined:
    Sep 16, 2013
    Messages:
    399
    Likes Received:
    1
    Gold star for Giuseppe!
     
  7. saidol

    saidol New Member

    Joined:
    Oct 3, 2013
    Messages:
    24
    Likes Received:
    0
    Hi,

    That line defines a userspace control that you can manage from shell using tools as alsamixer or amixer or audiomixer from gnome gui.
    amixer syntax is quite simple: "amixer 'Mic 20dB Boost Switch' On" or "amixer 'Mic 20dB Boost Switch' Off" to turn On/Off the boost.
    Don't know much about VT1613 line-out drive strength, but sure, it is enough for the headphones.

    Hurry ! I can guarantee uDOO is cheap but very powerfull all in system !
     
  8. DonGateley

    DonGateley New Member

    Joined:
    Sep 10, 2013
    Messages:
    13
    Likes Received:
    0
    It is done! On to figuring out how to spread four fast convolutions over four processors simultaneously.

    Many Thanks
     

Share This Page