23.10.2014 02:06, Pierre-Louis Bossart wrote: > On 10/22/14, 11:21 AM, Alexander E. Patrakov wrote: >> Of course, this only applies to ALSA devices that can't use tsched, as >> well as to OSS on more exotic platforms. >> >> This is needed for compatibility with Wine games that use DirectSound8 >> on distributions such as Arch Linux who don't accept the unofficial >> winepulse patch. The reason is that Wine DirectSound8 emulation requests >> a period of 10 ms and expects it to work for the purposes of timing. And >> in fact, it cannot know (via ALSA API) that it is not going to work! >> >> A known malware-free test application is Foobar2000 version 1.2. Later >> versions no longer use DirectSound. >> >> This issue is not going to be fixed on the Wine side, because the audio >> subsystem in Wine is not really maintained, and the maintainer has >> already privately expressed some negative thoughts about the state of >> the linux audio ecosystem in general. >> >> The correct solution (at least from the "isolate the clients from >> hardware limitations as thoroughly as possible" viewpoint) would be to >> consume audio from sink inputs using a timer if the actual sink does not >> provide sufficiently small minreq. In other words, adapt tsched to BATCH >> cards and drop non-tsched. But that's a whole project. So, as a stopgap >> solution for running Wine games on e.g. USB audio (which is a topic that >> pops up regularly on #pulseaudio IRC channel), let's reduce the default >> fragment size to a value suitable for unpatched Wine. >> >> Regarding the value: on my system, for mp3 playback through Foobar2000, >> 8ms fragments work, 9ms fragments result in constant underruns. >> >> Wine wiki recommends 5ms. > > Maybe it should be made clearer that the actual periods may differ > slightly from the default settings due to hardware constraints or > rounding issues, e.g. with your 5ms setting at 44100 Hz the period of > 220.5 samples is going to be rounded.... OK, I will clarify the commit message tomorrow. > >> >> On devices that can use tsched, there is no problem. >> >> Signed-off-by: Alexander E. Patrakov <patrakov at gmail.com> >> --- >> man/pulse-daemon.conf.5.xml.in | 4 ++-- >> src/daemon/daemon-conf.c | 2 +- >> src/daemon/daemon.conf.in | 2 +- >> 3 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/man/pulse-daemon.conf.5.xml.in >> b/man/pulse-daemon.conf.5.xml.in >> index 8bd076d..ff54435 100644 >> --- a/man/pulse-daemon.conf.5.xml.in >> +++ b/man/pulse-daemon.conf.5.xml.in >> @@ -463,8 +463,8 @@ USA. >> </option> >> <option> >> <p><opt>default-fragment-size-msec=</opt>The duration of a >> - single fragment. Defaults to 25ms (i.e. the total buffer is thus >> - 100ms long).</p> >> + single fragment. Defaults to 5ms (i.e. the total buffer is thus >> + 20ms long).</p> >> </option> >> >> </section> >> diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c >> index b7a85aa..6dc15cf 100644 >> --- a/src/daemon/daemon-conf.c >> +++ b/src/daemon/daemon-conf.c >> @@ -96,7 +96,7 @@ static const pa_daemon_conf default_conf = { >> .lock_memory = false, >> .deferred_volume = true, >> .default_n_fragments = 4, >> - .default_fragment_size_msec = 25, >> + .default_fragment_size_msec = 5, > > I've never understood why 4 fragments would be needed. Use 2 fragments > and 10ms periods... This works here, indeed. As for not using 2 periods, I think this may be related to cards that, according to the ALSA driver, should not work with just 2 periods (does anyone have a ymfpci?). > >> .deferred_volume_safety_margin_usec = 8000, >> .deferred_volume_extra_delay_usec = 0, >> .default_sample_spec = { .format = PA_SAMPLE_S16NE, .rate = >> 44100, .channels = 2 }, >> diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in >> index 5b20130..3d758cd 100644 >> --- a/src/daemon/daemon.conf.in >> +++ b/src/daemon/daemon.conf.in >> @@ -85,7 +85,7 @@ ifelse(@HAVE_SYS_RESOURCE_H@, 1, [dnl >> ; default-channel-map = front-left,front-right >> >> ; default-fragments = 4 >> -; default-fragment-size-msec = 25 >> +; default-fragment-size-msec = 5 >> >> ; enable-deferred-volume = yes >> ; deferred-volume-safety-margin-usec = 8000 >> > > _______________________________________________ > pulseaudio-discuss mailing list > pulseaudio-discuss at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss -- Alexander E. Patrakov