Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Sgtl5000, Line & Mic input at the same time.

  1. #1
    Member
    Join Date
    Jun 2020
    Location
    The Netherlands
    Posts
    24

    Sgtl5000, Line & Mic input at the same time.

    Hi Team, ive been searching on this forum for quite a while for an (simple) answer, but coulnd't realy find one.

    Is it possible to use both inputs ? like the line input and the input for the microphone (electret)

    sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
    sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);

    I wanted to expiriment a bit with incoming microphone audio on top of the line input, and let the line input duck a bit in volume. but not shure if this is possible?

    Thnx for tips

    Yours
    Danny

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,337
    AFAIK, Line-in and MIC cannot be used simultaneously

  3. #3
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    Indeed not possible as there is a bit in the CHIP_ANA_CTRL register that is either MIC or LINE_IN.

    Code:
    #define CHIP_ANA_CTRL			0x0024
    // 8	MUTE_LO		LINEOUT Mute, 0 = Unmute, 1 = Mute  (default 1)
    // 6	SELECT_HP	Select the headphone input, 0 = DAC, 1 = LINEIN
    // 5	EN_ZCD_HP	Enable the headphone zero cross detector (ZCD)
    //				0x0 = HP ZCD disabled
    //				0x1 = HP ZCD enabled
    // 4	MUTE_HP		Mute the headphone outputs, 0 = Unmute, 1 = Mute (default)
    // 2	SELECT_ADC	Select the ADC input, 0 = Microphone, 1 = LINEIN
    // 1	EN_ZCD_ADC	Enable the ADC analog zero cross detector (ZCD)
    //				0x0 = ADC ZCD disabled
    //				0x1 = ADC ZCD enabled
    // 0	MUTE_ADC	Mute the ADC analog volume, 0 = Unmute, 1 = Mute (default)

  4. #4
    Member
    Join Date
    Jun 2020
    Location
    The Netherlands
    Posts
    24
    Hmm, that stops the searching :-)

    Thnx for your's time and help
    appreciated

    Danny

  5. #5
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    You could try using the left and right Line IN and combine those signals ? Your mic would need a preamp to get enough signal for that.

  6. #6
    Member
    Join Date
    Jun 2020
    Location
    The Netherlands
    Posts
    24
    Hi thnx for the tip, at the moment that is indeed the setup I am running, and having the left input for an electret mic, and that was also part of the reason the quest started, I have the feeling that I need to do to much tweaking to make it sound a bit fatter (if thatís the correct term) i have enough preamp for its input, but itís output (the left output) stays a bit low, so Iíve used some filters in the audiodesigner-tool to filter the voice a bit, lpf and hpf, and managed to get it a bit more powerfull, but when I do some scope readings the mic in is about 10x as loud as the output, an amp after the filtering doesnít really work and it starts to clip the audio output signal (destroys my sinus) so I got the feeling that I am not reaching the line outlevels. If I am correct the sgtl5000 could reach 3,12v p.p with its lineout(right, left) settings. The setting on my scope is 1v per devision, and if I whistle in the mic I have an output reading of around 1 division, as for the mic and preamp (same settings on scope, 2 chan scope as well) is about 4 / 5 divisions( plenty of power in the preamp I could boost it more) so perhaps I am doing something wrong Or totally overlooked, or I expected more output from the teensy.
    Thatís why I thought that the mic input would be an better option.

    Thnx

  7. #7
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    Hi,

    I have never measured the output as my audioboards are always connected to headphones. From the work I have done creating the TeensyBat I have not gotten the idea the signal was not amped enough by the SGTL. There is a load of options to filter but they have to be used carefully as they can also attenuate the signal and lead to clipping.

    cheers
    Cor

  8. #8
    Member
    Join Date
    Jun 2020
    Location
    The Netherlands
    Posts
    24
    Hi cor,
    Are u running the headphones directly out of the teensy? Without any amp behind it?
    I thought this was an different output than the lineout? (Different pins on the sglt)
    I havenít tried this output,

  9. #9
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    507
    The audioboard has a headphone jack that is used for that purpose ...

  10. #10
    Member
    Join Date
    Jun 2020
    Location
    The Netherlands
    Posts
    24
    I shall test and measure this, thnx for the tip.

  11. #11
    Member
    Join Date
    Jun 2020
    Location
    The Netherlands
    Posts
    24
    Hi Corbee,
    It took me a bit longer to find some time and made some simple tests, but indeed the headphone delivers approx twice the amount of output, or is amplified to drive the small speakers, on the other also pretty obvious i guess? so thanks for pointing this option out to me. (and that i wasnt looking further than my nose-length :-))

    Greets Danny

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •