From owner-freebsd-hackers@freebsd.org Tue Mar 23 22:27:56 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE5875BE6FA for ; Tue, 23 Mar 2021 22:27:56 +0000 (UTC) (envelope-from alfix86@gmail.com) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450: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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4mGN13xmz4Zbx for ; Tue, 23 Mar 2021 22:27:56 +0000 (UTC) (envelope-from alfix86@gmail.com) Received: by mail-ej1-x633.google.com with SMTP id kt15so20195317ejb.12 for ; Tue, 23 Mar 2021 15:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=/8ZjQxcqz30R7gpN7c7QXRx2fmtfNvgaMtgT12/Lqpg=; b=LrYqrdg348BFChh14CIwyeEtnqq+XZmuhtCYrCvcafFZQAi1hdCOBxFl9wtHLykF04 5whoIzBTv0/tL4pSVRZTAorCqc86wXY66gNtNveU4iZpbM+8p8ewjAJNZ/megRH45KVF HHb3tCllOB1BlBlhfF1C77x5kbT+awdPWMHooRUyVppDJFFzvcCKSA7tw3uT/q7FNqWP f6GD46rp/bqjrqp/F2ADVfW7CuGTIMWsjytc9sOc+9I/1mjKTTf9Pim3CKXbVhd5ZI/x 9Skj+0kWudXkKsO8e8E67rUqjE54Qf8Ls7tDj77Os1iLiXuR/Tk+AyudUkwWYT5wQVIV BSqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/8ZjQxcqz30R7gpN7c7QXRx2fmtfNvgaMtgT12/Lqpg=; b=ITSLXsOL5Ilplyso0mvrtHkbZy/lehRcFLrdfurWXcDOFL9x4xTDfvk8jiNqeNDL6K HAlfWxc1AZ+vChfn3H0/XHXovvmdGzOGYMVpSg//eP+umYV/+B/IY5s8Dwt8lQQyCI1I ZlxsFuyqy1BAY0kQIdztHjubq7w6SIz1RtYrkHN/Rpk843wax7xKrV7o//XOsxTXJnyV 2j6xG+00U1lzaWCBeAGLIzutTZsRqZ1skkj6qalPQW0vHtmzsfzdz3DBQWugNHPNEnXq A6RrPjHLJKs2Eeboy05w+oTiee6BbbC4Om5l9epiLO1B4B4vPEQjHnqR+NwBb7cj7aLY XdFg== X-Gm-Message-State: AOAM533gykBeFmhONqbY3KaIdcump6wKx3F9HP55821y68m49U4ZZGUp lN1+BUEbDT3RGCabRQKhcmZbFAYyB1Y= X-Google-Smtp-Source: ABdhPJyWguKP+BS26V6lvLo/nlMToAzA43/ZukCTXEB8I8sBzwxra5blhabaMwp0GxVj4d/FmbJqjQ== X-Received: by 2002:a17:906:d157:: with SMTP id br23mr454421ejb.192.1616538469115; Tue, 23 Mar 2021 15:27:49 -0700 (PDT) Received: from alfdeb (host-87-11-194-175.retail.telecomitalia.it. [87.11.194.175]) by smtp.gmail.com with ESMTPSA id u59sm163170edc.73.2021.03.23.15.27.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 15:27:48 -0700 (PDT) Date: Tue, 23 Mar 2021 23:27:47 +0100 From: Alfonso Siciliano To: freebsd-hackers@freebsd.org Subject: Re: [GSoC 2021] Project Proposal Message-Id: <20210323232747.80b0c7413c758e0d30d50727@gmail.com> In-Reply-To: <20210322175529.kadptzccf7vhtz27@pleb> References: <20210322144928.ry75v5nlfhpzcfir@pleb> <93c692373cf35aae8dab4f1c63c38d08@bsdforge.com> <20210322161802.zouhvffwcuibwtmb@pleb> <20210322175529.kadptzccf7vhtz27@pleb> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4F4mGN13xmz4Zbx X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=LrYqrdg3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of alfix86@gmail.com designates 2a00:1450:4864:20::633 as permitted sender) smtp.mailfrom=alfix86@gmail.com X-Spamd-Result: default: False [2.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; RBL_SEM_IPV6(1.00)[2a00:1450:4864:20::633:from]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[87.11.194.175:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::633:from]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; NEURAL_SPAM_MEDIUM(1.00)[0.996]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::633:from:127.0.2.255]; BAD_REP_POLICIES(0.10)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::633:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 22:27:57 -0000 Hi Christos, On Mon, 22 Mar 2021 16:49:28 +0200 Christos Margiolis wrote: > To not bore with useless information, I basically wanted to implement a > "toggle" option for mixer(8) so that you can mute and unmute the mixer easily > without having to write external scripts to do that. Others have apparently > asked for the same thing in the forums too. > > However, in order to be able to mute and unmute the mixer requires the program > to have knowledge of the previous volume so that it can set it back, which means > that since mixer(8) is an one-shot program, it would have to write a file to the > disk, which is not the most pretty solution. > 2. In order to solve the mixer toggling "issue" without having to > write anything to disk, a new daemon called mixerd(8) can be > written using libmixer(3) to keep track of the volume history > among other things. I know the problem, my solution in mixertui.c was to define `struct item` with `.lvol|.rvol|.lmute|.rmute`, however mixer(8) is an one-shot program so mixerd or /var/db/mixerN-state could make sense, but why not the ideal solution: to implement SNDCTL_MIX_EXTINFO, MIXT_ONOFF and the other missing mixer ioctls avoiding computation and daemons in userland? > Apart from the reasons I mentioned above, which I think would make > mixer handling easier and more extensible, I think this library could > go as far as to implement support for virtual_oss and the like. I considered to implement a mixer library in the past but I chose to avoid a new library for a few ioctls. However if you are considering to add the support for virtual_oss the library could became interesting. Tip: you could move the discussion to multimedia@freebsd.org. Good luck! Alfonso --- Alfonso S. Siciliano https://alfonsosiciliano.gitlab.io