From 6c506581218d09875d15dde1dad62ab97f19f4b0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 8 Sep 2005 13:48:34 +0200 Subject: [PATCH] --- yaml --- r: 8843 b: refs/heads/master c: 10f69f9e42833b82288882d10901dc86adc3e473 h: refs/heads/master i: 8841: a81607fe6c5db4726a25efd30f8ad605b444f286 8839: 48dce21a7a599016cc6bac2b38885034deb521f7 v: v3 --- [refs] | 2 +- trunk/Documentation/sound/alsa/ALSA-Configuration.txt | 2 ++ trunk/include/sound/pcm_oss.h | 3 ++- trunk/sound/core/oss/pcm_oss.c | 8 +++++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 1fbcc500c1d3..b9122b09c161 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f328385309f310626751c54f694641459e2d4582 +refs/heads/master: 10f69f9e42833b82288882d10901dc86adc3e473 diff --git a/trunk/Documentation/sound/alsa/ALSA-Configuration.txt b/trunk/Documentation/sound/alsa/ALSA-Configuration.txt index a7fc75f53bbe..57e82a5fae71 100644 --- a/trunk/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/trunk/Documentation/sound/alsa/ALSA-Configuration.txt @@ -1592,6 +1592,8 @@ Proc interfaces (/proc/asound) - whole-frag write only whole fragments (optimization affecting playback only) - no-silence do not fill silence ahead to avoid clicks + - buggy-ptr Returns the whitespace blocks in GETOPTR ioctl + instead of filled blocks Example: echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss diff --git a/trunk/include/sound/pcm_oss.h b/trunk/include/sound/pcm_oss.h index 518728536bc6..0b67c9d105af 100644 --- a/trunk/include/sound/pcm_oss.h +++ b/trunk/include/sound/pcm_oss.h @@ -32,7 +32,8 @@ struct _snd_pcm_oss_setup { block:1, nonblock:1, partialfrag:1, - nosilence:1; + nosilence:1, + buggyptr:1; unsigned int periods; unsigned int period_size; snd_pcm_oss_setup_t *next; diff --git a/trunk/sound/core/oss/pcm_oss.c b/trunk/sound/core/oss/pcm_oss.c index 1e606399d74a..a038fd8a53f3 100644 --- a/trunk/sound/core/oss/pcm_oss.c +++ b/trunk/sound/core/oss/pcm_oss.c @@ -1543,7 +1543,11 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str } else { delay = snd_pcm_oss_bytes(substream, delay); if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; + snd_pcm_oss_setup_t *setup = substream->oss.setup; + if (setup && setup->buggyptr) + info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; + else + info.blocks = (delay + fixup) / runtime->oss.period_bytes; info.bytes = (runtime->oss.bytes - delay) & INT_MAX; } else { delay += fixup; @@ -2350,6 +2354,8 @@ static void snd_pcm_oss_proc_write(snd_info_entry_t *entry, template.partialfrag = 1; } else if (!strcmp(str, "no-silence")) { template.nosilence = 1; + } else if (!strcmp(str, "buggy-ptr")) { + template.buggyptr = 1; } } while (*str); if (setup == NULL) {