[Bug 19523] winmm: Multiple waveOutOpen calls on single device supported by Windows, not Wine

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Nov 7 21:06:45 CST 2010


Raymond <superquad.vortex2 at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |superquad.vortex2 at gmail.com

--- Comment #6 from Raymond <superquad.vortex2 at gmail.com> 2010-11-07 21:06:44 CST ---
(In reply to comment #3)
> of course, there is...
> let's take the wave out driver interface as example:
> DWORD WINAPI wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
>                         DWORD_PTR dwParam1, DWORD_PTR dwParam2);
> in case wMsg in WODM_OPEN, dwUser is expected to be a pointer to a DWORD, that
> the driver is supposed to filled with a unique instance ID (to identify the
> stream)
> in other (subsequent) messages, winmm passes in dwUser the unique ID defined by
> the driver at WODM_OPEN time
> winmm correctly supports this scheme (see MMDRV_Open in dlls/winmm/lolvldrv.c)
> but, none of the wine drivers correctly initialize the dwUser while processing
> the various XXXX_OPEN messages
> it works as it is because most of the drivers only support a single instance,
> hence any value for the unique ID will do

it is possible to modify winealsa.drv to support multiple waveoutopen but the
wavemapper  masacm32.drv/wavemap.c seem use dwInstance for

    WAVEMAPDATA*    wom = (WAVEMAPDATA*)dwInstance;

Especially when the "Test Audio" button in winecfg use idw_testsound.wav which
is "IMA ADPCM" format

Although wineesd.drv support multiple waveoutopen , but the implemenation seem
wrong since it appear as 10 Esound Waveout and Wavein audio drivers in winecfg
and 10 sound cards rightmark3dsound

When try to implement multiple voices in winealsa by declaring 16 voices in
WINE_WAVEDEV and try to use dwUser to represent the index of voice ,

How can I return the index of voice to wine in wodOpen() and wodPlayer() of
winealsa.drv/waveout.c so that wine can pass  the index of voice back to
subsequent wod* functions ?

BOOL WINAPI DriverCallback(DWORD_PTR dwCallBack, DWORD uFlags, HDRVR hDev,
DWORD wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2);

#define MAX_ALSA_VOICE 16

typedef struct {

    char*                       pcmname;                /* string name of alsa
PCM device */
    char*                       ctlname;                /* string name of alsa
control device */
    char                        interface_name[MAXPNAMELEN * 2];

    /* DirectSound stuff */
    DSDRIVERDESC                ds_desc;
    DSDRIVERCAPS                ds_caps;

    /* Waveout only fields */
    WAVEOUTCAPSW        outcaps;

    /* Wavein only fields */

    WAVEINCAPSW                 incaps;
    DWORD                       dwSupport;

    struct {
         volatile int        state;            /* one of the WINE_WS_ manifest
constants */
         WAVEFORMATPCMEX    format;
         WORD            wFlags;
         WAVEOPENDESC        waveDesc;

         snd_pcm_t*             pcm;                    /* handle to ALSA
playback device */

         snd_pcm_hw_params_t *  hw_params;

         DWORD                  dwBufferSize;           /* size of whole ALSA
buffer in bytes */
         LPWAVEHDR        lpQueuePtr;        /* start of queued WAVEHDRs
(waiting to be notified) */
         LPWAVEHDR        lpPlayPtr;        /* start of not yet fully played
buffers */

         LPWAVEHDR        lpLoopPtr;              /* pointer of first buffer in
loop, if any */
         DWORD            dwLoops;        /* private copy of loop counter */

         DWORD            dwPlayedTotal;        /* number of bytes actually
played since opening */
         DWORD            dwWrittenTotal;        /* number of bytes written to
ALSA buffer since opening */

    /* synchronization stuff */
         HANDLE            hStartUpEvent;
         HANDLE            hThread;
         DWORD            dwThreadID;
         ALSA_MSG_RING        msgRing;
         snd_pcm_sframes_t      (*read)(snd_pcm_t *, void *, snd_pcm_uframes_t

         snd_pcm_sframes_t      (*write)(snd_pcm_t *, const void *,
snd_pcm_uframes_t );

         DWORD            dwPartialOffset;    /* Offset of not yet written
bytes in lpPlayPtr */

         DWORD            dwPeriodSize;        /* size of OSS buffer period */
         DWORD            dwTotalRecorded;
         snd_hctl_t *           hctl;                    /* control handle for
the playback volume */
    } voice[MAX_ALSA_VOICE];


Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list