http://bugs.winehq.org/show_bug.cgi?id=9358
Summary: DirectSoundDevice_SetCooperativeLevel level=DSSCL_PRIORITY not fully supported Product: Wine Version: 0.9.43. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-directx-dsound AssignedTo: wine-bugs@winehq.org ReportedBy: citizenr@gmail.com
Since 1631 "Sound underruns occur in directsound" got closed Im opening a new bug.
Basically Sound works, but is very choppy, garbled and eats CPU time slowing game down.
http://bugs.winehq.org/attachment.cgi?id=7624 WINEDEBUG=warn+dsound wine ja2.exe
this is Jagged Alliance 2 with JA2 V1.13 Mod JA2 V1.13 Mod install instructions : http://www.ja-galaxy-forum.com/board/ubbthreads.php/ubb/showflat/Number/5672... or short one : do "svn co https://81.169.133.124/source/ja2_v1.13_data/GameDir" in game directory
http://bugs.winehq.org/attachment.cgi?id=7625 It´s actually a music tracker I´m using, not a game. You can download Famitracker from http://famitracker.shoodot.net/files/ft_v026.zip and open a .ftm file from http://2a03.free.fr/?p=pub&type=ftm to reproduce this.
Happens in games using Fmod.
maybe a patch? http://bugs.winehq.org/attachment.cgi?id=4331
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #1 from Jesse Allen the3dfxdude@gmail.com 2007-08-18 09:12:13 --- What kernel version are you using? I recommend trying 2.6.23-rc? if you can.
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #2 from rasz citizenr@gmail.com 2007-08-18 11:12:27 --- I'm using latest supported ubuntu kernel, 2.6.20-16 this bug doesn't occur under Cedega
http://bugs.winehq.org/show_bug.cgi?id=9358
Maarten Lankhorst M.B.Lankhorst@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wine-bugs@winehq.org Status|UNCONFIRMED |RESOLVED Resolution| |FIXED Summary|DirectSoundDevice_SetCoopera|Low latency interactive |tiveLevel |buffers are not mixed |level=DSSCL_PRIORITY not |properly in directsound |fully supported |
--- Comment #3 from Maarten Lankhorst M.B.Lankhorst@gmail.com 2007-08-19 05:01:52 --- I already told you what the real problem is, why make up a different Summary then?
CHanging summary to better reflect upon the REAL problem..
Also same comment as in bug 1631 applies:
As a workaround you could try at frequency 22050, 8 or 16 bit, and acceleration to 'Emulation'.
Another workaround you could set 'use direct hardware access' in alsa from wiki.winehq.org/UsefulRegistryKeys - However that will forfeit the ability of alsa to allow concurrent access.
See if those work for you
http://bugs.winehq.org/show_bug.cgi?id=9358
Maarten Lankhorst M.B.Lankhorst@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|FIXED |
--- Comment #4 from Maarten Lankhorst M.B.Lankhorst@gmail.com 2007-08-19 05:02:24 --- Oops
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #5 from rasz citizenr@gmail.com 2007-08-19 06:16:05 ---
As a workaround you could try at frequency 22050, 8 or 16 bit, and acceleration to 'Emulation'.
tried all combinations, no change
Another workaround you could set 'use direct hardware access' in alsa from wiki.winehq.org/UsefulRegistryKeys - However that will forfeit the ability of alsa to allow concurrent access.
it happens with Alsa and OSS, same programs work ok under Cedega with Alsa and OSS so its not Alsa problem.
http://bugs.winehq.org/show_bug.cgi?id=9358
Maarten Lankhorst M.B.Lankhorst@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|wine-bugs@winehq.org |M.B.Lankhorst@gmail.com Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1
--- Comment #6 from Maarten Lankhorst M.B.Lankhorst@gmail.com 2007-08-19 12:52:58 --- Created an attachment (id=7674) --> (http://bugs.winehq.org/attachment.cgi?id=7674) Hack that increases frequency of directsound
If used with direct hardware this will probably decrease the amount of underruns occuring, I can get to 45 ms in famitracker using alsa dmix with period_size = 512, probably even lower if you actually use direct hardware access. However it makes the system prone to underruns. It's a hack.
Jagged Alliance 2 might or might not work properly with this hack, too.
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #7 from Maarten Lankhorst M.B.Lankhorst@gmail.com 2007-08-24 03:03:17 --- I haven't heard feedback, does it help or not?
http://bugs.winehq.org/show_bug.cgi?id=9358
Simon Leonardsson sileon@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sileon@gmail.com
--- Comment #8 from Simon Leonardsson sileon@gmail.com 2007-08-24 05:14:36 --- (In reply to comment #7)
I haven't heard feedback, does it help or not?
It doesn´t help at all for me. Getting down to 45ms is impossible. about 85 is the lowest I can go, and even then I get a lot of underruns. Maybe it has to do with my setup? I do not use dmix, since my audio card(emu10k1) supports hardware mixing. I´ve tried different settings in winecfg, and also tried using direct hardware access, but still no success. I also realized that I use a pretty old alsa version (1.0.11rc4). Can that be the cause? I better upgrade before I do any additional testing anyway...
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #9 from Simon Leonardsson sileon@gmail.com 2007-08-24 09:19:36 --- Upgraded to 1.0.14, but I couldn´t notice any difference..
http://bugs.winehq.org/show_bug.cgi?id=9358
telefragfromhell@googlemail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |telefragfromhell@googlemail. | |com
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #10 from Simon sileon@gmail.com 2007-10-11 09:47:21 --- Finally followed Jesse Allen's advice to use a 2.6.23-rcX kernel, and it works a lot better indeed. Took me some time to realize that the latest kernel includes a new scheduler. Sorry for being such an asshole.
However, it is still not possible to use a buffer length of 40ms or lower than that in Famitracker. Is this still a wine issue, or is it still some scheduling/linux/other issue?
http://bugs.winehq.org/show_bug.cgi?id=9358
rasz citizenr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |citizenr@gmail.com
--- Comment #11 from rasz citizenr@gmail.com 2007-10-11 13:24:52 ---
Is this still a wine issue, or is it still some scheduling/linux/other issue?
it works 100% ok in Cedega on the same configuration, so its a Wine problem.
http://bugs.winehq.org/show_bug.cgi?id=9358
telefragfromhell@googlemail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|telefragfromhell@googlemail.| |com |
http://bugs.winehq.org/show_bug.cgi?id=9358
Sylvain Petreolle spetreolle@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |spetreolle@yahoo.fr
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #12 from Austin English austinenglish@gmail.com 2008-06-04 11:25:35 --- Is this still an issue in 1.0-rc3 or newer wine?
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #13 from Sileon sileon@gmail.com 2008-06-04 11:49:56 --- Yeah, still present in 1.0-rc3.
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #14 from Maarten Lankhorst m.b.lankhorst@gmail.com 2008-06-04 13:17:02 --- My explanation follows here, without a fix.
Imagine the hardware sound buffer like this:
[----XoooooX-----------------------] ^----------- read pointer up to write pointer.
DirectSound mixes every time the hardware (or dmix) read pointer advances, unfortunately the read pointer advances in blocks (roughly) up to the next write pointer.
The amount of time between read and write pointer is the maximum resolution applications can use. In case of alsa it is 2x or 3x the period size. This is roughly between 40 and 60 milliseconds in most cases. This means that famitracker won't be able to read smaller then those sizes, unless I 'fake' the position of the read/write pointer to artificially move with even smaller intervals by making the reserved area 1 period longer and then fake moving depending on how much time expired. I'm a bit hesitant to do this, but if it's still a problem with v2.6.24 I might take a look into it.
--Maarten
http://bugs.winehq.org/show_bug.cgi?id=9358
Jan Stępień jstepien@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jstepien@users.sourceforge.n | |et
http://bugs.winehq.org/show_bug.cgi?id=9358
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
--- Comment #15 from Austin English austinenglish@gmail.com 2008-12-08 04:11:45 --- Is this still an issue in current (1.1.10 or newer) wine?
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #16 from Austin English austinenglish@gmail.com 2009-06-08 11:27:57 --- Ping.
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #17 from Sileon sileon@gmail.com 2009-07-20 05:16:33 --- Yes, this is still an issue in latest git.
http://bugs.winehq.org/show_bug.cgi?id=9358
Raymond superquad.vortex2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |superquad.vortex2@gmail.com
--- Comment #18 from Raymond superquad.vortex2@gmail.com 2010-03-31 19:52:16 --- (In reply to comment #8)
(In reply to comment #7)
I haven't heard feedback, does it help or not?
It doesn´t help at all for me. Getting down to 45ms is impossible. about 85 is the lowest I can go, and even then I get a lot of underruns. Maybe it has to do with my setup? I do not use dmix, since my audio card(emu10k1) supports hardware mixing. I´ve tried different settings in winecfg, and also tried using direct hardware access, but still no success. I also realized that I use a pretty old alsa version (1.0.11rc4). Can that be the cause? I better upgrade before I do any additional testing anyway...
emu10k1 only support 48000Hz sample rate ,
yes it support hardware mixing when you use the correct device name "front" since there are 64 subdevices with per voice volume controls which are sufficient to implement 16 voices
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=9358
--- Comment #19 from Maarten Lankhorst m.b.lankhorst@gmail.com 2010-04-01 01:08:13 --- If you set realtime priority, and really want the lowest latency wine doesn't officially support it. But these settings would help:
int ds_snd_queue_max = 10; int ds_snd_queue_min = 6; int ds_snd_shadow_maxsize = 2;
Change to 4, 4, and -1 in dsound_main.c
in primary.c you have a function called DSOUND_fraglen, change it to return 256 instead of 512
That's probably about as low as it can get, tinkering with DSOUND_fraglen and ds_snd_queue_max is the only way to go lower than 90ms, but it's not officially supported. So do this at your own risk
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #20 from Raymond superquad.vortex2@gmail.com 2010-04-02 07:10:48 --- (In reply to comment #19)
If you set realtime priority, and really want the lowest latency wine doesn't officially support it. But these settings would help:
int ds_snd_queue_max = 10; int ds_snd_queue_min = 6; int ds_snd_shadow_maxsize = 2;
Change to 4, 4, and -1 in dsound_main.c
in primary.c you have a function called DSOUND_fraglen, change it to return 256 instead of 512
That's probably about as low as it can get, tinkering with DSOUND_fraglen and ds_snd_queue_max is the only way to go lower than 90ms, but it's not officially supported. So do this at your own risk
For ALSA , the period_size of those PCI sound cards are multiple of PCI brust size , wine seem to use period_time of 10ms but those wave file are usually 22050 Hz or 44100 Hz ( multiple of 3 )
Seem like those numbers in DSOUND_Fraglen are magic number
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #21 from Maarten Lankhorst m.b.lankhorst@gmail.com 2010-04-02 07:33:56 --- They are, sort of. Unfortunately alsa dmix uses power or 2 period sizes, and since nobody has hardware mixing I used that function to find out how big a period should be.
The current driver model doesn't allow me to know what the period size is, so I use a rough approximation to keep it near 10 ms if the primary rate is 44100 or 48000 which it is by default. The real problem is that alsa dmix sucks, so I have to work around its limitations. I really cannot when the expected latency is <100ms, so Im stuck with an imperfect solution that works for most people.
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #22 from Raymond superquad.vortex2@gmail.com 2010-04-04 04:56:03 --- (In reply to comment #21)
The current driver model doesn't allow me to know what the period size is, so I use a rough approximation to keep it near 10 ms if the primary rate is 44100 or 48000 which it is by default.
http://www.realtek.com.tw/faqs/faqsView.aspx?Langid=1&PNid=2&PFid=6&...
Q6: When I ran the Microsoft DirectX Diagnostic tool (Dxdiag.exe) sound test on a computer with Realtek audio driver (Windows Driver Model) installed, the test did not run properly, and the operating system showed the following message: "Your sound card does not support hardware buffering. Sound will only playback from software buffers." What does this mean?
The message meant that your audio system doesn't support 22050Hz sampling rate.
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #23 from Raymond superquad.vortex2@gmail.com 2010-04-06 20:14:49 --- (In reply to comment #21)
They are, sort of. Unfortunately alsa dmix uses power or 2 period sizes, and since nobody has hardware mixing I used that function to find out how big a period should be.
the point is the period size of usbaudio is related to USB (URB) packet size
device dmix seem allow you to use any period size/period time , unfortunately use can specified those parameters of the slave pcm of the sound cards in .asoundrc or /usr/share/alsa/cards/*.conf
do you mean that you want to know the actual period size used by hw device ?
To achieve low latency , you have to use small period size but the minimum period size of the sound cards are unlikely to be safe for all users with different cpu speed , different loading
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #24 from Raymond superquad.vortex2@gmail.com 2010-04-06 20:39:01 --- (In reply to comment #21)
since nobody has hardware mixing
there are at least three alsa drivers support per voice volume controls
http://git.alsa-project.org/?p=alsa-tools.git;a=blob_plain;f=hwmixvolume/REA...
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #25 from Raymond superquad.vortex2@gmail.com 2010-04-07 20:16:02 --- (In reply to comment #21)
They are, sort of. Unfortunately alsa dmix uses power or 2 period sizes, and since nobody has hardware mixing I used that function to find out how big a period should be.
please note that even wine use alsa "default" device does not imply all sound cards are configured to use dmix
http://git.alsa-project.org/?p=alsa-lib.git;a=blob_plain;f=src/conf/cards/CS...
# default with plughw # CS46xx supports multi-playback
CS46xx.pcm.default { @args [ CARD ] @args.CARD { type string } type asym playback.pcm { type plug slave.pcm { @func concat strings [ "hw:" $CARD ] } } capture.pcm { type plug slave.pcm { @func concat strings [ "hw:" $CARD ] } } }
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #26 from Raymond superquad.vortex2@gmail.com 2010-04-25 21:10:53 --- (In reply to comment #19)
If you set realtime priority, and really want the lowest latency wine doesn't officially support it. But these settings would help:
int ds_snd_queue_max = 10; int ds_snd_queue_min = 6; int ds_snd_shadow_maxsize = 2;
Change to 4, 4, and -1 in dsound_main.c
in primary.c you have a function called DSOUND_fraglen, change it to return 256 instead of 512
That's probably about as low as it can get, tinkering with DSOUND_fraglen and ds_snd_queue_max is the only way to go lower than 90ms, but it's not officially supported. So do this at your own risk
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7926eba0d5dd4e8b6360ba...
The point is wine set period time to 22000 but rate is 44100 and the most common sound card is HDA which has a constraint of in period_bytes and buffer_bytes
you cannot get exact period time 22000 and buffer time 120000
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 128); snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
http://git.alsa-project.org/?p=alsa-kernel.git;a=blob;f=sound/pci/hda/hda_in...
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #27 from Raymond superquad.vortex2@gmail.com 2010-05-05 21:24:37 --- (In reply to comment #21)
They are, sort of. Unfortunately alsa dmix uses power or 2 period sizes, and since nobody has hardware mixing I used that function to find out how big a period should be.
The current driver model doesn't allow me to know what the period size is, so I use a rough approximation to keep it near 10 ms if the primary rate is 44100 or 48000 which it is by default. The real problem is that alsa dmix sucks, so I have to work around its limitations. I really cannot when the expected latency is <100ms, so Im stuck with an imperfect solution that works for most people.
I don't understand why "The current driver model doesn't allow me to know what the period size" ?
The current implementation is setting buffer time and period time but dsound_test always fail since the driver allocate different buffer size when sampling rate is different
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #28 from Austin English austinenglish@gmail.com 2011-10-06 20:59:52 CDT --- There's been a ton of work on audio recently, please give this a try in 1.3.29 or git (or wait until Monday for 1.3.30).
http://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #29 from Raymond superquad.vortex2@gmail.com 2011-10-07 17:46:56 CDT --- (In reply to comment #28)
There's been a ton of work on audio recently, please give this a try in 1.3.29 or git (or wait until Monday for 1.3.30).
In 1.3.24 , snd-hda-intel can use 42ms buffer in famitracker without underrun in performace stat of famitracker, but in 1.3.29 it seem need to use a larger buffer
Do the rewrite of "dsound" using mmdevapi complete or not ?
since all dound tests fail with
Test failed: Primary and secondary buffers have different vtbls
http://bugs.winehq.org/show_bug.cgi?id=9358
Julian Rüger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net
http://bugs.winehq.org/show_bug.cgi?id=9358
Jarkko K jarkko_korpi@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jarkko_korpi@hotmail.com
--- Comment #30 from Jarkko K jarkko_korpi@hotmail.com --- PING
" Raymond 2011-10-07 17:46:56 CDT",
It's year 2014 now.
https://bugs.winehq.org/show_bug.cgi?id=9358
--- Comment #31 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for 1 year. Is this still an issue in current (1.7.44 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=9358
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aeikum@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=9358
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=9358
tokktokk fdsfgs@krutt.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fdsfgs@krutt.org
https://bugs.winehq.org/show_bug.cgi?id=9358
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #32 from joaopa jeremielapuree@yahoo.fr --- No news since 9 years. Audio improved a lot since this time. Can an administrator close the bug as ABANDONED?
https://bugs.winehq.org/show_bug.cgi?id=9358
mirh mirh@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mirh@protonmail.ch
--- Comment #33 from mirh mirh@protonmail.ch --- Extra bump I guess.