From: Lennart Poettering Date: Thu, 26 Jul 2007 19:55:51 +0000 (+0000) Subject: Disable memory mapping if we open the device in O_WRONLY. Unfortunately we cannot... X-Git-Tag: v0.9.11~63^2~1^2~417 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e4660a0b5b34ae465fa3765c68dd8f2d276956f;p=platform%2Fupstream%2Fpulseaudio.git Disable memory mapping if we open the device in O_WRONLY. Unfortunately we cannot do mmap() in Linux without opening the device for reading as well. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1549 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/modules/module-oss.c b/src/modules/module-oss.c index b210c17..96e0c3c 100644 --- a/src/modules/module-oss.c +++ b/src/modules/module-oss.c @@ -1078,10 +1078,15 @@ int pa__init(pa_core *c, pa_module*m) { goto fail; if (use_mmap && (!(caps & DSP_CAP_MMAP) || !(caps & DSP_CAP_TRIGGER))) { - pa_log("OSS device not mmap capable, falling back to UNIX read/write mode"); + pa_log_info("OSS device not mmap capable, falling back to UNIX read/write mode."); use_mmap = 0; } + if (use_mmap && mode == O_WRONLY) { + pa_log_info("Device opened for write only, cannot do memory mapping, falling back to UNIX read/write mode."); + use_mmap = 0; + } + if (pa_oss_get_hw_description(p, hwdesc, sizeof(hwdesc)) >= 0) pa_log_info("Hardware name is '%s'.", hwdesc); else