#include <limits.h>
#include <sys/mman.h>
+#include <polyp/xmalloc.h>
+
+#include <polypcore/core-error.h>
#include <polypcore/iochannel.h>
#include <polypcore/sink.h>
#include <polypcore/source.h>
#include <polypcore/module.h>
#include <polypcore/sample-util.h>
-#include <polypcore/util.h>
+#include <polypcore/core-util.h>
#include <polypcore/modargs.h>
-#include <polypcore/xmalloc.h>
#include <polypcore/log.h>
#include "oss-util.h"
update_usage(u);
if (ioctl(u->fd, SNDCTL_DSP_GETOPTR, &info) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", pa_cstrerror(errno));
return;
}
update_usage(u);
if (ioctl(u->fd, SNDCTL_DSP_GETIPTR, &info) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", pa_cstrerror(errno));
return;
}
assert(s && u);
if (ioctl(u->fd, SNDCTL_DSP_GETOPTR, &info) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", pa_cstrerror(errno));
return 0;
}
assert(s && u);
if (ioctl(u->fd, SNDCTL_DSP_GETIPTR, &info) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", pa_cstrerror(errno));
return 0;
}
struct userdata *u = s->userdata;
if (pa_oss_get_pcm_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
- pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", strerror(errno));
+ pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", pa_cstrerror(errno));
s->get_hw_volume = NULL;
return -1;
}
struct userdata *u = s->userdata;
if (pa_oss_set_pcm_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
- pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", strerror(errno));
+ pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", pa_cstrerror(errno));
s->set_hw_volume = NULL;
return -1;
}
struct userdata *u = s->userdata;
if (pa_oss_get_input_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
- pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", strerror(errno));
+ pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", pa_cstrerror(errno));
s->get_hw_volume = NULL;
return -1;
}
struct userdata *u = s->userdata;
if (pa_oss_set_input_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
- pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", strerror(errno));
+ pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", pa_cstrerror(errno));
s->set_hw_volume = NULL;
return -1;
}
}
u->sample_spec = c->default_sample_spec;
- if (pa_modargs_get_sample_spec_and_channel_map(ma, &u->sample_spec, &map, PA_CHANNEL_MAP_ALSA) < 0) {
+ if (pa_modargs_get_sample_spec_and_channel_map(ma, &u->sample_spec, &map, PA_CHANNEL_MAP_OSS) < 0) {
pa_log(__FILE__": failed to parse sample specification or channel map");
goto fail;
}
if (mode != O_WRONLY) {
if (ioctl(u->fd, SNDCTL_DSP_GETISPACE, &info) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_GETISPACE: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_GETISPACE: %s", pa_cstrerror(errno));
goto fail;
}
pa_log(__FILE__": mmap failed for input. Changing to O_WRONLY mode.");
mode = O_WRONLY;
} else {
- pa_log(__FILE__": mmap(): %s", strerror(errno));
+ pa_log(__FILE__": mmap(): %s", pa_cstrerror(errno));
goto fail;
}
} else {
if (mode != O_RDONLY) {
if (ioctl(u->fd, SNDCTL_DSP_GETOSPACE, &info) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_GETOSPACE: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_GETOSPACE: %s", pa_cstrerror(errno));
goto fail;
}
pa_log(__FILE__": mmap filed for output. Changing to O_RDONLY mode.");
mode = O_RDONLY;
} else {
- pa_log(__FILE__": mmap(): %s", strerror(errno));
+ pa_log(__FILE__": mmap(): %s", pa_cstrerror(errno));
goto fail;
}
} else {
zero = 0;
if (ioctl(u->fd, SNDCTL_DSP_SETTRIGGER, &zero) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", pa_cstrerror(errno));
goto fail;
}
if (ioctl(u->fd, SNDCTL_DSP_SETTRIGGER, &enable_bits) < 0) {
- pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", strerror(errno));
+ pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", pa_cstrerror(errno));
goto fail;
}