diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-08 07:48:34 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 04:47:37 -0400 |
commit | 10f69f9e42833b82288882d10901dc86adc3e473 (patch) | |
tree | ed2767c07158e36cf2eba4127a9d986428b2e89a | |
parent | f328385309f310626751c54f694641459e2d4582 (diff) |
[ALSA] pcm-oss - Add bugg-yptr option
Documentation,ALSA<-OSS emulation
Added 'buggy-ptr' proc option to switch the behavior of GETOPTR ioctl.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | Documentation/sound/alsa/ALSA-Configuration.txt | 2 | ||||
-rw-r--r-- | include/sound/pcm_oss.h | 3 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 8 |
3 files changed, 11 insertions, 2 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index a7fc75f53bbe..57e82a5fae71 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -1592,6 +1592,8 @@ Proc interfaces (/proc/asound) | |||
1592 | - whole-frag write only whole fragments (optimization affecting | 1592 | - whole-frag write only whole fragments (optimization affecting |
1593 | playback only) | 1593 | playback only) |
1594 | - no-silence do not fill silence ahead to avoid clicks | 1594 | - no-silence do not fill silence ahead to avoid clicks |
1595 | - buggy-ptr Returns the whitespace blocks in GETOPTR ioctl | ||
1596 | instead of filled blocks | ||
1595 | 1597 | ||
1596 | Example: echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss | 1598 | Example: echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss |
1597 | echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss | 1599 | echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss |
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h index 518728536bc6..0b67c9d105af 100644 --- a/include/sound/pcm_oss.h +++ b/include/sound/pcm_oss.h | |||
@@ -32,7 +32,8 @@ struct _snd_pcm_oss_setup { | |||
32 | block:1, | 32 | block:1, |
33 | nonblock:1, | 33 | nonblock:1, |
34 | partialfrag:1, | 34 | partialfrag:1, |
35 | nosilence:1; | 35 | nosilence:1, |
36 | buggyptr:1; | ||
36 | unsigned int periods; | 37 | unsigned int periods; |
37 | unsigned int period_size; | 38 | unsigned int period_size; |
38 | snd_pcm_oss_setup_t *next; | 39 | snd_pcm_oss_setup_t *next; |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 1e606399d74a..a038fd8a53f3 100644 --- a/sound/core/oss/pcm_oss.c +++ b/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 | |||
1543 | } else { | 1543 | } else { |
1544 | delay = snd_pcm_oss_bytes(substream, delay); | 1544 | delay = snd_pcm_oss_bytes(substream, delay); |
1545 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { | 1545 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
1546 | info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; | 1546 | snd_pcm_oss_setup_t *setup = substream->oss.setup; |
1547 | if (setup && setup->buggyptr) | ||
1548 | info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; | ||
1549 | else | ||
1550 | info.blocks = (delay + fixup) / runtime->oss.period_bytes; | ||
1547 | info.bytes = (runtime->oss.bytes - delay) & INT_MAX; | 1551 | info.bytes = (runtime->oss.bytes - delay) & INT_MAX; |
1548 | } else { | 1552 | } else { |
1549 | delay += fixup; | 1553 | delay += fixup; |
@@ -2350,6 +2354,8 @@ static void snd_pcm_oss_proc_write(snd_info_entry_t *entry, | |||
2350 | template.partialfrag = 1; | 2354 | template.partialfrag = 1; |
2351 | } else if (!strcmp(str, "no-silence")) { | 2355 | } else if (!strcmp(str, "no-silence")) { |
2352 | template.nosilence = 1; | 2356 | template.nosilence = 1; |
2357 | } else if (!strcmp(str, "buggy-ptr")) { | ||
2358 | template.buggyptr = 1; | ||
2353 | } | 2359 | } |
2354 | } while (*str); | 2360 | } while (*str); |
2355 | if (setup == NULL) { | 2361 | if (setup == NULL) { |