aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/oss_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/oss_plugin.c')
-rw-r--r--src/output/oss_plugin.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c
index bd3ccb774..d7df594d3 100644
--- a/src/output/oss_plugin.c
+++ b/src/output/oss_plugin.c
@@ -41,6 +41,15 @@
# include <sys/soundcard.h>
#endif /* !(defined(__OpenBSD__) || defined(__NetBSD__) */
+/* We got bug reports from FreeBSD users who said that the two 24 bit
+ formats generate white noise on FreeBSD, but 32 bit works. This is
+ a workaround until we know what exactly is expected by the kernel
+ audio drivers. */
+#ifndef __linux__
+#undef AFMT_S24_PACKED
+#undef AFMT_S24_NE
+#endif
+
struct oss_data {
int fd;
const char *device;
@@ -347,7 +356,7 @@ oss_setup_sample_rate(int fd, struct audio_format *audio_format,
case SUCCESS:
if (!audio_valid_sample_rate(sample_rate))
break;
-
+
audio_format->sample_rate = sample_rate;
return true;
@@ -461,6 +470,12 @@ oss_setup_sample_format(int fd, struct audio_format *audio_format,
break;
audio_format->format = mpd_format;
+
+#ifdef AFMT_S24_PACKED
+ if (oss_format == AFMT_S24_PACKED)
+ audio_format->reverse_endian =
+ G_BYTE_ORDER != G_LITTLE_ENDIAN;
+#endif
return true;
case ERROR:
@@ -502,6 +517,12 @@ oss_setup_sample_format(int fd, struct audio_format *audio_format,
break;
audio_format->format = mpd_format;
+
+#ifdef AFMT_S24_PACKED
+ if (oss_format == AFMT_S24_PACKED)
+ audio_format->reverse_endian =
+ G_BYTE_ORDER != G_LITTLE_ENDIAN;
+#endif
return true;
case ERROR: