Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2003 19:24:08 -0500
From:      Mathew Kanner <mat@cnd.mcgill.ca>
To:        Gerald Pfeifer <gerald@pfeifer.com>
Cc:        Travis Poppe <tlp@LiquidX.org>
Subject:   Re: The latest WINE and /dev/mixer*
Message-ID:  <20031228002408.GI20827@cnd.mcgill.ca>
In-Reply-To: <Pine.BSF.4.58.0312280037370.13134@acrux.dbai.tuwien.ac.at>
References:  <20031227144106.35943fff.tlp@LiquidX.org> <Pine.BSF.4.58.0312280037370.13134@acrux.dbai.tuwien.ac.at>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 27, Gerald Pfeifer wrote:
> Mathew Kanner wrote:
> > 	A brief look at the wine source shows that they are relying on
> > the SOUND_MIXER_INFO ioctl if defined.  We define it but we don't
> > support it [...]
> > 	We can't easily implement the ioctl because we don't carry
> > specific device string info with the mixer device.  (nor any of the
> > other fields in the struct mixer_info)
> 
> Ouch. Now that's _really_ bad!
> 
> That way we cannot even use autoconf to detect support for the
> SOUND_MIXER_INFO ioctl; why do we pretent to support something
> which we actually don't?

	I can see good arguments both ways.  My instinct says to have
all the IOCTLs that are defined in other OSes oss support and let the
app decide what to do.  I could be persuaded otherwise.

> 
> > 	An easy hack would be to #undef SOUND_MIXER_INFO at the top of
> > wine/dlls/winmm/wineoss/audio.c (but after the includes)
> >
> > 	Good luck, and if it works, please submit a PR with the patch
> > for the wine port.
> 
> Travis confirmed that this worked for him.  How about the patch below?
> 
> Index: audio.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/winmm/wineoss/audio.c,v
> retrieving revision 1.108
> diff -u -3 -p -r1.108 audio.c
> --- audio.c	12 Dec 2003 05:55:26 -0000	1.108
> +++ audio.c	27 Dec 2003 23:48:35 -0000
> @@ -544,10 +544,15 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE*
>                  strncpy(ossdev->out_caps.szPname, info.name, sizeof(info.name));
>                  TRACE("%s\n", ossdev->ds_desc.szDesc);
>              } else {
> -                ERR("%s: can't read info!\n", ossdev->mixer_name);
> +                ERR("%s: cannot read SOUND_MIXER_INFO!\n", ossdev->mixer_name);
> +#ifndef __FreeBSD__
> +                /* FreeBSD up to at least 5.2 provides this ioctl, but does
> +                 * implement it properly, so ignore errors on that platform.
> +                 */
>                  OSS_CloseDevice(ossdev);
>                  close(mixer);
>                  return FALSE;
> +#endif
>              }
>          } else {
>              ERR("%s: %s\n", ossdev->mixer_name , strerror( errno ));
> 
> Would you mind double checking that, Travis?  What do you think, Mathew?

	I really like it.  Adding support for SOUND_MIXER_INFO isn't
hard work, it's grunt work to that touches most drivers.  It might
turn up soon :)

> 
> Gerald
> 
> PS: I'm the maintainer of the emulators/wine port, so I could add this
> patch to the port and, more importantly, submit it upstream as well.

	I think that would be great.  Hopefully, they can take the
ifdef FreeBSD out.  Sorry for cutting you out of the CC before.

	--Mat


-- 
	(on the United States) Living next to you is in some ways
	like sleeping with an elephant. No matter how friendly and
	eventempered the beast, one is affected by every twitch and
	grunt.
			- Pierre Elliott Trudeau


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031228002408.GI20827>