Strange distortions in ALSA audio playback
I hope this isn't a known issue; I've tried searching for it, but I have no idea how to describe it objectively...
Playback of Audio files sounds grainy and edgy with VLC when compared with playback of the same files from other programs such as Audacity. I really don't know how else to describe it: it's not definitely not clipping. It happens with VLC on both my laptop and my desktop. It doesn't seem to have anything to do with the format of the file being played, and applies equally to audio from videos as well.
I've noticed this issue for over a year, but it didn't really become so glaring until I got nicer soundcard/speakers.
Both machines are running Gentoo Linux. They have radically different sound cards (one is a laptop with an Intel "HD Audio" card, one is a desktop with a USB Creative E-MU card). Both are using ALSA for playback (no Pulseaudio).
In an effort to get some real data on this, I recorded the output of my laptop headphone jack with my desktop soundcard with Audacity, using both VLC and Audacity for playback on the laptop. Use something besides VLC to play them back.
(FLAC's are ~60MB, RAW's are ~120MB)
VLC playback FLAC: https://stuff.snarkywidgets.com/x/vlc-recordings/mozart-vlc.flac Audacity playback FLAC: https://stuff.snarkywidgets.com/x/vlc-recordings/mozart-audacity.flac
VLC playback RAW: https://stuff.snarkywidgets.com/x/vlc-recordings/mozart-vlc.raw Audacity playback RAW: https://stuff.snarkywidgets.com/x/vlc-recordings/mozart-audacity.raw
(The RAW files are 192KHz signed 24-bit PCM stereo (the hardware is capable of that). I left a good chunk of silence at the beginning to prove to myself there was little noise going on.)
The difference is really pretty significant IMHO. I haven't done any analysis on the differences because I don't really know what sort of patterns to look for...
I'd love to work on fixing this, but I'm completely unfamiliar with the VLC source; if somebody could give me a nudge in the right direction it would be extremely helpful.