From nobody Mon Jun 9 19:32:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGMX601R1z5yNsC; Mon, 09 Jun 2025 19:32:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGMX548s6z3g52; Mon, 09 Jun 2025 19:32:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749497573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7K5HYQWLzLd0wDGd/xHtjB37eLSjVivKtHOV4k8uHjA=; b=b+QS8TY8RVRjpEvLe+ZRRg11/CSiZF78t2IAJuBkHfrOwJdW3u80hJNPRSv0fFf3eYtJbg AJ4iFXePjl4vrgRS+K9NV71QUg5R9qIBCiRwCFOEo0R0bEDTdokbTIwjEGHkK2lhsN5SV7 5lamJtLJ85UXf8/zHVQYosUDbfqb493dkfCBdXT0h5Hgm96iEbLTBJPLji8agpud3+pnOh gtvqOLydkWxOU3jri6ltVZi4ABqTM1cU1g6LyHAzhOSrtBTHlOafNBbFGfLUvb6nhlK493 hXT9dwLs2eMbzEIualgIYElfJFjunak/e+qE1+ZiBIHZmqqA9Y3limNMmDq1Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749497573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7K5HYQWLzLd0wDGd/xHtjB37eLSjVivKtHOV4k8uHjA=; b=jBx8ZT3NmTCIjLmFiTkSbOVE4YVMCf7DiR1BuMDcQf0x5BmnthkgAx0hr3qcoyS/tWxVWK O05fzti7EuP59mQSwl28IqtzhB5/BKbxhmFq4B7wyL+C5zAuasvl3xX952hEcRFzlw9T4o xXDtjoRMU2TUhlf6VysoB6N4/1xilYoXhZaEQ6+VKijPp5qfyUDEiybVuokpnBLhL3rqwQ L+AwTfX5LF4QR2tFLW4gkVvnRFfR8nVYj+do/knzA/d+MClFnEIb5pQE7zq7hN6qTlL+m0 hZwy4nnYh5jy6DudD0+I7v2V1x/ovvguea5lqoOBKY+3jhgjp4QAeLuViDph4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749497573; a=rsa-sha256; cv=none; b=uX8MoGGNsDShXmJZRUuO5mIaWDa6A6Gg6OvEZE9PT+RpPdKU1vTywWeSOAlIF0Y/wKe4I/ I7JEuxPOM/ig/CMgKHvlRkJlcx47HP6VwaCPTyLvl35nTlGwWALsbauUy2riU5DUSZUd/M seM4cLUeTs709DV+3qjnOsT6s1xKfUrQ5Ak1Q7SAB+/VlXajQKuh957W0Eh4IV4xLlzPB7 xr/z3fLZAA9AyfWkqKpGxkpNw5uJ0a8UglcG8FATv3r2uZMubHBlTG+8ElSBkYM12YRH/O FPiazQ4uZAGkvSn+rBfHcu133+mU9uPYh6ws2vy+F5mMK6HzCkaniNUIv4u+hw== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGMX531xxz1Kx1; Mon, 09 Jun 2025 19:32:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 4EDD5A64805; Mon, 09 Jun 2025 19:32:50 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8E9BA2D029E0; Mon, 9 Jun 2025 19:32:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id wgqxwm_351mR; Mon, 9 Jun 2025 19:32:50 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:3e64:cfff:fe55:bc80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4DB5B2D029D8; Mon, 9 Jun 2025 19:32:50 +0000 (UTC) Date: Mon, 9 Jun 2025 19:32:50 +0000 (UTC) From: "Bjoern A. Zeeb" To: Christos Margiolis cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e1bbaa71d62c - main - sound: Implement AFMT_FLOAT support In-Reply-To: <202503301748.52UHmPRF060200@gitrepo.freebsd.org> Message-ID: References: <202503301748.52UHmPRF060200@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Sun, 30 Mar 2025, Christos Margiolis wrote: > The branch main has been updated by christos: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e1bbaa71d62c8681a576f9f5bedf475c7541bd35 > > commit e1bbaa71d62c8681a576f9f5bedf475c7541bd35 > Author: Christos Margiolis > AuthorDate: 2025-03-30 17:45:38 +0000 > Commit: Christos Margiolis > CommitDate: 2025-03-30 17:45:38 +0000 > > sound: Implement AFMT_FLOAT support > > Even though the OSS manual [1] advises against using AFMT_FLOAT, there > are applications that expect the sound driver to support it, and might > not work properly without it. > > This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS > compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE <-> > AFMT_S32_LE|BE conversion functions. As a result, applications can > write/read floats to/from sound(4), but internally, because sound(4) > works with integers, we convert floating point samples to integer ones, > before doing any processing. > > The reason for encoding/decoding IEEE754s manually, instead of using > fpu_kern(9), is that fpu_kern(9) is not supported by all architectures, > and also introduces significant overhead. > > The IEEE754 encoding/decoding implementation has been written by Ariff > Abdullah [2]. > > [1] http://manuals.opensound.com/developer/AFMT_FLOAT.html > [2] https://people.freebsd.org/~ariff/utils/ieee754.c > > PR: 157050, 184380, 264973, 280612, 281390 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D47638 > --- > sys/dev/sound/pcm/channel.c | 4 +++ > sys/dev/sound/pcm/feeder_chain.c | 2 ++ > sys/dev/sound/pcm/feeder_rate.c | 4 +++ > sys/dev/sound/pcm/feeder_volume.c | 2 ++ > sys/dev/sound/pcm/pcm.h | 67 +++++++++++++++++++++++++++++++++++++-- > sys/dev/sound/pcm/sound.h | 13 +++++--- > sys/sys/soundcard.h | 8 +++++ > tests/sys/sound/pcm_read_write.c | 6 ++++ > 8 files changed, 98 insertions(+), 8 deletions(-) > > diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c > index f72c6aa7ef4f..2d35bb56ef8f 100644 > --- a/sys/dev/sound/pcm/feeder_volume.c > +++ b/sys/dev/sound/pcm/feeder_volume.c > @@ -93,6 +93,8 @@ FEEDVOLUME_DECLARE(U, 32, LE) > FEEDVOLUME_DECLARE(U, 16, BE) > FEEDVOLUME_DECLARE(U, 24, BE) > FEEDVOLUME_DECLARE(U, 32, BE) > +FEEDVOLUME_DECLARE(F, 32, LE) > +FEEDVOLUME_DECLARE(F, 32, BE) > #endif > > struct feed_volume_info { Could it be that they also need to be added to feed_volume_info_tab below? Kernel LINT builds complain that they are unused. /bz -- Bjoern A. Zeeb r15:7