http://bugs.winehq.org/show_bug.cgi?id=14717
--- Comment #84 from Alexander E. Patrakov patrakov@gmail.com 2010-12-27 12:17:20 CST --- (In reply to comment #82)
It doesn't look like there is any true default quality. You can set it to good or best or whatever but it all seem to depend on the soudcard drivers. I tried it with two different cards and the quality is different at the same windows setting.
After experimenting with sb16 and ac97 in kvm, I must conclude that their Windows drivers use exactly the same resampler (I don't know if it is something default or just a coincidence), and it is not a zero-order-hold.
Technique of the experiment:
1. Create a wav file with 44.1 kHz sampling rate, containing 15 or so seconds of silence.
2. Create a wav file with 32 kHz sampling rate, containing several separated pulses of a known amplitude. I did this with a python script.
3. Put the follofing in your .asoundrc (assuming that your card supports 44.1 kHz):
pcm.filetee { type file file "/tmp/out.wav" slave.pcm "hw:0" format "wav" }
4. Start Windows XP in kvm as follows:
QEMU_AUDIO_DRV=alsa QEMU_ALSA_DAC_DEV=filetee QEMU_ALSA_ADC_DEV=hw:0 QEMU_AUDIO_DAC_FIXED_SETTINGS=0 QEMU_AUDIO_ADC_FIXED_SETTINGS=0 QEMU_AUDIO_DAC_TRY_POLL=0 QEMU_AUDIO_ADC_TRY_POLL=0 kvm -m 512 -soundhw ac97 -hda hda.dsk
(or with -soundhw sb16, but then you have to install the driver inside Windows XP)
5. Transfer foobar2000 installer and test wav files into Windows XP.
6. Open the silent wav file in Windows Media Player and the crackling one in foobar2000.
7. While the silent wav file is still playing, copy /tmp/out.wav somewhere else.
8. Examine the resulting wav file with a hex editor.
9. Note a particular sequence of non-zero non-header bytes in sb16 wav file, search for it in the ac97 wav file.
The worst quality setting has two or three output samples influenced by each input sample, the medium quality has the response width of 29 samples, and the best quality (default in the fresh XP install) has the response width of 79 output samples (1.8 ms). As I said, all of this is for the 32000 -> 44100 Hz resampling.
Further experimentation with 8000 -> 48000 Hz resampling reveals that the worst quality setting is in fact linear interpolation (so it is still better than the current zero-order hold in wine).