Line out, Line in and Headphone connections

Designing hardware that use VLSI Solution's devices as the system controller for the entire design.
navidrct
User
Posts: 18
Joined: Mon 2017-07-03 23:48

Re: Line out, Line in and Headphone connections

Post by navidrct » Sat 2017-08-05 9:59

Panu wrote:
Sun 2010-10-24 9:42
Hi!

The VS1053/VS8053 Simple DSP Board's application note is a great example for how to design a device with good analog performance (sound quality). It's good reading, and it's available at: http://www.vlsi.fi/en/support/evaluatio ... board.html. Look for the Application Note link at the top-right corner of the page.

Here's a small contribution to the discussion about the analog connections. I've annotated a section of the Simple DSP Schematic, showing what the various capacitors and resistors in the analog block are actually for.

Have fun examining!
VS1053-Analog2.png
Show full picture



-Panu
can i connect line out to input of TPA3118D2?

User avatar
Panu
VLSI Staff
Posts: 2428
Joined: Tue 2010-06-22 13:43

Re: Line out, Line in and Headphone connections

Post by Panu » Sun 2017-08-06 11:15

For a good example of connecting to a D class amplifier, please see here: http://www.vlsi.fi/fileadmin/software/V ... der_03.pdf

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

SyncOrSwim
User
Posts: 1
Joined: Tue 2017-12-05 20:33

Re: Line out, Line in and Headphone connections

Post by SyncOrSwim » Fri 2017-12-08 18:10

Hello All.

I am designing a stand-alone board with a VS1005. It will be used to play audio clips over a phone line. The phone line is monaural, of course, and the VS1005 will be hard-wired to it through a Direct Access Arrangement circuit (DAA). The DAA has a high input impedance -- 90Kohms +/- 30K -- and can be driven as either a single-ended input (TX+) or differential inputs (TX+, TX-).

In addition to the DAA, I would like to have a headphone output that will be used only for debug purposes.

1. What circuitry should I use to drive a high-impedance input, sometimes by itself, sometimes in parallel with the low-impedance headphones?

2. If the DAA uses only the Left channel and the headphones get Left and Right, how should I terminate the unused channel? Would it be simpler to use just the single channel for the headphones as well? Would it be better to mix the two channels prior to feeding them into the DAA?

3. Is there a simple way to set up Left and Right channels as differential outputs, using them to drive TX+ and TX-? What would that sound like on the headphones?

Hannu
User
Posts: 13
Joined: Mon 2016-05-30 11:54

Re: Line out, Line in and Headphone connections

Post by Hannu » Tue 2017-12-12 9:28

Hello!

Welcome to the VSDSP-forum.
SyncOrSwim wrote:
Fri 2017-12-08 18:10

1. What circuitry should I use to drive a high-impedance input, sometimes by itself, sometimes in parallel with the low-impedance headphones?
Developer board has both connections. http://www.vlsi.fi/fileadmin/evaluation ... 18-sch.pdf
Any passive split circuit however will change the line out signal so putting opamp driving the headphones, would give best results. That way VS1005 will see nice high impedance without nasty reactive component. On the other hand if the phones are used during software design but aren't used during production the simple passive split could be OK.
2. If the DAA uses only the Left channel and the headphones get Left and Right, how should I terminate the unused channel? Would it be simpler to use just the single channel for the headphones as well? Would it be better to mix the two channels prior to feeding them into the DAA?
VS1005 audio paths work on stereo samples. There is example in getting started application note how to put something on the audio path. http://www.vlsi.fi/fileadmin/app_notes/ ... tarted.zip
Example is on input side but in your application it should be output side.

At the end the audio processing driver is loaded and you can happily write to the stdaudioout or route it to other drivers.

Here is how I monofy audio usually. I just wrote it again to this post, so it is untested...

Code: Select all

/* Assumption: 16-bit samples */
#define MY_SAMPLES 32
s_int16 myAudioBuf[MY_SAMPLES *2];
u_int16 MyWrite(FILE * self, s_int16 buf, u_int16 sourceIndex, u_int16 bytes){
  s_int16 *l = buf + (sourceIndex >> 1), *r = buf +1 + (sourceIndex >> 1);
  u_int16 i, samples = bytes / 4; /* Doesn't protect silly byte count. */
  while (samples) {
    u_int16 chunk = samples;
    s_int16 *target = myAudioBuf;
    if (chunk > MY_SAMPLES)chunk = MY_SAMPLES;
    samples -= chunk;
    for (i = 0; i < chunk; i++){
      /* - 6dB but val won't overflow */
      s_int16 val = *l >> 1;
      val += *r >> 1;
      l += 2;
      r += 2;
      *target++ = val;
      *target++ = val; /* If inverted right channel is wanted put - val */
    }
    fwrite(outOrig, myAudioBuf, chunk *2);
  }
  return bytes;
}

3. Is there a simple way to set up Left and Right channels as differential outputs, using them to drive TX+ and TX-? What would that sound like on the headphones?
Is multiplying one channel by -1 simple enough :) See the comment of my sample code above.
Listening differential pair sounds almost like mono but funny.

And as just a reminder... Read chapter 7.1 of the VS1005 datasheet carefully

Post Reply