Author Topic: Lazy developer problems.  (Read 888 times)

0 Members and 1 Guest are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4276
  • Country: gb
Lazy developer problems.
« on: June 28, 2024, 04:47:53 pm »
I've been annoyed by lots of noise on my headphone amp.  I have also found I am using a LOT of gain.

The PC sends digital audio to an STM32h7 which splits it into two stereo output channels and applies a different EQ to each.  One goes via a DAC to the headphones and the other to the speakers. 

The headphones however have the "bigger" EQ.  In particularly a LOT of bottom sub shelf.  The headphones "might" handle it, the speakers ... no point.

What is occurring is, any music which is rich in those frequencies is busting the digital limit and causing hard clipping and/or rollover.  So I have to keep backing down the source input volume to not clip the output.

This ends up with the main "volume" and gain structure being trashed.  All the gain has to be added at the final stage from 0db.  So I'm pushing x10 gain on the output amp and getting x10 noise.

The fix is easy.  Back down the low shelf, move a few other bands around.  Stop over boosting frequencies.

The problem is...  the box has no API.  No UI.  If I want to even change the shelf frequency it's a code change.  My STM32Cube IDE isn't even working and has been upgraded.... more importantly I can't be a.sed.

It's 2024 and I am a professional software engineer and yet... here I am.

Do plumbers' houses really have leaks?

I even have (I recall) severally partial limiter solutions, both hard and soft.... just not finished and flashed to the device!
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6946
  • Country: fi
    • My home page and email address
Re: Lazy developer problems.
« Reply #1 on: June 28, 2024, 06:58:45 pm »
Do plumbers' houses really have leaks?
Human psychology is weird, innit?

I can write a 600-line proof of concept implementation in a couple of hours just to show an example of an algorithm I had outlined earlier in that thread, just for fun, only when nobody asks me.  If someone does ask, I get a creative block, fail, and have to take a day or two off.  Granted, my neural pathways are all sorts of fracked up from (self-induced work-related) stress, burnout, and recurrent depression, but still.
 


Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: nz
Re: Lazy developer problems.
« Reply #3 on: June 28, 2024, 11:11:14 pm »
Do plumbers' houses really have leaks?

"The cobbler's children go barefoot"

In a book of proverbs published in 1546, but surely much older.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4276
  • Country: gb
Re: Lazy developer problems.
« Reply #4 on: June 30, 2024, 10:14:26 am »
Perhaps what you need is what I just finished building, a headphone amplifier using the TPA6120 on a board from Ebay:

Mine is 100% custom PCB with 3x OPA551s.  "Mckoy" architecture IIRC. 1 per channel and 1 to reinforce the virtual ground.

It's been exonerated and declared "clean".  If I set it's gain to 100% and pull the input jack, it's 100% silent.  The noise is coming from the STM32H7 board and it's buck power supply and all the digital USB ground noise in my office.  Much harder to get rid of.  So the end-game plan, another unfinished project, is to run it all on battery (while in use) and charge when not in use.  Remove the USB interconnect and make it optical.  Then I only need to fight the "inherent" noise of the devices themselves.

Off topic, but more as a note to myself.  All "analogue side" power and grounds can be directly "starred" to the battery terminals and thus not mixed with the digital board plane.
« Last Edit: June 30, 2024, 10:20:58 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: au
Re: Lazy developer problems.
« Reply #5 on: June 30, 2024, 10:50:31 am »
Any way to add a low noise differential to single ended x10 amp between the DAC out and your headphone amplifier input to deal with the digital noise?
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4276
  • Country: gb
Re: Lazy developer problems.
« Reply #6 on: July 05, 2024, 04:48:04 pm »
Any way to add a low noise differential to single ended x10 amp between the DAC out and your headphone amplifier input to deal with the digital noise?

Im not sure I get you, however, it did get me to thinking.  The DACs are working with a max of 0db input.  It's likely that makes their line outputs 0db.  Isn't "Line level" either +3db of +10db depending on what bit of the audio stack you are in?  The +db being to lift the signal over the inherent noise in the "line"?

So if I am just asking the DAC to output what it gets in, it's going to by output 0db on the line.  Requiring an s ton of gain.

Needs researched though.  Datasheets.

Crap.  My db, dbm, dbmV, dba are out of date and "off".  More restudy.
« Last Edit: July 05, 2024, 04:50:45 pm by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf