aboutsummaryrefslogtreecommitdiff
path: root/audio/ossaudio.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-07-04 16:51:32 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-07-04 16:51:32 +0000
commit8ead62cfc21f61a32677892c721674e06e9f6153 (patch)
treeafaeb2e3c1b2747671643575baebfe75592e5e6f /audio/ossaudio.c
parentfeea13e186a902179fcd79e3ce5318b5eb73c0d2 (diff)
audio fixes + initial audio capture support (malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2040 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'audio/ossaudio.c')
-rw-r--r--audio/ossaudio.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 7d12f9e34a..0bdc8eaab1 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -55,12 +55,14 @@ static struct {
int fragsize;
const char *devpath_out;
const char *devpath_in;
+ int debug;
} conf = {
.try_mmap = 0,
.nfrags = 4,
.fragsize = 4096,
.devpath_out = "/dev/dsp",
- .devpath_in = "/dev/dsp"
+ .devpath_in = "/dev/dsp",
+ .debug = 0
};
struct oss_params {
@@ -324,9 +326,20 @@ static int oss_run_out (HWVoiceOut *hw)
return 0;
}
- if (abinfo.bytes < 0 || abinfo.bytes > bufsize) {
- ldebug ("warning: Invalid available size, size=%d bufsize=%d\n",
- abinfo.bytes, bufsize);
+ if (abinfo.bytes > bufsize) {
+ if (conf.debug) {
+ dolog ("warning: Invalid available size, size=%d bufsize=%d\n"
+ "please report your OS/audio hw to malc@pulsesoft.com\n",
+ abinfo.bytes, bufsize);
+ }
+ abinfo.bytes = bufsize;
+ }
+
+ if (abinfo.bytes < 0) {
+ if (conf.debug) {
+ dolog ("warning: Invalid available size, size=%d bufsize=%d\n",
+ abinfo.bytes, bufsize);
+ }
return 0;
}
@@ -369,15 +382,12 @@ static int oss_run_out (HWVoiceOut *hw)
"alignment %d\n",
wbytes, written, hw->info.align + 1);
}
- mixeng_clear (src, wsamples);
decr -= wsamples;
rpos = (rpos + wsamples) % hw->samples;
break;
}
}
- mixeng_clear (src, convert_samples);
-
rpos = (rpos + convert_samples) % hw->samples;
samples -= convert_samples;
}
@@ -730,6 +740,8 @@ static struct audio_option oss_options[] = {
"Path to DAC device", NULL, 0},
{"ADC_DEV", AUD_OPT_STR, &conf.devpath_in,
"Path to ADC device", NULL, 0},
+ {"DEBUG", AUD_OPT_BOOL, &conf.debug,
+ "Turn on some debugging messages", NULL, 0},
{NULL, 0, NULL, NULL, NULL, 0}
};