Date: Tue, 30 Sep 2025 13:27:04 GMT From: Christos Margiolis <christos@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 8af6aee96ed6 - main - virtual_oss(8): Remove floating point formats from preference list Message-ID: <202509301327.58UDR4u4020313@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8af6aee96ed609456900c6dd92dafabac5e89c0a commit 8af6aee96ed609456900c6dd92dafabac5e89c0a Author: Christos Margiolis <christos@FreeBSD.org> AuthorDate: 2025-09-30 13:13:46 +0000 Commit: Christos Margiolis <christos@FreeBSD.org> CommitDate: 2025-09-30 13:25:53 +0000 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 --- usr.sbin/virtual_oss/virtual_oss/int.h | 6 +++--- 1 file 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 \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509301327.58UDR4u4020313>