• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

DAC/ADC Generation Test Utility

  • Thread starter Thread starter JP
  • Start date Start date

JP

Major Contributor
Forum Donor
Joined
Jul 4, 2018
Messages
3,088
Likes
3,385
Location
Brookfield, CT
I doubt anyone needs this, but what the hell.

In case anyone wants to play with doing DAC/ADC generation testing and don't want to lose their life to the work, I created a utility in Python that orchestrates the generations and creating the files for you. It runs on Mac using CoreAudio in hog mode (bit perfect), and Windows using ASIO or WASAPI Exclusive.

The orchestration plays the WAV file of your choice and simultaneously records it through the DAC and ADC you select. It uses cross-correlation to align the audio and extract the same-length segment as the original. You specify the number of generations you want, and the number of iterations between "milestones" which will be saved to file. Included is the option for dynamic level compensation based on RMS level. I attempted a "calibrated" compensation mode but that doesn't work right yet.

Note: this was written by AI. I've tested thoroughly on Mac, but only via software loopback on Windows as I've only a VM readily available to me ATM. I'll dust off a physical machine in the next while, but if someone can confirm ASIO and WASAPI devices are working beforehand, that'd be great.

More details and download here.
 
Thanks! This looks interesting!

I managed to get it working in a virtual machine.

I'm trying to get it to work on a physical machine over the next few days. My sound card uses only one ASIO device and multiple channels within it. How do I get playback channels 9 and 10 to work when I'm using my ASIO device?
 
Last edited:

This adds the ability to specify device channels. It is completely untested. This code is not in the repo as I prefer that to be known working code.
 
Wow! That was fast! :cool:

I'll try that when I can use my physical sound card...
 
I just tested the version 0.1.1 with a real hardware and the device channel selection works. 10 rounds with ASIO was indistinguishable from the original when listening. WASAPI was skipping and stuttering for some reason, I need to investigate it further.

I tested with my cheaper sound card too. It has separate manually adjustable input level knobs and a small level difference between the channels adds up after 10 rounds and caused the left channel to distort and the right channel to drop in level:

1768592785041.png


Would it be a difficult task to equalize the volumes for both channels separately during the compensation phase? This is not a problem for your ADI-2 Pro FS R or my better sound cards, but many cards do have separate manual knob controls for the channels.
 

-p, --per-channel - apply compensation per channel. Only implemented for dynamic compensation.

Same deal - untested. If there's an issue it'll likely be awhile before I can look at it as I'll be away three of the next four weeks starting tomorrow.
 
Thanks again!

I don't have access to my cheaper sound card right now, but with a better card the program seems to correct for a constant 0.02 dB level difference between channels with each round, so I think it works.

Would it be too much to ask if you could make a basic gain adjustment for the original file? I can't use the unity gain on all my cards and on some hot mixed tracks my ADC distorts unless I drop the levels by a few decibels in Audacity before exporting it to a new file and feeding it into audio_gen_test

I hope I'm not pushing my luck... ;)
 
May be best to default per-channel as it’s highly likely for a small difference to exist. Will look at that later.

Not sure that I’ll add arbitrary source file gain adjustment, but I have thought about making sure the peak is 3-6dB down. Every run I’ve done with compensation the peak level moves around a lot. I’m not sure of all the use cases so doing so may be counter to some objectives.
 
When I reduce the initial level of the original file with Audacity by 4 dB, my ADC doesn't clip (It can't handle much more than 3 Volts when its preamplifier is bypassed and the signal is fed directly to the ADC chip while my DAC outputs over 4 Volts with the 0 dBFS signal)

Because there is no unity gain used, audio_gen_test just drops the gain by 2.37 to 2.39 dB with every round and the signal never gets distorted:

1768597910620.png
 

This is 200 iterations using --per-channel. You can look at the metadata file in the folder to see the peak behavior, which I find interesting.
 
Back
Top Bottom