Skip to content

Really bad sound output #5

@asdplayer

Description

@asdplayer

I compiled and installed succesfully your kernel, but I got problems at runtime.
I used localmodconfig, and everything else is working. I also followed the
instructions given in this repository. I attached a dmesg and my kernel config that I used (I've renamed it to .txt just to upload it).
cx2072x_dmesg_while_using.log
cx2072x_kernel_config_4.19.4.txt

I tried to reproduce audio, but there are some problems.
Everything was also checked against a working USB soundcard, the Behringer UMC404HD, to rule out the most obvious issues in user software.

=== Play mp3/m4a/ogg/wav using Audacious player, to ALSA:
plays at 2x speed (and 2x pitch), with some noise, like gross aliasing.
The card is reported twice (this is normal I think), as:
-> sysdefault:CARD=chtcx2072x
-> usbstream:CARD=chtcx2072x
selecting the latter results in an error: "ALSA error: snd_pcm_open failed: Invalid argument." Why does it say "usbstream" anyway? The same is reported by aplay -L (list pcm outputs)

=== Play using Audacity editor, to ALSA:
plays at normal speed and pitch.
(There is consistent lagging of the UI when changing play/capture settings from the toolbars, while the soundcard is disabled and reinitialized many (~10) times, but this is fault of Audacity).

=== Play mp3/m4a/ogg/wav/video using Parole video player, which uses gstreamer, which uses PulseAudio:
There is major distortion, but playback speed is OK. See below for an hypothesis.

=== Play mp3/m4a/ogg/wav/video using VLC player, to ALSA:
Audio is played at 2x speed and 2x pitch, but is sinchronized to real time. So, some length of audio is played, then there is a void, then it restarts... At random intervals, maybe 3 gaps a second. The play time is therefore not shortened.
Using Pulseaudio backend instead of direct ALSA, VLC yelds the same exact result obtained from Parole.

=== Play test signals with kokkinizita's jaaa, through JACK, 1024 sample buffer:
I played various test signals.
Playing a 200 Hz sine:

  • There is a small high frequency distortion byproduct; there is maximum signal output about -42 dB (just under 8-bit noise level?), more than that produces harsh distorsion out of the soundcard. This seems like the wrong endianness is applied to the audio signal, so a small signal stays mainly in the center byte and is represented correctly; the least significant byte is over-represented resulting fundamentally in 1-bit error noise magnified by a 16-bit shift, and if the MSB is used, the signal is completely messed up.
  • 400 Hz output waveform is measured out of the soundcard (I used a tuner app and the Spectroid app on my mobile, and my ear roughly confirms), when no distorsion is happening. This seems like the codec is set for 96 kHz, while applications believe to play at 48 kHz (because they are so told) (but effectively they are requested twice the data per "real" time unit).
  • The 2nd (right) digital channel outputs sound to both channels of headphones and speakers. Playing the sample on the 1st (left) digital channel results in almost no sound, as if I were hearing just an analog crosstalk. (the 2nd channel is right, while the 1st is left, I think.)
    === Lowering buffer size to 256 samples or 128 samples:
    There is another type of problem in the signal output, I can't surely tell what that is. It's like the buffer cannot be less than 512 samples, and it is filled with 0's or random values if I choose a smaller buffer size. Sounds from audio players seem played at the right speed now, I'm not sure about pitch. It seems like the signal is mixed with another frequency that could be a byproduct of the incorrect handling of buffers. I have done guesswork measuring waveforms with a mobile phone, so it's just "wild" guesswork.

=== Playing various sounds through JACK, with synths and audio players:
Every application that outputs over around -45 dB of digital signal results is harsh distorsion out of the soundcard.
Some applications kind of work, they reproduce audio at 2x speed and 2x pitch, and output gets distorted over about -45 dB; they are: jaaa, synth_v1, audacious (which also has a JACK backend), yoshimi.
Some applications don't work, and sometimes wreck the JACK instance so that the JACK server is running, but no sound can be reproduced anymore by any application: mixxx, fluidsynth.
Bristol crashes 3 seconds after started, but that is kind of expected, as the code is old and unstable.
VLC (which has a JACK backend, too) sounds as before, pitch and speed are 2x, except that now intervals with and without sounds are equally spaced and have the same duration, like 50%/50%.

JACK is configured for "playback only", because I could not start it in "duplex" mode (so I only have output, and not input + output).
If I try to start JACK in duplex mode, it says something unhelpful like "overall operation failed", and in the dmesg log appear hundreds of these lines:
[ 177.914611] intel_sst_acpi 808622A8:00: sst: Busy wait failed, cant send this msg
This is a good topic for another report maybe.

EDIT:
My computer is the Asus E200H, the soundcard is the CX20723.
And some typo fixes.
And another thing: If you see the need, in a week's time I can attach an oscilloscope to the headphone output to diagnose further; by now I don't have time. Let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions