From nobody Fri Mar 15 10:52:29 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 4Tx1Ky0FjYz5D9HY for ; Fri, 15 Mar 2024 10:52:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tx1Kx2CbDz46kR; Fri, 15 Mar 2024 10:52:37 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=cuP6pEal; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::633 as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1dddbeac9f9so14116315ad.3; Fri, 15 Mar 2024 03:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710499955; x=1711104755; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=ZSXBbTK8pF/2jQ9ThLFP57iLvMkVEKXDtFEq28N74Xg=; b=cuP6pEalINvFTGAFV9mKUHq5hP1577a2ps+Zq/CcQVKPQbabJ0DmI354UGJVXJCA5s 0o+c3o9xU8iVJFIWZEzZ97fazt6pNsbsO+QzgSCKGgZnLOIjQFGvHfheCr2Obg5KGhsl tYfKCL8acxGlvVSzNsxSzWQ51+o5wBhvtnHaa2aJpZF+RF+I7KpWQj1d7GxJeQZTpxqo afeqHETA4MamVG5leGd3R8iRKDltiUb18h6lsu280vddLybtWKBpFTpJCTpKfoer0tbc QG9VadG6EbdmUyVdGYNPQXjL50cjR8tZ2FDuOjCOZUR+2VEet4Uc7XoaASq9+YyRSSr0 bDwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710499955; x=1711104755; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZSXBbTK8pF/2jQ9ThLFP57iLvMkVEKXDtFEq28N74Xg=; b=kPDQh9XXllxI+dFAjdO7M5Jzez2Fh/t2T9zmnVuvoASt2UK/ryQNIg4CPOm5FXhlsS BvK/95hgIUee9xHPYkO+7Ynxa6zjk40hsqPa2qj6C/LHKPHxk7vRg5j7cU/sQahRQXDX 1bO8gBx2buU6TmyG8SS+PnMMKW9Cd6MIoxWVGIOvj4KPRkJ0mo7yerB4PiTzOnnsz4NM W5CjahX9w3gU2WbF9Av0vukaWTAejquuOthrNIHa2AJZ/VAX/iFHzS/wp/vjQ7z4XVgi 7MVjlYCXqPwMN5hwYS+1v8vJY7YsTZ8AFPkt6fTJRpSjfuUxmwScwB+dXodfO3RFbnhK 7Qaw== X-Forwarded-Encrypted: i=1; AJvYcCU8LX2kqvmt7wMlHthgaVS7i2wFfhRkEw3+K/mIhXySqd/HxBTYFPUTw04SYNOR+Z5X2kI/hN1HDSjpHSBEvDPlGsYeilFdq3BM29mz5029qCCC2RNL0Rg7l2RqBV6gYA== X-Gm-Message-State: AOJu0YyqlXeCyT6iZVsGXa4wkAFFFFIzL/fT2JeYQ1hbWdBteZrMThdp gyNAgBw5DCPehNQXUOgz4MsbcrC8k4gXs2AquzMt4AKcCqDRWdM6g8Z83nJd X-Google-Smtp-Source: AGHT+IEgRg6R3I7OlEe5IBOECVn3EQ3TKdQQ9cz3ZN7S85eYXk+u8kYwWucpJrfbBg4hu7DCmH6hoA== X-Received: by 2002:a17:902:c213:b0:1dd:38bc:e635 with SMTP id 19-20020a170902c21300b001dd38bce635mr4197890pll.4.1710499954628; Fri, 15 Mar 2024 03:52:34 -0700 (PDT) Received: from framework.home (36-224-168-33.dynamic-ip.hinet.net. [36.224.168.33]) by smtp.gmail.com with ESMTPSA id d7-20020a170902654700b001db82fdc89asm3532872pln.305.2024.03.15.03.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 03:52:33 -0700 (PDT) Date: Fri, 15 Mar 2024 06:52:29 -0400 From: Mark Johnston To: Christos Margiolis Cc: status-updates@freebsdfoundation.org, freebsd-multimedia@freebsd.org, jrm@freebsd.org Subject: 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 [-3.03 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.934]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::633:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-multimedia@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+] X-Rspamd-Queue-Id: 4Tx1Kx2CbDz46kR Hi Christos, On Wed, Mar 13, 2024 at 03:44:57PM +0100, Christos Margiolis wrote: > Working on scrapping sound(4)'s "snd_clone" device cloning framework and > using DEVFS_CDEVPRIV(9) instead. Such a change will simplify and reduce > code size significantly, as well as improve user-experience. The WIP can > be found on my GitHub branch, but I will submit a patch on Phabricator > ASAP. > > https://github.com/christosmarg/freebsd/commit/c8694174e2e9d77ef74c6d8e25d99b2b7d5d5652 > > - Discussed with Florian Walpen about the patch. > - Reduced overall code size ("7 changed files with 327 additions and > 1,739 deletions" according to GitHub). > - Got rid of all snd_clone* functions, removed clone.* files and related > sysctls altogether. > - Handled hw.snd.basename_clone to work with the new patch. > - Handle character device destroying. https://reviews.freebsd.org/D43545 > will be rewritten (and end up noticeably smaller/simpler) on top of > this patch once submitted. > - Cleaned up patch and fixed most bugs I've spotted so far. > - Simplified dsp_open() and dsp_close(). > - Removed dsp_cdevinfo* and embedded this information in the cdevpriv(9) > structure. > - Tested a bunch of different cases. Need to test more and resolve a few > remaining bugs. > > Regarding behavior that is preserved: > - Exclusive access of an audio device still works (i.e VCHANs disabled). > - Multiple processes can read from/write to the device. > - A device can only be opened as many times as the maximum channel > number (see PCMMAXCLONE in pcm/sound.h). > > Behavior changes: > - Only one /dev/dspX device is exposed, as opposed to the current > /dev/dspX.[X]X devices created by the snd_clone mechanism. The > user/application now only needs to access the device through /dev/dspX > or /dev/dsp and sound(4) will take care of all necessary audio > routing. Does this represent a backward compatibility break? That is, will applications need any modification when running on a patched kernel? > Pending work: > - See if it's worth preserving any of the additional devices in > dsp_cdevs[] (see SND_DSP_DEV attribute in pcm/dsp.c). > - Make sure no OSS IOCTL breaks. > - Add comments to the code. > - Write proper commit message. > - Update man page. > - Update Wiki page once committed. > - As already mentioned, rewrite https://reviews.freebsd.org/D43545. > > Additional work outside the cdevpriv(9) patch includes: > > Committed snd_hda patch for the Lenovo Ideapad 330-15 and ThinkPad X230. > https://cgit.freebsd.org/src/commit/?id=5968e477a560406c480d78ebe438a04f57121119 > > MFC'd all pending patches to stable/14. > > Started documenting missing sound(4) sysctls. > > Reviewed and committed Florian Walpen's recent snd_uaudio(4) patch. > https://cgit.freebsd.org/src/commit/?id=a9341f0f0ae01b4d249dbf3bacfa420152c46aef > > Christos