Add support for 24-bit and 32-bit audio output.#75
Add support for 24-bit and 32-bit audio output.#75AliceLR wants to merge 1 commit intolibxmp:masterfrom
Conversation
Drivers with 24-bit and 32-bit audio support: - [x] ALSA - [ ] BSD - [ ] CoreAudio - [ ] NetBSD - [ ] OSS - [x] PulseAudio - [ ] sndio - [x] Raw file - [x] WAV file Drivers that do not support 24-bit or 32-bit: - [ ] Sound Blaster Drivers to verify: - [ ] AHI - [ ] AIFF file - [ ] AIX - [ ] ALSA 0.5 - [ ] BeOS - [ ] DART - [ ] HP-UX - [ ] QNX - [ ] SGI - [ ] Solaris
42fcda3 to
c344688
Compare
I think it's possible with new (4.x) oss versions, e.g. freebsd: See their sys/soundcard. h at https://cgit.freebsd.org/src/tree/sys/sys/soundcard.h#n175 for AFMT_S32_NE and AFMT_S24_NE, for e.g.
Can't we just remove that prehistoric backend? |
I think this is correct, but I didn't look that closely. The current lists were kind of just guessing based on the defines I could easily search. The only drivers I looked at with any depth are the ones that are updated and working, so far. (Also, I forgot to put WinMM in the list—seems that like WAV, it works but you need to use
Not sure; I think if that happens, it should wait for a later release. (I think anything that only supports ancient ALSA should also have OSS?) |
| unsigned char a, b; | ||
| int i; | ||
|
|
||
| for (i = 0; i < buffer_bytes; i+= 4) { |
|
|
||
| /* Downmix 32-bit to 24-bit unaligned (in-place). | ||
| * Returns the new number of useful bytes in the buffer. */ | ||
| int downmix_32_to_24_unaligned(unsigned char *buffer, int buffer_bytes) |
There was a problem hiding this comment.
"packed" may be better than "unaligned" in this context?
| fmt = format & XMP_FORMAT_8BIT ? | ||
| SND_PCM_FORMAT_S8 : SND_PCM_FORMAT_S16; | ||
| fmt = format & XMP_FORMAT_UNSIGNED ? | ||
| SND_PCM_FORMAT_U8 : SND_PCM_FORMAT_S8; |
There was a problem hiding this comment.
SND_PCM_FORMAT_S8 played as if it was using the wrong signedness the last time I tested it, may need investigation. (This may be a PipeWire bug or something else, though.)
Patches necessary to actually use the 32-bit output support added by libxmp/libxmp#964 (see libxmp/libxmp#924). This is a work in progress and can be finished after libxmp 4.7.0 is out.
Drivers with 24-bit and 32-bit audio support:
Drivers that do not support 24-bit or 32-bit:
Drivers to verify: