From 926de75432d57cade393750da8102f3ba1eeb4a0 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 7 Nov 2013 12:25:02 +0100 Subject: [PATCH 1/2] Revert "ossaudio: do not enable by default" This reverts commit c905c5012ac0c6fde3b8094d2206a3139deddba2. There is a better fix for the issue at hand. Signed-off-by: Gerd Hoffmann --- audio/ossaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 3e04a58376..007c64115a 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -932,7 +932,7 @@ struct audio_driver oss_audio_driver = { .init = oss_audio_init, .fini = oss_audio_fini, .pcm_ops = &oss_pcm_ops, - .can_be_default = 0, + .can_be_default = 1, .max_voices_out = INT_MAX, .max_voices_in = INT_MAX, .voice_size_out = sizeof (OSSVoiceOut), From 73204cffe55ce65b3a344afc3da637d67beb8c32 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 7 Nov 2013 12:24:41 +0100 Subject: [PATCH 2/2] ossaudio: check for oss support in oss_audio_init Check whenever the device path (/dev/dsp by default) exists and qemu is allowed to access it. Return NULL if it isn't, so ossaudio will not be used on systems wihtout oss support (increasinly common on modern linux systems). Signed-off-by: Gerd Hoffmann --- audio/ossaudio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 007c64115a..5a73716032 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -849,6 +849,10 @@ static int oss_ctl_in (HWVoiceIn *hw, int cmd, ...) static void *oss_audio_init (void) { + if (access(conf.devpath_in, R_OK | W_OK) < 0 || + access(conf.devpath_out, R_OK | W_OK) < 0) { + return NULL; + } return &conf; }