From 289c914b470537234c1de498cf195323826d7984 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 12 Jan 2006 16:09:58 +0000 Subject: Some drivers (via82xx) doesn't start recording until we read something. This is ugly, but unfortunately required. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@453 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/module-oss.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'polyp') diff --git a/polyp/module-oss.c b/polyp/module-oss.c index d060b489..12cedf19 100644 --- a/polyp/module-oss.c +++ b/polyp/module-oss.c @@ -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: -- cgit