From nobody Thu Dec 14 23:34:39 2023 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 4Srpbm1tDtz53wvK for ; Thu, 14 Dec 2023 23:34:44 +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 4Srpbl5C9Cz3NYH for ; Thu, 14 Dec 2023 23:34:43 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=mail; bh=nPwyNCh7vs/2re0 oZwrIIbITW/6ddCdcFafmnpSX4Xs=; h=in-reply-to:references:subject:cc:to: from:date; d=margiolis.net; b=XMcLpTKeJblTbMqI4ySoveILLA4smBHnAt82fKGo wP3dimFfHsIbhhrZSnX37/EJ2UCcDQzfSNSXsx7ZH44YH+vknZp5uTc0vnC2dlK9a4ghbJ +YPSjwxr33M5tMs9iaHsL29bNQiEfTBTempLcicjzficcVZ3GF80iMzwx0iXo= Received: from pleb (ppp-94-66-59-140.home.otenet.gr [94.66.59.140]) by margiolis.net (OpenSMTPD) with ESMTPSA id 79318638 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 14 Dec 2023 23:34:40 +0000 (UTC) Date: Fri, 15 Dec 2023 01:34:39 +0200 From: Christos Margiolis To: Alexander Leidinger Cc: freebsd-multimedia@freebsd.org Subject: Re: RFC - Work on FreeBSD's Audio Stack Message-ID: References: <86ttomxg11.fsf@phe.ftfl.ca> <86y1dxpjzy.fsf@phe.ftfl.ca> <5240adad4ff5b341756809fe12d362c9@Leidinger.net> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5240adad4ff5b341756809fe12d362c9@Leidinger.net> X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4Srpbl5C9Cz3NYH Hello Alexander, Alexander Leidinger wrote: > If you want to integrate some drivers: > https://lists.freebsd.org/pipermail/freebsd-multimedia/2019-June/019719.html > https://lists.freebsd.org/pipermail/freebsd-multimedia/2019-September/019907.html > > No idea if they are good quality drivers or not, and if those cards are > still available, but at least someone tried to support them it may be > sensible to check if it makes sense to do something with them or not. Because of time constraints, I really don't think this would be a wise allocation of time, so for now I am not going to look into this, I can note it down on a future TODO list however, if there's interest from more people. > The dsp deices are clonable due to the virtualisation and auto-mixing into > the hardware in the kernel. To my understanding the midi devices are not > clonable as there is no generic way we could mix several outputs from > programs into one hardware channel. Is there any other way we can achieve the functionality mentioned in the proposal though (i.e opening the same MIDI device from more than 1 application at the same time)? > > Other improvements to the kernel code include 1) better-syncing with the > > 4Front OSSv4 API, 2) addressing open bug > > reports, 3) making optimizations where possible. > > 1) I mentored a student in the Google summer of code which resulted in what > we have now in the OSSv4 API. Parts of this work was done as stubs, e.g. > #ifdef OSSV4_EXPERIMENT > static int dsp_oss_getlabel(struct pcm_channel *wrch, struct pcm_channel > *rdch, oss_label_t *label); > static int dsp_oss_setlabel(struct pcm_channel *wrch, struct pcm_channel > *rdch, oss_label_t *label); > static int dsp_oss_getsong(struct pcm_channel *wrch, struct pcm_channel > *rdch, oss_longname_t *song);https://www.leidinger.net/FreeBSD/dox/dev_sound/html/ > static int dsp_oss_setsong(struct pcm_channel *wrch, struct pcm_channel > *rdch, oss_longname_t *song); > static int dsp_oss_setname(struct pcm_channel *wrch, struct pcm_channel > *rdch, oss_longname_t *name); > #endif > and also dsp_oss_setchnorder(). > > Maybe you are interested to un-stub them. Yeap. > > Widely-used existing codebases that can benefit from oss(3) are virtual > > oss and Mozilla’s cubeb oss audio framework, > > which are also great sources of inspiration for features included in > > oss(3). > > VirtualOSS is now unmaintained (the author died). Maybe we want to adopt it > into the base? So, I am totally on board with this idea, in fact, taking over maintenance of virtual_oss and porting it to base was one of the project's initial goals, however I realized it might need considerable effort to do so, due to the fact it uses external libraries (fftw and libsamplerate IIRC), which, as I mentioned above, might not be the wisest allocation of resources in this case, considering the scope of the project is quite large already. My current plan is to work on the existing deliverables, and if time allows, look into how virtual_oss can be ported to base. > > Bluetooth device management utility > > Someone started with a bluetooth daemon a while ago. It sounds like this and > your proposal share a common goal. No idea what the state of it is, but > maybe you want to check it out: > https://lists.freebsd.org/archives/freebsd-bluetooth/2022-August/000021.html I am aware of this project and plan to use some of its ideas as inspiration, although I find it to be quite overengineered in my humble opinion. > > Documentation > > > Some parts of the kernel sound code contain docs written in doxygen syntax. > A rendered version of it (if there is no error in the daily generation for > -current) is available at > https://www.leidinger.net/FreeBSD/dox/dev_sound/html/ > and the corresponding TODO markup is rendered at > https://www.leidinger.net/FreeBSD/dox/dev_sound/html/dd/da0/todo.html > an example of the function docs (for dsp_oss_syncgroup()) is at > https://www.leidinger.net/FreeBSD/dox/dev_sound/html/d5/d3b/dsp_8c.html#a304ece74c26d57a7df3ab5f104a3feff > > It would be nice if changes to the kernel maintain/add to the doxygen > markup. That's a great idea. I've already been using this page to navigate through the sound code more easily, so that's definitely something worth adding to. We'll stay in touch for when the time comes. Christos