Molle Bestefich wrote:
James Courtier-Dutton wrote:
I have not looked at the wine source code lately, but I would advise you
that it would be sensible to talk to the sound card at only the 48000 Hz
rate.

alsa-lib does do resampling currently, but it has some importance
constraints that I think are incompatible with wine. I would therefore
recommend that wine does it's own resampling to 48kHz before
passing sound to alsa-lib.

What are the constraints?

In time alsa will remove the resampling constraints present in alsa-lib,
but that fix is not expected any time soon.

Seems to me that it would take less development resources to fix an
existing resampling implementation with known restraints, than to code
a new one.  Also it would end up helping more people.

If someone from the Wine community wants to fix the existing ALSA
resampler, what needs to be done?

As most windows applications running on wine tend to use the 44.1kHz
rate, that will cause problems with the current alsa-lib. So, if wine
want windows games to work better with sound when using alsa-lib, I
would recommend wine doing the resampling.

What sound API is used on Mac OS X?
Does that API require Wine to do resampling, or do things work OOTB there?

The possible so called "fix" is still a long way off. It requires a lot of work. As there are only a few alsa developers, that means it will take a long time. We each have rather long TODO lists currently and would welcome any offer to help ALSA development. Resampling is not a simple problem to fix. The technically best solution is for the application to do the resampling before passing it to the sound card, so any effort to do it in the sound drivers is always going to be sub-optimal, with sound quality suffering. The current alsa method achieves resampling with minimal effort, but presents some constraints to the application. These "constraints" are only a problem for closed source applications. In order to reduce the "constraints" so that ALSA works better with wine will result in trade offs. I.e. better compatibility with binary only application, but increased sound latency due to the required extra double buffers.
I will document the "constraints" when I get a moment.

James









Reply via email to