From owner-soc-status@freebsd.org Mon Jun 21 11:11:14 2021 Return-Path: Delivered-To: soc-status@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 89F296456C4 for ; Mon, 21 Jun 2021 11:11:14 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from christos (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 4G7n015lYWz4rhb; Mon, 21 Jun 2021 11:11:13 +0000 (UTC) (envelope-from christos@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=oaCOthFCsX+h oTDLen8o82j28vk7y2CGvxqf/78CEls=; h=subject:cc:to:from:date; d=margiolis.net; b=EFldMknuMwPn0Xzpz+9F+kciuSFpqcDlNkk5HXfZBKJqlvZ5h3K 3FCf80VFw4oEZolEVVOX1Lx4mVvUhduAw3KEo4d9KnIc5XIxp+gGhgV9G3iwVdCKh9h9pS MgofLAwhFtyZ5wNRtJKTReDCYMMR3/IE+tetBLCnaOMjYNggUY= Received: from knob.station (46-15-74.adsl.cyta.gr [46.103.15.74]) by christos (OpenSMTPD) with ESMTPSA id 01e852ba (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 21 Jun 2021 11:11:10 +0000 (UTC) Date: Mon, 21 Jun 2021 14:11:22 +0300 From: Christos Margiolis To: soc-status@freebsd.org Cc: hselasky@freebsd.org Subject: [GSoC'21 Weekly Update #2] Sound mixer improvements Message-ID: <20210621111122.ygoea7mqqbpiolc2@knob.station> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 4G7n015lYWz4rhb X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 11:11:14 -0000 Hello, This is the last week's progress report. mixer(3): - Even though the OSS API works with volume values from 0 to 100, the caller now uses normalized 32-bit float values which get converted by the library before calling the appropriate ioctl. - Implemented functions for getting and setting the default audio card. - Started using some of the OSSv4 API's ioctls. Since a few of them are missing on FreeBSD, I'm probably going to be updating the OSS kernel drivers in /usr/src/sys/dev/sound/. mixer(8): - Got rid of the old implementation almost completely. - We're now using 32-bit floats here as well. - Added a few new options (their letters or behavior might change in the future): * -a for printing information for _all_ mixers available in the system (e.g /dev/mixer0.../dev/mixerN) * -d for setting the default audio card. The argument is the _number_ of the audio card we want to set as the default (e.g 0 for pcm0). * -o for printing the mixer information in a format suitable for scripts like /etc/rc.d/mixer. It's a replacement for the old -s and -S options. * -r for modifying a recording source. It's simply a different implementation of the old mixer(8)'s `{+|-|^|=}rec rdev` interface but it's easier to parse. * -s for printing _only_ the recording source(s) in a mixer. - Made the program's output similar to `pciconf -lv` since now we're dealing with more information, and not just volume knobs. This might change though, depending on how much we'll have to print. - The output also includes information for the audio card associated with the mixer, so /dev/sndstat is no longer needed to be checked. Below is a sample output of my version of mixer(8). The header has the mixer's audio card information, including the kernel module. Then, the first column is the mixer device's name, the second is the left and right volumes, the third is the panning and the last columns have information about whether the device is a playback/recording/recording-source device: $ mixer_prog pcm0:mixer: on hdaa0 kld snd_hda (default) vol = 0.80:0.80 +0.00 pbk pcm = 1.00:1.00 +0.00 pbk speaker = 1.00:1.00 +0.00 pbk rec = 0.37:0.37 +0.00 pbk ogain = 1.00:1.00 +0.00 pbk monitor = 0.67:0.67 +0.00 rec src The code is available on: - GitHub: https://github.com/christosmarg/mixer - Sourcehut: https://git.sr.ht/~crm/mixer - My Git server: https://git.margiolis.net/mixer/files.html The project's Wiki article can be found at: - https://wiki.freebsd.org/SummerOfCode2021Projects/SoundMixerImprovements -- Christos