summaryrefslogtreecommitdiffstats
path: root/src/modules/oss/oss-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-22 01:15:49 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-22 01:15:49 +0100
commitbb23932e9a95f4b87d305f043f52fadd176c80bc (patch)
treea4dfc1e8ee6bfc0d29299093f5e3ac4726346ac6 /src/modules/oss/oss-util.c
parent3be4c31ee0f8bac99cec69ae97668333882fc1f8 (diff)
When resuming an OSS device ask for the very same fragment settings as we did the first time
In OSS it is only possible to request fragment sizes that are powers of 2. However actually selected fragment sizes may be arbitrary values. This means that it is not always possible to request the same fragment size after a suspend that was used before the suspend because we simply cannot express it in the request. To work around that we should issue the same request as we did the first time.
Diffstat (limited to 'src/modules/oss/oss-util.c')
-rw-r--r--src/modules/oss/oss-util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/oss/oss-util.c b/src/modules/oss/oss-util.c
index ea8d8111..41092d81 100644
--- a/src/modules/oss/oss-util.c
+++ b/src/modules/oss/oss-util.c
@@ -250,6 +250,8 @@ int pa_oss_set_fragments(int fd, int nfrags, int frag_size) {
int arg;
arg = ((int) nfrags << 16) | simple_log2(frag_size);
+ pa_log_debug("Asking for %i fragments of size %i (requested %i)", nfrags, 1 << simple_log2(frag_size), frag_size);
+
if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &arg) < 0) {
pa_log("SNDCTL_DSP_SETFRAGMENT: %s", pa_cstrerror(errno));
return -1;