From nobody Mon Mar 18 16:49:58 2024 X-Original-To: freebsd-multimedia@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 4Tz17536dWz5F4cT for ; Mon, 18 Mar 2024 16:50:09 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tz1741hgBz4nGL; Mon, 18 Mar 2024 16:50:08 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=margiolis.net header.s=mail header.b="V/DlZTzN"; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 95.179.159.8 is neither permitted nor denied by domain of christos@freebsd.org) smtp.mailfrom=christos@freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=mail; bh=l5NGPtvTGEIqsbG 3qYvtSu0a2uEkUeJwO4cgWMDhbTU=; h=in-reply-to:references:subject:cc:to: from:date; d=margiolis.net; b=V/DlZTzNOvByoLdLJevTDYpqJ3NXJdyIX7iMSr07 7JN8VJhThAv/CuRvxtWCjlymIWc4aF50eICBlTfLUSyK/IKn35H1G+QyopVpMkEIYsYA4e qPWR8h2cmiUaMH/+/Sl8SwDkmRjDq9TQn269MnFhgGIJiRfRn/1vD1drXDASY= Received: from tpad (ip-45-81-121-44.ask4internet.com [45.81.121.44]) by margiolis.net (OpenSMTPD) with ESMTPSA id 22e655c7 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 18 Mar 2024 16:49:59 +0000 (UTC) Date: Mon, 18 Mar 2024 17:49:58 +0100 From: Christos Margiolis To: Mark Johnston Cc: status-updates@freebsdfoundation.org, freebsd-multimedia@freebsd.org, jrm@freebsd.org, Konstantin Belousov , Florian Walpen Subject: Re: Re: Re: [Development report #7] Audio Stack Improvements Message-ID: References: List-Id: Multimedia discussions List-Archive: https://lists.freebsd.org/archives/freebsd-multimedia List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-multimedia@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.70 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[margiolis.net:s=mail]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, DKIM not aligned (relaxed),none]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[christos]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-multimedia@freebsd.org]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[freebsdfoundation.org,freebsd.org,gmail.com,submerge.ch]; RCPT_COUNT_FIVE(0.00)[6]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DKIM_TRACE(0.00)[margiolis.net:+] X-Rspamd-Queue-Id: 4Tz1741hgBz4nGL Mark Johnston wrote: > On Fri, Mar 15, 2024 at 06:00:16PM +0100, Christos Margiolis wrote: > > Applications are meant to open an audio device through /dev/dsp (if > > hw.snd.basename_clone is enabled), or through /dev/dspX, so the vast > > majority of applications should work with no problems. > > > > Applications that open a device through /dev/dspX.[X]X will break with > > this patch. However, opening a device like this is discouraged anyway, > > according to the sound(4) man page (see FILES section): > > To your knowledge, do any popular applications actually do this? A > comment in the man page isn't very important if applications end up > ignoring it. :) I don't really know of an application that does this. Konstantin Belousov wrote: > On Fri, Mar 15, 2024 at 10:38:01PM -0400, Mark Johnston wrote: > > If needed, would it be a lot of work to provide backward compatibility? > Should be rather trivial, to catch the case in the devfs lookup clone > callback and instantiate fake nodes. So, it is indeed trivial to catch it in the lookup loop, but currently /dev/dsp%d.[p|r|vp|vr]%d will have no effect because with this patch you cannot open a specific channel, so what we could do is simply dev_ref() /dev/dsp%d. Florian Walpen wrote: > Is it even possible to open pcm devices through /dev/dspX.Y currently? > I remember that I stumbled upon this when I developed the Jack backend > and it wasn't possible to open /dev/dspX.Y, I had to use /dev/dspX. > Just checked and that still seems to be the case on 14.0-RELEASE. > Unless I missed something, I'd conclude that it's not used in ports > :-) I think you can, but because a specific channel can only be opened exclusively, if say, /dev/dsp0.0 is already opened, an application cannot re-open it, so maybe this is why you're getting errors. Also some IOCTLs seem to not work on VCHANs: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246208 > Non-clone aliases like /dev/dsp_mmap seem to work though, never > actually seen them in use but I think we should preserve them as part > of OSSv4 compatibility. Yeah, we can do this. Christos