From nobody Thu Feb 22 12:45:29 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 4TgXtN5MdHz5CY2y for ; Thu, 22 Feb 2024 12:45:32 +0000 (UTC) (envelope-from dev@submerge.ch) Received: from pianosa.iway.ch (pianosa.iway.ch [212.25.24.37]) (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 4TgXtN2QMdz541N; Thu, 22 Feb 2024 12:45:32 +0000 (UTC) (envelope-from dev@submerge.ch) Authentication-Results: mx1.freebsd.org; none Received: from pianosa.iway.ch (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id C880FE0A3F; Thu, 22 Feb 2024 13:45:30 +0100 (CET) X-Iway-Path: 0 Received: from localhost (localhost [127.0.0.1]) by localhost (ACF/21551.27449); Thu, 22 Feb 2024 13:45:30 +0100 (CET) Received: from interway.li (sendai-sued.iway.ch [212.25.24.39]) by pianosa.iway.ch (Postfix) with ESMTP; Thu, 22 Feb 2024 13:45:30 +0100 (CET) Received: from [145.40.196.39] (account fw@submerge.ch HELO z800.localnet) by sendai-sued.interway.li (CommuniGate Pro SMTP 7.1.0) with ESMTPSA id 235673739; Thu, 22 Feb 2024 13:45:30 +0100 From: Florian Walpen To: freebsd-current@freebsd.org, Lexi Winter Cc: Christos Margiolis Subject: Re: 42fdcd9fd917 broke my snd_uaudio(4) Date: Thu, 22 Feb 2024 13:45:29 +0100 Message-ID: <4884231.Cjmsv3J8Qz@z800> In-Reply-To: References: 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: 4TgXtN2QMdz541N 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 2:45:07 AM CET Lexi Winter wrote: > hello, > > since the commit: > > 42fdcd9fd917 snd_uaudio(4): Fix config detection with defaults set. > > my snd_uaudio(4) no longer works. the symptom is that applications > attempting to play audio hang forever, and no audio is produced. > reverting this commit fixed the problem. > > the issue only occurs if i have this set in /boot/loader.conf: > > hw.usb.uaudio.default_bits=32 > hw.usb.uaudio.default_rate=48000 > > removing these two settings makes audio work correctly again. Thanks for reporting this. While I don't see the need to set these lines in loader.conf, at least not for your particular audio device, it certainly shouldn't break anything. I think it might be helpful to handle this case in a PR on bugs.freebsd.org, if you don't mind? We probably need more info and logs. > > my audio device: > > ugen3.2: at usbus3 > uaudio0 on uhub1 > uaudio0: > on usbus3 uaudio0: Play[0]: 48000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Play[0]: 192000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Play[0]: 176400 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Play[0]: 96000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Play[0]: 88200 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Play[0]: 48000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Play[0]: 44100 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 48000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 192000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 176400 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 96000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 88200 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 48000 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: Record[0]: 44100 Hz, 20 ch, 32-bit S-LE PCM format, 2x4ms > buffer. uaudio0: MIDI sequencer. > pcm0 on uaudio0 > uaudio0: No HID volume keys found. 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? > > and /dev/sndstat: > > 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) > > regards, lexi. 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? 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 You might also try to change the sample rate in virtual_oss to some other value, and then back to 48000. That could give us a hint. Regards, Florian