Db410c square wave generation

i’ve been using the headphone output to generate a square wave and noticed a big difference in what the analog waveform looks like between two kernel versions. the test square wave is an 8khz 50% duty cycle waveform with 3 samples high/low. On the older qcomlt-4.4 kernel the waveform timing is preserved albeit with some ripple while the waveform in the newer qcomlt-5.15 kernel appears to be more heavily low pass filtered with timing that results in two samples high, zero, two samples low, zero. Ive attached the two outputs for reference.

The waveform was generated with audacity and im using aplay to output to the sound card. as far as i can tell the mixer settings in the rx path do not have a low pass filter other than the FIR in the analog front end just before the DAC. from the register documentation for the pm8916 register there appears to be no way to modify the FIR coefficients so i assume its the same in both cases. I have no LADSPA plugins. Could alsa/libasound be adding a filter? Im hoping for some additional ideas on how to track this issue down. Ultimately i do not want the filtered version of the square wave.

not filtered

i just tried playing the same square wave on the newer kernel with tinyalsa and i get the correct waveform so the issue has to be in alsa somewhere.

With alsa you can set up aplay to make sure it goes directly to the hardware player (e.g. aplay -Dhw:x,y). IIRC this bypasses pretty much all of the plugin code in libasound (compared to using the default stream or -Dplughw:x,y). Does that give the same results as tinyalsa?

hw and plughw both give the same filtered result…but now so does tinyplay after rechecking :frowning: