From nobody Thu Feb 22 21:28:15 2024 X-Original-To: freebsd-current@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 4TgmTd3kWgz5BS3W for ; Thu, 22 Feb 2024 21:28:21 +0000 (UTC) (envelope-from dev@submerge.ch) Received: from gozo.iway.ch (gozo.iway.ch [212.25.24.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TgmTc72Rnz43SR; Thu, 22 Feb 2024 21:28:20 +0000 (UTC) (envelope-from dev@submerge.ch) Authentication-Results: mx1.freebsd.org; none Received: from gozo.iway.ch (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id A0F3034067F; Thu, 22 Feb 2024 22:28:17 +0100 (CET) X-Iway-Path: 0 Received: from localhost (localhost [127.0.0.1]) by localhost (ACF/28147.24633); Thu, 22 Feb 2024 22:28:17 +0100 (CET) Received: from interway.li (sendai-nord.iway.ch [212.25.24.38]) by gozo.iway.ch (Postfix) with ESMTP; Thu, 22 Feb 2024 22:28:17 +0100 (CET) Received: from [145.40.196.39] (account fw@submerge.ch HELO z800.localnet) by sendai-nord.interway.li (CommuniGate Pro SMTP 7.1.0) with ESMTPSA id 258023790; Thu, 22 Feb 2024 22:28:17 +0100 From: Florian Walpen To: Lexi Winter Cc: freebsd-current@freebsd.org, Christos Margiolis Subject: Re: 42fdcd9fd917 broke my snd_uaudio(4) Date: Thu, 22 Feb 2024 22:28:15 +0100 Message-ID: <2198605.PLFibm3KWW@z800> In-Reply-To: References: <4884231.Cjmsv3J8Qz@z800> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4TgmTc72Rnz43SR 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:8758, ipnet:212.25.0.0/19, country:CH] Hi Lexi, On Thursday, February 22, 2024 6:47:26 PM CET Lexi Winter wrote: > hi Florian, > > Florian Walpen: > > I have a Scarlett 18i20 myself, but maybe a different generation - it has > > 18 recording channels as its name suggests. Is 20 recording channels > > correct for your device? > > this is a 3rd generation 18i20; as well the usual physical inputs it has > a stereo loopback channel that can be configured in the built-in mixer > and which appears as an additional two recording channels. i think > (although i'm not certain) that loopback functionality is new in the 3rd > generation model. That makes sense, I have the previous generation with no loopback channels. > > > FreeBSD Audio Driver (64bit 2009061500/amd64) > > > Installed devices: > > > pcm0: on uaudio0 (1p:0v/1r:0v) default > > > > > > snddev > > > > > > flags=0x3e6 > > > [pcm0:play:dsp0.p0]: spd 48000, fmt 0x01401000, flags 0x2000110c, > > > 0x00000001, pid 22326 (virtual_oss) interrupts 115908, underruns 0, feed > > > 115907, ready 123440 [b:30720/15360/2|bs:131040/65520/2] channel > > > flags=0x2000110c {userland} > > > -> > > > feeder_root(0x01401000) -> {hardware} > > > > > > [pcm0:record:dsp0.r0]: spd 48000, fmt 0x01401000, flags 0x2000112c, > > > > > > 0x00000001, pid 22326 (virtual_oss) interrupts 115930, overruns 97, feed > > > 229796, hfree 30720, sfree 65440 [b:30720/15360/2|bs:65440/32720/2] > > > channel > > > flags=0x2000112c > > > {hardware} -> feeder_root(0x01401000) -> {userland} > > > Installed devices from userspace: > > > dsp.full: (play/rec) > > > dsp.record: (play/rec) > > > dsp: (play/rec) > > > > I see that there's a lot of recording overruns and the recording software > > side buffer of the pcm device is unusually small. Does recording work > > well for you? > i haven't had a chance to test recording yet beyond a single work > conference call, as i've only just got playback working well (that > required a lot of fiddling with various options until i settled on > virtual_oss). Yes, virtual_oss is currently the best option to break up multi-channel interfaces into smaller pcm devices, for general use. > > if you can suggset any obvious changes i'd appreciate that - maybe it's > just a case of increasing the virtual_oss buffer? i did have to > increase the playback buffer a bit as the virtual_oss default is rather > small. That was more like a general remark referring to this part of sndstat: [b:30720/15360/2|bs:65440/32720/2] The bs values show the buffer size of the pcm device, where the application (here virtual_oss) reads from. I just skimmed the source code, virtual_oss does set this buffer size according to its own buffer size. Here the buffer can hold 818 samples (~17ms), and the virtual_oss buffer should fit in there twice. As I recommend a multiple of the sound card period (4ms, from dmesg), I'd guess 384 (8ms) would make a good setting for the virtual_oss buffer parameter here. Maybe you can post your virtual_oss settings in the PR too. > > > Apart from that, I'd be interested in the exact circumstances this problem > > occurs. Could you provide the dmesg and sndstat output as above, but with > > the settings in loader.conf applied and playback hanging? > > > > Since you're using virtual_oss, I suppose it produces an error log > > somewhere? And then maybe the output of the following commands, also > > while playback is hanging: > > > > sysctl hw.snd > > sysctl dev.pcm.0 > > i'll open a bug with this and the other details once i get a chance to > reboot again to test, probably later today. Perfect, thank you. I have some ideas already, we'll see. Regards Florian