]> code.delx.au - pulseaudio/blobdiff - polyp/module-oss.c
Some drivers (via82xx) doesn't start recording until we read something.
[pulseaudio] / polyp / module-oss.c
index d060b489a4f328b95163242ecc9a15e4a4672aae..12cedf19ae7010237da4189b1cfc59f007cc37d2 100644 (file)
@@ -368,6 +368,15 @@ int pa__init(pa_core *c, pa_module*m) {
 
     pa_modargs_free(ma);
 
+    /*
+     * Some crappy drivers do not start the recording until we read something.
+     * Without this snippet, poll will never register the fd as ready.
+     */
+    if (u->source) {
+        char buf[u->sample_size];
+        read(u->fd, buf, u->sample_size);
+    }
+
     return 0;
 
 fail: