ossaudio: use trace events instead of debug config flag

Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Kővágó, Zoltán 2015-06-12 14:33:07 +02:00 committed by Gerd Hoffmann
parent fbb7ef56d5
commit d95d7d802c
2 changed files with 8 additions and 21 deletions

View File

@ -30,6 +30,7 @@
#include "qemu/main-loop.h" #include "qemu/main-loop.h"
#include "qemu/host-utils.h" #include "qemu/host-utils.h"
#include "audio.h" #include "audio.h"
#include "trace.h"
#define AUDIO_CAP "oss" #define AUDIO_CAP "oss"
#include "audio_int.h" #include "audio_int.h"
@ -44,7 +45,6 @@ typedef struct OSSConf {
int fragsize; int fragsize;
const char *devpath_out; const char *devpath_out;
const char *devpath_in; const char *devpath_in;
int debug;
int exclusive; int exclusive;
int policy; int policy;
} OSSConf; } OSSConf;
@ -314,9 +314,7 @@ static int oss_open (int in, struct oss_params *req,
int version; int version;
if (!oss_get_version (fd, &version, typ)) { if (!oss_get_version (fd, &version, typ)) {
if (conf->debug) { trace_oss_version(version);
dolog ("OSS version = %#x\n", version);
}
if (version >= 0x040000) { if (version >= 0x040000) {
int policy = conf->policy; int policy = conf->policy;
@ -427,7 +425,6 @@ static int oss_run_out (HWVoiceOut *hw, int live)
struct audio_buf_info abinfo; struct audio_buf_info abinfo;
struct count_info cntinfo; struct count_info cntinfo;
int bufsize; int bufsize;
OSSConf *conf = oss->conf;
bufsize = hw->samples << hw->info.shift; bufsize = hw->samples << hw->info.shift;
@ -452,19 +449,12 @@ static int oss_run_out (HWVoiceOut *hw, int live)
} }
if (abinfo.bytes > bufsize) { if (abinfo.bytes > bufsize) {
if (conf->debug) { trace_oss_invalid_available_size(abinfo.bytes, bufsize);
dolog ("warning: Invalid available size, size=%d bufsize=%d\n"
"please report your OS/audio hw to av1474@comtv.ru\n",
abinfo.bytes, bufsize);
}
abinfo.bytes = bufsize; abinfo.bytes = bufsize;
} }
if (abinfo.bytes < 0) { if (abinfo.bytes < 0) {
if (conf->debug) { trace_oss_invalid_available_size(abinfo.bytes, bufsize);
dolog ("warning: Invalid available size, size=%d bufsize=%d\n",
abinfo.bytes, bufsize);
}
return 0; return 0;
} }
@ -852,7 +842,6 @@ static OSSConf glob_conf = {
.fragsize = 4096, .fragsize = 4096,
.devpath_out = "/dev/dsp", .devpath_out = "/dev/dsp",
.devpath_in = "/dev/dsp", .devpath_in = "/dev/dsp",
.debug = 0,
.exclusive = 0, .exclusive = 0,
.policy = 5 .policy = 5
}; };
@ -919,12 +908,6 @@ static struct audio_option oss_options[] = {
.descr = "Set the timing policy of the device, -1 to use fragment mode", .descr = "Set the timing policy of the device, -1 to use fragment mode",
}, },
#endif #endif
{
.name = "DEBUG",
.tag = AUD_OPT_BOOL,
.valp = &glob_conf.debug,
.descr = "Turn on some debugging messages"
},
{ /* End of list */ } { /* End of list */ }
}; };

View File

@ -1644,3 +1644,7 @@ alsa_xrun_in(void) "Recovering from capture xrun"
alsa_resume_out(void) "Resuming suspended output stream" alsa_resume_out(void) "Resuming suspended output stream"
alsa_resume_in(void) "Resuming suspended input stream" alsa_resume_in(void) "Resuming suspended input stream"
alsa_no_frames(int state) "No frames available and ALSA state is %d" alsa_no_frames(int state) "No frames available and ALSA state is %d"
# audio/ossaudio.c
oss_version(int version) "OSS version = %#x"
oss_invalid_available_size(int size, int bufsize) "Invalid available size, size=%d bufsize=%d"