diff options
| author | Christos Margiolis <christos@FreeBSD.org> | 2025-09-30 13:13:46 +0000 |
|---|---|---|
| committer | Christos Margiolis <christos@FreeBSD.org> | 2025-09-30 13:25:53 +0000 |
| commit | 8af6aee96ed609456900c6dd92dafabac5e89c0a (patch) | |
| tree | 55c68423a2fd2811a8ce27efc992763b33a4cd66 | |
| parent | be8830612314d9afb64b5c040db689de44eb4b85 (diff) | |
virtual_oss(8): Remove floating point formats from preference list
virtual_oss(8) chooses formats based on preference lists (see
VPREFERRED_*) for each sample depth (-b option). However, if we, for
example, use 32 bits LE for the sample depth, what will end up happening
is that the format chosen will be 0x10001000, which corresponds to
AFMT_S32_LE *and* AFMT_F32_LE OR'd together. This happens because the
preference lists include both AFMT_S32_* and AFMT_F32_* in the 32-bit
cases.
Because we essentially end up using an invalid format, sound(4) will
eventually reach pcm_sample_write()'s (sys/dev/sound/pcm/pcm.h)
__assert_unreachable() case.
This patch is a temporary fix to address the panic, until a proper
solution for using floating point formats is found.
PR: 289904
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
| -rw-r--r-- | usr.sbin/virtual_oss/virtual_oss/int.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/virtual_oss/virtual_oss/int.h b/usr.sbin/virtual_oss/virtual_oss/int.h index a48e33d7f837..b3cc573ba8a9 100644 --- a/usr.sbin/virtual_oss/virtual_oss/int.h +++ b/usr.sbin/virtual_oss/virtual_oss/int.h @@ -65,13 +65,13 @@ extern pthread_cond_t atomic_cv; #define VTYPE_WAV_DAT 2 #define VPREFERRED_SNE_AFMT \ - (AFMT_S8 | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE | AFMT_F32_NE) + (AFMT_S8 | AFMT_S16_NE | AFMT_S24_NE | AFMT_S32_NE) #define VPREFERRED_UNE_AFMT \ (AFMT_U8 | AFMT_U16_NE | AFMT_U24_NE | AFMT_U32_NE) #define VPREFERRED_SLE_AFMT \ - (AFMT_S8 | AFMT_S16_LE | AFMT_S24_LE | AFMT_S32_LE | AFMT_F32_LE) + (AFMT_S8 | AFMT_S16_LE | AFMT_S24_LE | AFMT_S32_LE) #define VPREFERRED_SBE_AFMT \ - (AFMT_S8 | AFMT_S16_BE | AFMT_S24_BE | AFMT_S32_BE | AFMT_F32_BE) + (AFMT_S8 | AFMT_S16_BE | AFMT_S24_BE | AFMT_S32_BE) #define VPREFERRED_ULE_AFMT \ (AFMT_U8 | AFMT_U16_LE | AFMT_U24_LE | AFMT_U32_LE) #define VPREFERRED_UBE_AFMT \ |
