MOC vs 24bit on FreeBSD with OSSv4

Forums:

For playing 24bit files on subj system, please implement the next patch:

--- oss.c.orig 2016-09-22 17:46:51.224906233 +0300
+++ oss.c 2016-09-22 17:47:36.906905540 +0300
@@ -103,6 +103,11 @@
caps->formats |= SFMT_S16 | SFMT_LE;
if (format_mask & AFMT_S16_BE)
caps->formats |= SFMT_S16 | SFMT_BE;
+
+ if (format_mask & AFMT_S32_LE)
+ caps->formats |= SFMT_S32 | SFMT_LE;
+ if (format_mask & AFMT_S32_BE)
+ caps->formats |= SFMT_S32 | SFMT_BE;

if (!caps->formats) {
/* Workaround for vmix that lies that it doesn't support any
@@ -271,6 +276,12 @@
else
req_format = AFMT_S16_BE;
break;
+ case SFMT_S32:
+ if (params.fmt & SFMT_LE)
+ req_format = AFMT_S32_LE;
+ else
+ req_format = AFMT_S32_BE;
+ break;
default:
error ("Format %s is not supported by the device",
sfmt_str (params.fmt, fmt_name, sizeof (fmt_name)));

Thanks for that; it seems to have been a bit of an oversight, or maybe they weren't supported (either by MOC or OSS) when the sound driver was originally written.

That was because OSSv3 didn't support anything above 16 bits and OSSv4 support is at best partial. I did tell you about it back when I was working on my ALSA SFMT things. Note that there are also AFMT_S24_* formats in OSSv4.

Thus the patch would need a bunch of IFDEFs not to break compilation on OSSv3 systems. AFMT_S24 formats can't be easily supported right now (at least not without you pulling some stuff from my repo ;) ).

Thus the patch would need a bunch of IFDEFs not to break compilation on OSSv3 systems.

Yes, I've already put that to "eeprom" by e-mail.

AFMT_S24 formats can't be easily supported right now (at least not without you pulling some stuff from my repo ;) ).

Remind me again when that time comes. :-)

Committed as r2918.