Shop OBEX P1 Docs P2 Docs Learn Events
Headphone Direct Drive - Page 2 — Parallax Forums

Headphone Direct Drive

2»

Comments

  • pik33pik33 Posts: 2,366
    edited 2021-02-22 11:53

    We don't need any caps if we use a bridged/balanced mode DACs, 2 of them driving one audio signal, one "straight", one "mirrored", so no DC will be sent to the headphones and no caps/amps needed. Using 75 OHm 2V configuration the output power to 32 Ohm headphones will be ~3.8 mW (sine wave) and this means over 100 dB even on low sensitivity headphones, enough if you don't want your ears destroyed.


    Today (will be delivered tomorrow) I bought a Behringer 1002 FX mixer - a not very expensive (330 PLN =~$90) solution to all quantum entangled audio cables on the desktop and amplifier/not amplifier problem. I haveat least 3 raspberries, a microphone and now a P2, all of this needs connecting to the amp and/or headphones.

  • kubakuba Posts: 94
    edited 2021-02-22 18:56

    Even with cheap 3-terminal "shared common" headphones, one can use four P2 pins and things work fine: two paralleled pins to drive the COMmon around mid-supply, and then L/R driven from one additional pin each. Since lots of common low frequency is delivered to both channels, the COM can be driven to an extent in antiphase to the average of L and R, as long as it's not driven so deeply that it'd run the L and R out of headroom. Two pins are way cheaper than massive capacitors. It's not like P2 has a pin shortage :)

    For "plain" line outputs that can't be assumed to have a floating ground, and also for applications where higher drive voltages are needed, audio can be driven by doing current control through a SMPS isolation transformer (tiny surface-mount one). The audio waveform is then the average current.

  • cgraceycgracey Posts: 14,152
    edited 2021-02-22 19:39

    @kuba said:
    Even with cheap 3-terminal "shared common" headphones, one can use four P2 pins and things work fine: two paralleled pins to drive the COMmon around mid-supply, and then L/R driven from one additional pin each. Since lots of common low frequency is delivered to both channels, the COM can be driven to an extent in antiphase to the average of L and R, as long as it's not driven so deeply that it'd run the L and R out of headroom. Two pins are way cheaper than massive capacitors. It's not like P2 has a pin shortage :)

    For "plain" line outputs that can't be assumed to have a floating ground, and also for applications where higher drive voltages are needed, audio can be driven by doing current control through a SMPS isolation transformer (tiny surface-mount one). The audio waveform is then the average current.

    Maybe just make a virtual ground at VIO/2 using a P-FET and N-FET, controlled by internal DAC comparisons of level $80? That could be a very low-Z "ground". I'm thinking that just using DAC pins for "ground" would allow cross-talk. A low-Z "ground" with two 75-ohm DACs ganged for each channel would certainly work.

    What do you have to say about the L-R separation problem with a "ground" that is more than 0 ohms?

  • ErNaErNa Posts: 1,752

    Why not just have 3 pins 1, 2, 3, two forming common, 1, 3 the audio and pin 2 can be any level needed? The loudspeaker sees only voltage difference.

  • cgraceycgracey Posts: 14,152

    @ErNa said:
    Why not just have 3 pins 1, 2, 3, two forming common, 1, 3 the audio and pin 2 can be any level needed? The loudspeaker sees only voltage difference.

    I'm thinking the dynamic load of each speaker would create huge cross-talk. Wouldn't it?

  • ErNaErNa Posts: 1,752

    a test shouldn't be a hurdle..

  • cgraceycgracey Posts: 14,152

    Here is what sounds good:

    P0 ----(+)1000uf-----Left
    P1 ----(+)1000uf-----Left
    P2 ----(+)1000uf-----Right
    P3 ----(+)1000uf-----Right

    These electrolytic aluminum caps are 10mm wide and 18mm tall and cost 10 cents each. "Ground" is really ground this way.

    This also keeps the impedance down by not placing DACs in series, but paralleling them to get 37.5 ohms impedance for each headphone channel.

    This setup is sufficiently loud, too. Bass sounds good. I think this is as practically pure as we can get for headphones.

  • jmgjmg Posts: 15,173

    @cgracey said:
    Here is what sounds good:

    P0 ----(+)1000uf-----Left
    P1 ----(+)1000uf-----Left
    P2 ----(+)1000uf-----Right
    P3 ----(+)1000uf-----Right

    These electrolytic aluminum caps are 10mm wide and 18mm tall and cost 10 cents each. "Ground" is really ground this way.

    This also keeps the impedance down by not placing DACs in series, but paralleling them to get 37.5 ohms impedance for each headphone channel.

    This setup is sufficiently loud, too. Bass sounds good. I think this is as practically pure as we can get for headphones.

    Can you hear the difference. if you then wire P1//P1 and P2//P3 and use a single 1000uF cap on the ground common ?

  • roglohrogloh Posts: 5,787
    edited 2021-02-23 01:29

    Interesting, maybe an updated higher quality A/V board could be made with something like this on it (no VGA):

    1 x svideo mini-din (Y/C) connector
    3 x rca - composite/digital audio (you could bring out Y/C as individual RCAs as well)
    1 x 3.5mm mic socket
    1 x 3.5mm headphones using 1000uF paralleled paths

    P0 - svideo Y, or general RCA
    P1 - svideo C, or general RCA
    P2 - rca - could be used for or digital audio, or composite video output
    P3 - mic input via 3.5mm
    P4 - left audio with 1000uF
    P5 - left audio with 1000uF
    P6 - right audio with 1000uF
    P7 - right audio with 1000uF

    Edit: You could swap the VGA connector on the existing board for the mini-din and potentially also add a toslink optical out next it it.

  • jmgjmg Posts: 15,173

    @cgracey said:
    Maybe just make a virtual ground at VIO/2 using a P-FET and N-FET, controlled by internal DAC comparisons of level $80? That could be a very low-Z "ground".

    Problem there is the FET thresholds, so it is hard to avoid cross-over effects in simple circuits.
    Ideal is a true linear amplifier, biased to give the virtual ground.
    The DDR regulators are designed to deliver about 50% VCC and source and sink current. An AP2303MTR has < 10mV tracking offset, and < 11mOhms Zo. 10c/1k (similar is RT9199GSP)

    @cgracey said:
    I'm thinking that just using DAC pins for "ground" would allow cross-talk. A low-Z "ground" with two 75-ohm DACs ganged for each channel would certainly work.
    What do you have to say about the L-R separation problem with a "ground" that is more than 0 ohms?

    That would be an issue, on any high Z virtual ground point. However, it may be 'near enough' to just use a single large cap on the common ground terminal to establish virtual ground.
    Crosstalk at higher frequencies is then very low, and it degrades at very low frequencies, where it is harder to hear anyway.

  • AribaAriba Posts: 2,690

    For a virtual Ground, you can use a digital pin that outputs a squarewave with 100kHz or more. This should have an output resistance of about 30 Ohm in 'fast' mode.

    Andy

  • cgraceycgracey Posts: 14,152
    edited 2021-02-23 05:06

    I tried the single cap to ground for the virtual GND and it worked okay. The cross-coupling was barely audible. I kind of like the pins going through big caps, though, because the pins will never be in DC contention and we can use the real ground. That arrangement sounds really good, too. It takes two pins in 75-ohm mode to make a sufficiently-loud headphone channel with proper 37-ohm impedance. So, four pins and four caps, total, and we have a clean headphone driver.

  • What does the audio software have to do to source the two DACs from the same signal, just use a Smartpin neighboring pin or something else?

  • I'm not saying that this is a good idea, because it probably isn't. >:) But every P2 system has a 1.8v "virtual ground."

    Something to keep in mind about capacitors: I damaged some earbuds by plugging them into a capacitively coupled speaker output. I didn't overdrive them, it was the DC transient pop. 2000uF is a lot of capacitance. 1.65v shouldn't be enough to damage headphones. We would have the DAC impedance limiting current as well. Some DACs might do a ramp from zero to midpoint to prevent the pop. On the P2 we could just switch to ADC mode for a little while. I still think the caps are a better idea than grounding to the 1.8 rail.

  • cgraceycgracey Posts: 14,152

    @rogloh said:
    What does the audio software have to do to source the two DACs from the same signal, just use a Smartpin neighboring pin or something else?

    For WRPIN, WYPIN, DRVx, FLTx, just do 'firstpin ADDPINS 1'. That will always set the second pin to the same exact settings.

  • cgraceycgracey Posts: 14,152

    @SaucySoliton said:
    I'm not saying that this is a good idea, because it probably isn't. >:) But every P2 system has a 1.8v "virtual ground."

    Something to keep in mind about capacitors: I damaged some earbuds by plugging them into a capacitively coupled speaker output. I didn't overdrive them, it was the DC transient pop. 2000uF is a lot of capacitance. 1.65v shouldn't be enough to damage headphones. We would have the DAC impedance limiting current as well. Some DACs might do a ramp from zero to midpoint to prevent the pop. On the P2 we could just switch to ADC mode for a little while. I still think the caps are a better idea than grounding to the 1.8 rail.

    I was thinking about this. You could put a 100k-100k divider on each Px pin, which connects to one side of the cap, then put a 100k to ground on the other side of the cap that the headphone channel connects to. That would keep things safely biased. I think just a resistor to ground on each headphone side would be sufficient.

  • Ahle2Ahle2 Posts: 1,179
    edited 2021-02-23 13:14

    @cgracey said:
    Here is what sounds good:

    P0 ----(+)1000uf-----Left
    P1 ----(+)1000uf-----Left
    P2 ----(+)1000uf-----Right
    P3 ----(+)1000uf-----Right

    These electrolytic aluminum caps are 10mm wide and 18mm tall and cost 10 cents each. "Ground" is really ground this way.

    This also keeps the impedance down by not placing DACs in series, but paralleling them to get 37.5 ohms impedance for each headphone channel.

    This setup is sufficiently loud, too. Bass sounds good. I think this is as practically pure as we can get for headphones.


    Is this the circuit you have been testing?

    The total impedance of each channel would end up being around 37.5 Ω + 32 Ω = ~70 Ω using common headphones, so that would give a highpass filter with a -6dB cut-off frequency of around 2 millihertz. That capacitance can be much smaller without making the bass thin. Also electrolythic capacitors are considered bad practice in any analog audio chain. The devil is in the details and nothing is as easy as one would think; There are complete books written about capacitors and analog signals. This is a huge topic.

    Listen to this very knowledgeable man...

    The damping factor will also be extremely low, so all kinds of ringing/resonance phenomenon will occur thanks to the capacitors and the headphones (inductance) basically forms a series resonance circuit.

    This really needs some serious research and empirical testing before making a standard Parallax board of any kind.

  • cgraceycgracey Posts: 14,152
    edited 2021-02-23 15:20

    Ahle2, that's pretty much the circuit, except there's a 1000uF (not millifarad) capacitor on each pin. The other side of the two caps get tied together to form each channel.

    I know electrolytics are lousy, but it still sounds better than the headphone amp we have on the A/V board.

    I will watch that video.

  • cgraceycgracey Posts: 14,152

    I just watched that video. It was kind of interesting. He was calling microfarads millifarads, though. Anyway, he said that the electrolytic's deficit can be overcome by putting a small high-quality cap in parallel with a large electrolytic. We could easily do that. That would keep the cost down and the quality up.

  • Ahle2Ahle2 Posts: 1,179

    Oooh... sorry, I put the wrong value in the equation. :neutral: 1000 uF gives a cut-off of 2.27 Hz. That's much better. The other stuff about damping factor and resonance still applies though. You will have to connect your scope and see what's happening when outputting a square wave in the audio spectrum range.

    Btw I agree about anything being better than that IC. :wink:

  • RaymanRayman Posts: 14,646

    I'm surprised this could sound better than MAX4411...

    My computer speakers have a headphone socket. I'm wondering if just 2 pins could feed these powered speakers...

Sign In or Register to comment.