Hi,
Well it more of a request for adoption than an RFC.....
If someone else wants to pick this up feel free. I am kind of blocked on time. Over the course of the past year the discussion about need for an audio test has come up from time to time. Using a WAV file with PlaySound is too massive due to using embedded resources so next we looked at using an embedded mp3 and the wineacm codec. This would be interesting because then we could have something like the sound of a wine bottle being popped or wine being poured but Alexandre said he would rather have a simple test so I elected to rip Francois winmm audio test as a base.
As for where to take it from here I am kind of at a loss. The more and more I think about it there could be even better ways to test audio by using DirectSound to generate a set of tones if thats even possible. 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. Also how to handle the case where it does not work is rather interesting as right now my little messagebox does nothing, but if we implement the help system Jacek suggested we could provide information on how to debug sound problems linked from the dialog. Last but not least this sound is kind of boring so someone else that understands this code better can add some sort of modulation to the tone to make it more appeling. If it was writting in Qbasic I could have pulled it off but as it stands this is the best your going to get from me. I learned a good bit over the 8 or 10 hours it took me to strip it down so its not a total loss even if its rejected.
If no one else wants to work on this and Alexandre does not hate it then I will submit to wine-patches on Monday sans DEBUGING enabled in a proper git diff.
Peace
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