From bb23932e9a95f4b87d305f043f52fadd176c80bc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 22 Jan 2009 01:15:49 +0100 Subject: 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. --- src/modules/oss/oss-util.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/modules/oss/oss-util.c') 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; -- cgit