[alsa-devel] Noise in tlv320aic3104-based audio system

Caleb Crome caleb at crome.org
Fri Oct 30 00:51:33 CET 2015


On Thu, Oct 29, 2015 at 4:40 PM, Rick Mann <rmann at latencyzero.com> wrote:
> Thanks, Caleb, answers below:
>
>> On Oct 29, 2015, at 16:08 , Caleb Crome <caleb at crome.org> wrote:
>>
>> On Thu, Oct 29, 2015 at 2:56 PM, Rick Mann <rmann at latencyzero.com> wrote:
>>>
>>>> On Oct 29, 2015, at 14:21 , Benoît Thébaudeau <benoit.thebaudeau.dev at gmail.com> wrote:
>>>>
>>>> Dear Rick Mann,
>>>>
>>>> On Thu, Oct 29, 2015 at 8:59 AM, Rick Mann <rmann at latencyzero.com> wrote:
>>>>> I have a custom cape on a Beaglebone Black that uses a tlv320aic3104, connected to a tpa3140d2 audio power amp. I currently manually control the /shudown pins on the two ICs, and just turn them on before doing anything else.
>>>>>
>>>>> The system works. But I notice that when I open the output device for writing (via libao), I immediately hear hiss, even before I send any samples to the device. After I close the libao audio device, a few seconds later Linux sends some i2c commands to the tlv320 and it's once again silent.
>>>>>
>>>>> The perceived amplitude of this hiss does not seem to be affected by "amixer set PCM <0 - 127>" calls.
>>>>>
>>>>> Does anyone have any idea where this noise might be coming from? Is it just thermal or other noise in the routing of audio within the tlv320? Is there some configuration or routing I might be able to change to avoid it? Did I screw up somewhere in my circuit design or layout that only manifests when linux configures the chip for operation?
>>>>>
>>>>> Any ideas are appreciated. Thanks.
>>>
>>> Thanks Benoit,
>>>
>>>> It could be many things, but here are a few ideas:
>>>> - Make sure that you have followed carefully the data sheets (CODEC +
>>>> amp) regarding the hardware schematic and layout. IIRC, the TLV has a
>>>> thermal pad that should be grounded.
>>>
>>>> - Make sure that the audio power supplies are clean enough. You can
>>>> derive them from more general-purpose power supplies if filtering is
>>>> added. The PCB layout must define a clear audio area, ideally with a
>>>> plane for the audio power supply on one of the layers. Even better,
>>>> you can use dedicated low-noise power supplies.
>>>
>>> I tried to follow the layout guidelines exactly. It's a four-layer board with a solid ground plane under the analog sections, and it's isolated from the digital ground. Here's a shot of the board:
>>>
>>>        https://camo.githubusercontent.com/833bde12303c9607259e486b8b301503dcc69a94/68747470733a2f2f6661726d312e737461746963666c69636b722e636f6d2f3637382f32313431393631383237305f303233336331643566355f682e6a7067
>>
>> FYI, Henry Ott's great book (Electromagnetic Compatibility
>> Engineering) strongly discourages the use of separate digital and
>> analog ground planes.  On modern mixed signal boards, they don't make
>> a lot of sense, and IIRC he says something to the effect of, "don't
>> use a separate ground plane even though manufacturers inexplicably
>> still recommend them". :-)    They key is physical separation of
>> analog and digital signals, not separate ground planes.
>
> Good to know; I'll get the book. Odd that manufacturers continue to recommend this. In any case, I do believe my digital and analog signals are separate.
>
> One thing I didn't do was pour ground flood on the top layer between traces.
>
Yeah, but your layout looked okay.  I wouldn't expect any serious
audio issues.  EMI is a different story -- the dual ground planes kill
EMI compatibility.


>> That said, which GND plane is your QFN pad connected to?  It looks to
>> be the analog plane, and where are the two planes connected together
>> (should be literally under the codec).
>
> It's connected to the analog ground. The digital and analog grounds are connected right under the large trace that brings the 14 V to the power amp. It's the short, fat blue trace on top of the fat purple trace. Just below the CODEC.

Okay, I see it now.  That should be okay I think.  Not perfect (i.e.
under the codec), but fine.

>
>> If the two planes are connected under the codec, then the layout looks
>> okay.  If they are not connected under the codec, or at least close,
>> and if you can dig out your ground planes, try soldering a solder
>> braid between them, jumpering from your QFM pad vias over to your
>> digital ground with low impedance solder braid (solder wick).
>
> I won't be able to do this.

yeah, but as it is, looks good enough.

>
>> What are L2 and L3 for?  LC filters on power supplies can get nasty if
>> you're not careful.  In fact, they're almost always nasty on power
>> supplies because they cause a strong resonance (there are exceptions
>> of course...).  You can try just shorting them out.
>>

I'd be interested in the results of shorting these out.  I don't
expect it to be your problem, but I suspect they are unnecessary.

>
> Pretty sure. You can see the individual layers and board photos here: https://www.flickr.com/photos/jetforme/albums/72157658301949316, but I just looked at the layer in my PCB software again, and I don't think I missed any.

I
>
>>
>>>
>>> Red is top layer, light blue is the ground plane (second layer), purple is the third layer, and dark blue is the bottom layer.
>>>
>>> There are dedicated LDOs for everything, fed from a main 5 V DC-DC converter. The main amplifier power comes from the main power input, which in this instance is a linear constant-current bench supply. It's also heavily LC-filtered, as per the data sheet guidelines.
>>
>> Where does it say to LC filter the power supply in the datasheet -- I
>> didn't see that.
>
> I followed the reference board (http://www.ti.com/tool/tpa3140d2pwpevm) design (sorry, conflated the two). The EVM's datasheet has schematics.

Ah, I'll take a look..

>
>>> The biggest reason I'm fairly sure it's not the board layout is that the noise is dramatically reduced when the ALSA audio device is not open, even though the ICs are powered and enabled.
>>
>> Yeah, but the DAC isn't enabled I believe -- it often gets shut off
>> even though the chip is enabled.
>
> Agreed. Kinda sad the DAC generates so much noise even when receiving no samples.

No, it's not too sad, that's how it's supposed to work :-) .  It's
just the nature of sigma-delta conversion.  The key is that none (or
very little) of that noise should be in the audible band.

>>>
>>>> - If possible, you can also listen to the TLV outputs directly
>>>> without the amp in order to know if it's caused by the amp or before
>>>> it in the audio chain.
>>>
>>> Hmm, not sure how to listen to them. But like I said, I don't think it's caused by the amp. Once the CODEC is reset by ALSA, the noise stops, even though the amp remains powered.
>>>
>>> I tried to look at the output on an oscilloscope, but this has proved challenging.
>>
>> Very difficult with a scope.  You can use an LC filter for that, but
>> even so, there i still a ton of high frequency crud left due to the
>> sigma delta dacs.  Much better to use a pro audio sound card with pro
>> audio level balanced inputs like RME Fireface or Lynx.  There are many
>> others, though I'm only really familiar with the fireface.
>
> Haha! That's amusing. I don't have the budget for that, sadly. Are you in the Bay Area? Can I come over?

Yep, in mountain view :-)  Just send me a direct email and we can set
up a lunch debug.

>
> Thanks for taking a look at this, Caleb, I appreciate it.


No problem,
  -Caleb


More information about the Alsa-devel mailing list