http://bugs.winehq.org/show_bug.cgi?id=12651
Summary: Bad sound quality in Starcraft when running with hardware acceleration Product: Wine Version: CVS/GIT Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: alanceil@gmx.net
When starting Starcraft with any kind of sound DirectSound hardware acceleration enabled (Basic, Standard, Full (in winecfg)), the ingame sound has a very bad sound quality, it sounds like it was output by an 8bit sound card. This is particularly noticeable when you click on any of the buttons in the starting screen.
Here is an 'lspci -v' of the used soundcard:
--- 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) Subsystem: Apple Computer Inc. Unknown device 00a0 Flags: bus master, fast devsel, latency 0, IRQ 20 Memory at db500000 (64-bit, non-prefetchable) [size=16K] Capabilities: [50] Power Management version 2 Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable- Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00 Capabilities: [100] Virtual Channel <?> Capabilities: [130] Root Complex Link <?> Kernel driver in use: HDA Intel Kernel modules: snd-hda-intel ---
http://bugs.winehq.org/show_bug.cgi?id=12651
--- Comment #1 from Tom alanceil@gmx.net 2008-04-19 18:03:57 --- Just occured to me: If it would be possible to use winecfg's application settings for the Audio -> DirectSound category (currently, it is global only), that'd present a nice workaround -- maybe easier to implement.
http://bugs.winehq.org/show_bug.cgi?id=12651
Neil Skrypuch ns03ja@brocku.ca changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ns03ja@brocku.ca
--- Comment #2 from Neil Skrypuch ns03ja@brocku.ca 2008-05-15 19:09:18 --- I'm running Starcraft here with full hardware acceleration, and I don't have any issues with sound quality. Perhaps this is hardware related...
My sound card: 04:07.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07) Subsystem: Creative Labs SBLive! Player 5.1 Flags: bus master, medium devsel, latency 64, IRQ 19 I/O ports at e880 [size=32] Capabilities: [dc] Power Management version 1
http://bugs.winehq.org/show_bug.cgi?id=12651
--- Comment #3 from Austin English austinenglish@gmail.com 2008-11-12 14:15:20 --- Is this still an issue in current (1.1.8 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=12651
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|CVS/GIT |unspecified
--- Comment #4 from Austin English austinenglish@gmail.com 2009-01-19 15:15:33 --- Removing deprecated CVS/GIT version tag. Please retest in current git. If the bug is still present in today's wine, but was not present in some earlier version of wine, please update version field to earliest known version of wine that had the bug. Thanks!
http://bugs.winehq.org/show_bug.cgi?id=12651
--- Comment #5 from Tom alanceil@gmx.net 2009-01-19 18:08:12 --- I just downloaded the git version and tested it, the problem is still there. However, since noone else has this problem, wine probably isn't the problem here.
What remains is a wish to add the Audio tab in winecfg to the application specific settings, so I can tell wine it should use 'emulation' for Starcraft.
http://bugs.winehq.org/show_bug.cgi?id=12651
Ivan Iakoupov voxiac@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |voxiac@gmail.com
--- Comment #6 from Ivan Iakoupov voxiac@gmail.com 2009-06-19 01:44:10 --- Same issue here: Basic, Standard and Full Hardware Acceleration gives bad sound quality in Starcraft while "Emulation" works fine.
This is with wine 1.1.23 and my soundcard is:
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02) Subsystem: ASUSTeK Computer Inc. Device 1343 Flags: bus master, fast devsel, latency 0, IRQ 16 Memory at ffaf8000 (64-bit, non-prefetchable) [size=16K] Capabilities: [50] Power Management version 2 Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Count=1/1 Enable- Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00 Capabilities: [100] Virtual Channel <?> Capabilities: [130] Root Complex Link <?> Kernel driver in use: HDA Intel Kernel modules: snd-hda-intel
Also this doesn't seem to be limited to Starcraft. For example if I play tracks with high-pitched sounds in foobar2000 then they are distorted in a similiar way.
I've tested it with wine 1.0.1 also - same thing (although I've not removed ~/.wine directory and reinstalled Starcraft and foobar2000 cleanly. Should I?).
http://bugs.winehq.org/show_bug.cgi?id=12651
--- Comment #7 from Austin English austinenglish@gmail.com 2010-01-04 12:17:00 --- This is your friendly reminder that there has been no bug activity for 6 months. Is this still an issue in current (1.1.35 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=12651
Matthias funny.hangman@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |funny.hangman@gmx.net
--- Comment #8 from Matthias funny.hangman@gmx.net 2010-07-05 05:37:24 --- Hi, I have the same problem with every app. I tried different Wine versions 1.1.30 1.1.44 1.2.rc6. It´s ever the same, so it´s not an regression. Tested with Ubuntu 10.4. Maybe it is because an newer pulseaudio or alsa version. I remember that it worked with Ubuntu 8.10.
Alsa : audio Hardware Acceleration --> Sound stutters Alsa : emulation --> Sound works esd : Hw acc or emulation --> Sound works
the difference in the output between Alsa Hw and Alsa emul is:
fixme:dsalsa:IDsDriverBufferImpl_SetVolumePan (0x1c26c8,0x1c2b70): stub (Alsa Hw - output)
with esd it says: This sound card's driver does not support direct access The (slower) DirectSound HEL mode will be used instead.
lspci -v: (It´s an Audigy 4)
Multimedia audio controller: Creative Labs SB0400 Audigy2 Value Subsystem: Creative Labs Device 1021 Flags: bus master, medium devsel, latency 64, IRQ 18 I/O ports at dc00 [size=64] Capabilities: <access denied> Kernel driver in use: EMU10K1_Audigy Kernel modules: snd-emu10k1
http://bugs.winehq.org/show_bug.cgi?id=12651
Raymond superquad.vortex2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |superquad.vortex2@gmail.com
--- Comment #9 from Raymond superquad.vortex2@gmail.com 2010-07-15 03:02:15 --- (In reply to comment #2)
I'm running Starcraft here with full hardware acceleration, and I don't have any issues with sound quality. Perhaps this is hardware related...
My sound card: 04:07.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07) Subsystem: Creative Labs SBLive! Player 5.1 Flags: bus master, medium devsel, latency 64, IRQ 19 I/O ports at e880 [size=32] Capabilities: [dc] Power Management version 1
Just wondering how emu10k1 card work fine when winealsa only use "default" device and you need to use "front" device to change the PCM send volume and PCM send routing
http://git.alsa-project.org/?p=alsa-lib.git;a=blob_plain;f=src/conf/cards/EM...
EMU10K1.pcm.front.0 { @args [ CARD ] @args.CARD { type string } type hooks slave.pcm { type hw card $CARD } hooks.0 { type ctl_elems hook_args [ { interface PCM name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true optional true value [ 255 255 0 0 255 0 0 0 0 255 0 0 ] } { # for compatibility with older drivers name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true optional true value [ 255 255 0 0 255 0 0 0 0 255 0 0 ] } { interface PCM name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true optional true value [ 8 9 0 0 8 9 0 0 8 9 0 0 ] } { # for compatibility with older drivers name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true optional true value [ 8 9 0 0 8 9 0 0 8 9 0 0 ] } ] } }
http://bugs.winehq.org/show_bug.cgi?id=12651
--- Comment #10 from Raymond superquad.vortex2@gmail.com 2010-12-29 18:48:14 CST ---
(In reply to comment #2)
I'm running Starcraft here with full hardware acceleration, and I don't have any issues with sound quality. Perhaps this is hardware related...
My sound card: 04:07.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07) Subsystem: Creative Labs SBLive! Player 5.1 Flags: bus master, medium devsel, latency 64, IRQ 19 I/O ports at e880 [size=32] Capabilities: [dc] Power Management version 1
(In reply to comment #0)
When starting Starcraft with any kind of sound DirectSound hardware acceleration enabled (Basic, Standard, Full (in winecfg)),
Basic mean it don't use hardware buffers even the sound cards have hardware buffer
The current implementation in winealsa.drv actually force all sound cards to mix software secondary buffers since dwMaxHwMixingAllBuffers, ... are zero
HRESULT DirectSoundDevice_GetCaps( DirectSoundDevice * device, LPDSCAPS lpDSCaps) {
... lpDSCaps->dwMaxContigFreeHwMemBytes = device->drvcaps.dwMaxContigFreeHwMemBytes;
if ( ds_emuldriver ) { lpDSCaps->dwMaxHwMixingAllBuffers = 0; lpDSCaps->dwMaxHwMixingStaticBuffers = 0; lpDSCaps->dwMaxHwMixingStreamingBuffers = 0; lpDSCaps->dwFreeHwMixingAllBuffers = 0; lpDSCaps->dwFreeHwMixingStaticBuffers = 0; lpDSCaps->dwFreeHwMixingStreamingBuffers= 0; lpDSCaps->dwMaxHw3DAllBuffers = 0; lpDSCaps->dwMaxHw3DStaticBuffers = 0; lpDSCaps->dwMaxHw3DStreamingBuffers = 0; lpDSCaps->dwFreeHw3DAllBuffers = 0; lpDSCaps->dwFreeHw3DStaticBuffers = 0; lpDSCaps->dwFreeHw3DStreamingBuffers = 0; }
/* driver doesn't have these */ lpDSCaps->dwUnlockTransferRateHwBuffers = 4096; /* But we have none... */ lpDSCaps->dwPlayCpuOverheadSwBuffers = 1; /* 1% */
return DS_OK; }
Need to change those parameters to non-zero when wine can open alsa playback device multiple time (e.g. "front" device of emu10k1 )
static int ALSA_AddPlaybackDevice(snd_ctl_t *ctl, snd_pcm_t *pcm, const char *pcmname, int isdefault) { WINE_WAVEDEV wwo; int rc;
memset(&wwo, '\0', sizeof(wwo));
rc = ALSA_AddCommonDevice(ctl, pcm, pcmname, &wwo); if (rc) return(rc);
MultiByteToWideChar(CP_UNIXCP, 0, wwo.ds_desc.szDesc, -1, wwo.outcaps.szPname, sizeof(wwo.outcaps.szPname)/sizeof(WCHAR)); wwo.outcaps.szPname[sizeof(wwo.outcaps.szPname)/sizeof(WCHAR) - 1] = '\0';
wwo.outcaps.wMid = MM_CREATIVE; wwo.outcaps.wPid = MM_CREATIVE_SBP16_WAVEOUT; wwo.outcaps.vDriverVersion = 0x0100;
rc = ALSA_ComputeCaps(ctl, pcm, &wwo.outcaps.wChannels, &wwo.ds_caps, &wwo.outcaps.dwFormats, &wwo.outcaps.dwSupport); if (rc) { WARN("Error calculating device caps for pcm [%s]\n", wwo.pcmname); ALSA_FreeDevice(&wwo); return(rc); }
{ snd_pcm_t *multipcm; /* alsa device which allow multiple open , this mean it is already support mixing (e.g. hw with multiple subdevices , pulse, dmix, or jack ) however dmix and jack is almost useless since dsoutput.c disable resampling unless dsound application request same rate as dmix or jack server */ if ( snd_pcm_open(&multipcm,pcmname, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) == 0 ) { TRACE("Mixing buffers available\n"); wwo.ds_caps.dwMaxHwMixingAllBuffers = 16; wwo.ds_caps.dwMaxHwMixingStaticBuffers = 16; wwo.ds_caps.dwMaxHwMixingStreamingBuffers = 16; wwo.ds_caps.dwFreeHwMixingAllBuffers = 16; wwo.ds_caps.dwFreeHwMixingStaticBuffers = 16; wwo.ds_caps.dwFreeHwMixingStreamingBuffers = 16;
if (( wwo.ds_caps.dwFlags & DSCAPS_PRIMARYMONO ) == DSCAPS_PRIMARYMONO ) { wwo.ds_caps.dwFlags |= DSCAPS_SECONDARYMONO; /* 3D buffer mean sound card can pan mono to left and right so it must support both mono and stereo 1) mono only device cannot support 3D buffer 2) stereo only device - wine must playback mono 3D sound by stereo and perform software pan to left and right so "plug" or "route" plugin cannot be used */ if (( wwo.ds_caps.dwFlags & DSCAPS_PRIMARYSTEREO ) == DSCAPS_PRIMARYSTEREO ) { wwo.ds_caps.dwFlags |= DSCAPS_SECONDARYSTEREO; TRACE("3D buffers available\n"); wwo.ds_caps.dwMaxHw3DAllBuffers = 16; wwo.ds_caps.dwMaxHw3DStaticBuffers = 16; wwo.ds_caps.dwMaxHw3DStreamingBuffers = 16; wwo.ds_caps.dwFreeHw3DAllBuffers = 16; wwo.ds_caps.dwFreeHw3DStaticBuffers = 16; wwo.ds_caps.dwFreeHw3DStreamingBuffers = 16; } } snd_pcm_close(multipcm); } }
rc = ALSA_AddDeviceToArray(&wwo, &WOutDev, &ALSA_WodNumDevs, &ALSA_WodNumMallocedDevs, isdefault); if (rc) ALSA_FreeDevice(&wwo); return (rc); }
The above change should emulate the correct behaviour and dxdiag will try to play sound with hardware buffer in hardware acceleration mode but only play sound with software secondary buffer in emulation mode
However you still need to implement hardware secondary buffer support in winealsa.drv by disable the mixing of software secondary buffers and use snd_pcm_open() to open "front" device of your snd-emu10k1 multiple times since the current implementation return DSERR_UNSUPPORTED
static HRESULT WINAPI IDsDriverImpl_CreateSoundBuffer(PIDSDRIVER iface, LPWAVEFORMATEX pwfx, DWORD dwFlags, DWORD dwCardAddress, LPDWORD pdwcbBufferSize, LPBYTE *ppbBuffer, LPVOID *ppvObj) { IDsDriverImpl *This = impl_from_IDsDriver(iface); IDsDriverBufferImpl** ippdsdb = (IDsDriverBufferImpl**)ppvObj; HRESULT err;
TRACE("(%p,%p,%x,%x)\n",iface,pwfx,dwFlags,dwCardAddress); /* we only support primary buffers... for now */ if (!(dwFlags & DSBCAPS_PRIMARYBUFFER)) return DSERR_UNSUPPORTED; if (This->primary) return DSERR_ALLOCATED;
http://bugs.winehq.org/show_bug.cgi?id=12651
Nick Stuckert nickstuckert@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nickstuckert@gmail.com
--- Comment #11 from Nick Stuckert nickstuckert@gmail.com 2011-05-09 23:44:11 CDT --- This bug is also present for Black and White (all versions). Using the latest release of wine as of yesterday.
http://bugs.winehq.org/show_bug.cgi?id=12651
Darin Miller darinsmiller@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #12 from Darin Miller darinsmiller@gmail.com 2011-09-18 15:19:39 CDT --- *** This bug has been confirmed by popular vote. ***
http://bugs.winehq.org/show_bug.cgi?id=12651
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@redhat.com Component|-unknown |directx-dsound
--- Comment #13 from Michael Stefaniuc mstefani@redhat.com 2012-10-30 17:35:45 CDT --- The sound back end in Wine changed considerably since this bug was reported / last updated. Wine has taken the path of "modern" Windows and there is no hardware acceleration anymore.
Can you please retest and report back?
http://bugs.winehq.org/show_bug.cgi?id=12651
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #14 from Michael Stefaniuc mstefani@redhat.com 2012-10-30 17:39:32 CDT --- Actually it is not possible to run with hardware acceleration anymore. So I'm resolving it as FIXED (WONTFIX would be an other option).
http://bugs.winehq.org/show_bug.cgi?id=12651
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #15 from Alexandre Julliard julliard@winehq.org 2012-11-09 13:01:21 CST --- Closing bugs fixed in 1.5.17.