RFC - winecfg audio test

Jan Zerebecki jan.wine at zerebecki.de
Mon Apr 9 15:15:08 CDT 2007


On Fri, Apr 06, 2007 at 04:07:53PM -0400, Steven Edwards wrote:
> It would be cool if it was because then we could do a series of tests
> like a short tone testing WinMM then another short tone testing
> DirectSound. This might help users that have choppy sound or missing
> sound in games but not in other apps.

Problems with dsound are usually bugs in Wines dsound code, so a
button for users IMHO doesn't help. Maarten Lankhorst is
currently working on extending the dsound wine test cases with
something to reproduce some of these bugs and also on fixing
them. Generic configuration errors of sound will result in both
winmm and dsound failing.

> + * Note that in most of this test we may get MMSYSERR_BADDEVICEID errors
> + * at about any time if the user starts another application that uses the
> + * sound device. So we should not report these as test failures.

I'm not sure if this is the behaviour we want for a functionality test.

> +#ifdef DEBUG
> +    sprintf(name, "%d", device);
> +#endif

It's better to use less macros, maybe by replacing this with (but
I'm not sure if that from then would be fine for AJ):

    if(DEBUG_FOO) {
        sprintf(name, "%d", device);

When the top of the file has something like:

    #ifndef DEBUG_FOO
        /* set to 1 to get WINEDEBUG etc. with winedbg */
        #define DEBUG_FOO 0
    #endif


> +const char* mmsys_error(MMRESULT error)
> +{
> +#define ERR_TO_STR(dev) case dev: return #dev
> +    static char	unknown[32];
> +    switch (error) {
> +    ERR_TO_STR(MMSYSERR_NOERROR);
> +    ERR_TO_STR(MMSYSERR_ERROR);
> +    ERR_TO_STR(MMSYSERR_BADDEVICEID);
> +    ERR_TO_STR(MMSYSERR_NOTENABLED);
> +    ERR_TO_STR(MMSYSERR_ALLOCATED);
> +    ERR_TO_STR(MMSYSERR_INVALHANDLE);
> +    ERR_TO_STR(MMSYSERR_NODRIVER);
> +    ERR_TO_STR(MMSYSERR_NOMEM);
> +    ERR_TO_STR(MMSYSERR_NOTSUPPORTED);
> +    ERR_TO_STR(MMSYSERR_BADERRNUM);
> +    ERR_TO_STR(MMSYSERR_INVALFLAG);
> +    ERR_TO_STR(MMSYSERR_INVALPARAM);
> +    ERR_TO_STR(WAVERR_BADFORMAT);
> +    ERR_TO_STR(WAVERR_STILLPLAYING);
> +    ERR_TO_STR(WAVERR_UNPREPARED);
> +    ERR_TO_STR(WAVERR_SYNC);
> +    }
> +    sprintf(unknown, "Unknown(0x%08x)", error);
> +    return unknown;
> +#undef ERR_TO_STR
> +}

Is there no API function for this?

> +    /* Send the tone to each device. I have no idea how this will play out
> +     * as my system only has one sound device
> +     */

Possibly we should only play on the default device or better use
a selector for which device to use if users really want to test
the others (otherwise how do they know e.g. which one fails?).

(BTW I only skimmed the patch...)


Jan




More information about the wine-devel mailing list