From nobody Tue Jul 02 19:09:38 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 4WDCCF15wKz5P5gp for ; Tue, 02 Jul 2024 19:09:45 +0000 (UTC) (envelope-from christos@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDCCD6DRrz4bmj; Tue, 2 Jul 2024 19:09:44 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719947384; 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; bh=hgDT1p4zobYFz4k+K3BMdWpyXd8U+uy4we5DELU/DgE=; b=wDWvh2Go7ZWvke1uR9kvJLln9ty9U+PYQ0/pIWuPVuh8oJgenYNJ5ZYcjZBdR6KtMKYXin W8O4BWeEuaWM3H+ANtvYHiMyPcnpshx4RZVrGE+OHt2345u4Ici0ZFucEkj5HUi4zkfbP2 sdoy7D8SJl5W0kaDtR4oE9nvAL8yqFVSPC/YvqG6fEuZWiYimDfIYXeW/V+nOyjwXJMMsI adLrLWW7F2PKNg+lbTaQz9tI/TmyfSB1pD1ljyfDOqba27Q+3asGacr+3+DwtOVeHjnSrm 8dM0MWYIt4Sr10jiGj2yq+x0jiEydcIYevOPGPmPG4HOksg2EJEhA9T1Zn2CKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719947384; a=rsa-sha256; cv=none; b=RYMG/ZRJlJxa3xmxvLrnG1nO5ViWMLX6ZUlhfINS+s22viOBEelzEva1hJLFZWHbymzj1N LwIAdQ4nzLQcha2BZS0pfMJv3rkCj0lpt6YJ8RdpjPIWlTYmqYzn/Fii2L/ia8lq90HktG s+pXWO6ma4F+I6RlHNSYUO5j2DR+Yr3tweyFQvVZVnLIjxWObIxkZmq3g7grjZkTsV51dQ ey2CpBVoAyhfKbTiqMDyteq7sEIJhYu795b3QgtLDzLZtWzmOq2ovBEzPULUmbcJ/i/ZtF 8H/kYxxV/ob1gc3Ks1bY/DOwfwqkgJ3KI6rLUuckrBdCyiBkZWwj+IBCqb8xGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719947384; 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: dkim-signature; bh=hgDT1p4zobYFz4k+K3BMdWpyXd8U+uy4we5DELU/DgE=; b=bWCZmaHNLkLBO1dk6imCOc2oedYE2wxNZG/47tQid+1ezlSMkJ/Tx06TDn3qdAY0cKH7Vx XXP+T05iusGVlgfc43dRKG4+6sHuEntMsOX26IjFyEFRs6ihzE89pCq00CgRtqxlqc4o44 4gjQKH2ziS6rAcE6edHHQi3cLTTGcOa20v0jAoBLkUwv5/aQHeIgNgUdlgpr7b0m/F7nIF ylfpj9q5qCq3rBSbHzEZ5fThkxsc51KZ1JJ/F1hfSrYOIX8Ji1su/L9mZlVRbK8oqSX6oc DsamMCST0gFPTdzOC6NyA5OYRWulWkxFpqurQGg5US2lmC5WJGSCKsEDnfzauQ== 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) (Authenticated sender: christos/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WDCCD1hV3z1CPP; Tue, 2 Jul 2024 19:09:44 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=mail; bh=Rq5tgLUWUgDA+sK w/iJEJHxTC/R+Ql3qSook5D9WUAI=; h=subject:cc:to:from:date; d=margiolis.net; b=jkBB/Y+xa4H0e2lwfOTfpflYGPUuvfhl1qgsfK9BvEBLRqxgUMx LE6y+VoTmfhS4khCd0PAJc1IgQDGoIsv+D/N9jHv418+Td6EvP+6h65TNmi85cWVmHL//N c3MX39HuU2OZ4RBMZEkuoNgIHSkAT4mwT8u44KYQIJpzTQePXQ= Received: from tpad (ip-45-81-121-44.ask4internet.com [45.81.121.44]) by margiolis.net (OpenSMTPD) with ESMTPSA id af51206e (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 2 Jul 2024 19:09:40 +0000 (UTC) Date: Tue, 2 Jul 2024 21:09:38 +0200 From: Christos Margiolis To: status-updates@freebsdfoundation.org Cc: freebsd-multimedia@freebsd.org, markj@freebsd.org, jrm@freebsd.org, emaste@freebsd.org Subject: [Development report #16] Audio Stack Improvements Message-ID: 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 Work done since last report: Most of my time was spent implementing audio(3): - Some time was wasted because I accidentally deleted all my WIP at some point (no comment...) before I pushed it to GitHub, so I had to re-write the whole library from scratch. - Not sure whether this will be the final design, but after research and studying of other sound libraries, I decided to go with a simple libsndio-like approach, meaning the library provides only a handful of simple functions, instead of a full-blown complicated API: - audio_open(), audio_close() - audio_read(), audio_write(): Support blocking, non-blocking and (soon) memory-mapped IO. - audio_set_vol(), audio_get_vol(): VPC functionality. - midi_open(), midi_close() - midi_read(), midi_write(): Support blocking and non-blocking IO. - Still considering whether we need a few more functions. - Added syslog(3) logging for all failure points in the library. - Doing some test re-writes of MPV and other programs to make sure the library can adapt to multiple different workflows. - Still experimening with different approaches regarding buffer size assignments. Also discussing this with Florian. - We need better kernel MIDI support in order to provide more MIDI-related functionality through audio(3). Many MIDI OSSv4 IOCTLs are not supported at all. An idea I have is to convert midi/ to function as a generic layer for MIDI device drivers (e.g umidi), similar to pcm/. This way we can register a device to /dev/sndstat and call OSS IOCTLs on it and expose all devices in a uniform way to /dev. However, this requires careful planning and I am still not sure whether this can fit within the scope of the project. Commits/reviews: - snd_hda: Add Lenovo X1 Carbon Gen11 support https://cgit.freebsd.org/src/commit/?id=ef659a2d041c01b747ae4605160c24156cae081b - snd_uaudio: Remove unused sc_sndstat sbuf https://reviews.freebsd.org/D45771 - sound: Simplify getchns() https://reviews.freebsd.org/D45775 - sound: Make DSP_FIXUP_ERROR() regular code: https://reviews.freebsd.org/D45776 - sound: Remove dead code in pcm_register() https://reviews.freebsd.org/D45831 - sound: Improve simplex handling in dsp_open() https://reviews.freebsd.org/D45835 - sound: Get rid of snd_sb16 workaround in vchan_create() https://reviews.freebsd.org/D45662 - sound: Fix min/max sample rate assignment for VCHANs https://reviews.freebsd.org/D45664 - sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled https://reviews.freebsd.org/D45722 - On-and-off debugging a (seemingly harmless) lock order reversal in chn_syncstart(). - sound: Support oss_audioinfo->cmd https://cgit.freebsd.org/src/commit/?id=8e36d212594b542cb0c57d549e0b57fd0f7e307c - sound: Fix oss_audioinfo's card_number, port_number and legacy_device https://cgit.freebsd.org/src/commit/?id=0f878cdfc5a46cc0dc198e12758f12558dfb1bf6 - sound: Remove outdated comment in dsp_oss_engineinfo() https://cgit.freebsd.org/src/commit/?id=914c2b3314e8f6e31833e33cfdcc4843f88fe31b - sound: Include sound(4) channel information in sndstat nvlist https://cgit.freebsd.org/src/commit/?id=bbca3a75bb412f7106a569b82c616404103be084 - sound: Fix lock order reversals in mseq_open() https://reviews.freebsd.org/D45770 - sound: Remove *MINOR from midi/ https://reviews.freebsd.org/D45772 - sound: Remove MIDI_TYPE https://reviews.freebsd.org/D45773 - Status/2024Q2/audio.adoc: Add report https://cgit.freebsd.org/doc/commit/?id=9f0942d1d52b8dff42a2822ef4f3bf27279f06eb Also submitted EuroBSDCon abstract related to the project but was rejected. This work is sponsored by the FreeBSD Foundation.