From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796270591; b=K1mBvQGuSiHdNnIbrhYDBRHhEIlZQNvh84VLr66wrgAuxFidPLkzsAADTlfjgwi8it3H 6bHPqsveUbbD7uWZejrsOx9YdWMAtA/SbgnHT5G7jJjQ2FytB/N9EcI5QrNbkMPqOPc/1 rUUR+oVGjeETKFcapfQ5kwRyxgGHGehWO2TZwVKw6EPBCBQ8CskUmfgvJ2BQT9r8lZwmL kE2qxpZUEclGy8tUpYs1Voi2xByTZdyfqeyNVS0A1VwYEor/I1pDRGb+ISCe0LSmqxuuv 4KbfntwQ0d3FtmOBc14ncNQxQjh3kYX4KswkfF6SMtaZiR9PRvGtBf+s7KtNEaD4Q9A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796270591; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=yuLjPP7+ulcz/3WyXm+MQP75KxznTrF+MQUis8YxKJk=; b=d2gcCLNRabxs+kmqiZsd9Fhq4Ws5C6r6+oZFii5U/+PAdy522VljrGrEg9Up+X6iBDY8 UBv24JG6n8CQ+1Huq6jD6Yh3pvJ6wvgkZCYOqFc1LtyFmOMk/uH2StELvGppUq9adkTQd YatUFUdRviR52Sjl3QasAevqaFCh6Pv5NvNMYtCMsfluyx6S/wb5Z8/z4bNYydsP6zk5r 35Kj55QPu1AWAfe+bJre+/0BZK8bhkYao73optE2M0tyKoMYWR7gd3UTSUfQJIozN4Skc 2WxCcc64TJtayuK3lOy4BW+NWFZuyiEPqF+jwk4/R5DHel2crbk3jVUudJymmiQzerg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yS17jBcD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEE41606A32D for ; Thu, 3 Dec 2026 04:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yS17jBcD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27B691F00893; Thu, 3 Dec 2026 04:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796270591; bh=yuLjPP7+ulcz/3WyXm+MQP75KxznTrF+MQUis8YxKJk=; h=Subject:To:Cc:From:Date; b=yS17jBcDdLK81iOGVnxmMqykXwG5iEtlDXyhC2xBY7Dx0bkkk0lWMVseHUVuNEQO8 v7NyWjei6Pf05VPjLxCKD+8VU/jeHzrqs//DdqAD+2LVVkKRznLOuCt0ZnDXqYxPYd Q8k75iY1WhWS0ed3fkFRuxQBzcj6/Qw19s0uSXK0= Subject: FAILED: patch "[PATCH] ALSA: pcm: oss: Refine slave hw_params after setting format" failed to apply to 6.18-stable tree To: hengyul@cs.unc.edu,stable@vger.kernel.org,tiwai@suse.de Cc: From: Date: Thu, 03 Dec 2026 04:44:27 +0100 Message-ID: <2026120327-nectar-tux-33da@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x ddea524e437eae0d5581482a90565b4c1e6d4b24 # git commit -s git send-email --to '' --in-reply-to '2026120327-nectar-tux-33da@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ddea524e437eae0d5581482a90565b4c1e6d4b24 Mon Sep 17 00:00:00 2001 From: Hengyu Liang Date: Wed, 25 Nov 2026 13:10:05 -0500 Subject: [PATCH] ALSA: pcm: oss: Refine slave hw_params after setting format Commit 93d7d38fa61d ("ALSA: aloop: add DSD formats") added DSD_U8 to the formats of snd-aloop. Before that, its narrowest format had 16 bits. However, snd_pcm_oss_change_params_locked() sets the slave format with _snd_pcm_hw_param_set(), which does not refine the parameters, while the access, rate and channels before it are set with refining helpers. snd_pcm_oss_period_size() then reads a buffer size maximum that is still computed for the narrowest format, now DSD_U8, so the OSS period doubles. With the default U8 client format, the doubled period no longer fits in the format plugin, and snd_pcm_plugin_alloc() returns -ENOMEM. As of now, an OSS program that asks snd-aloop for 8 channels at 192 kHz gets ENOMEM from SNDCTL_DSP_SPEED and from every later ioctl on the same file. The issue can be reproduced with this program, where card 1 is snd-aloop: #include #include #include #include int main(void) { int fd = open("/dev/dsp1", O_WRONLY | O_NONBLOCK); int ch = 8, rate = 192000, blk = 0; ioctl(fd, SNDCTL_DSP_CHANNELS, &ch); if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0) perror("SNDCTL_DSP_SPEED"); if (ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blk) < 0) perror("SNDCTL_DSP_GETBLKSIZE"); printf("block size %d\n", blk); return 0; } Before that commit, it prints "block size 65536". After that commit, the result is: SNDCTL_DSP_SPEED: Cannot allocate memory SNDCTL_DSP_GETBLKSIZE: Cannot allocate memory block size 0 This patch will set the format with snd_pcm_hw_param_set(), which refines the parameters, as is done for the channels just before. Fixes: 93d7d38fa61d ("ALSA: aloop: add DSD formats") Cc: Signed-off-by: Hengyu Liang Link: https://patch.msgid.link/20261125181005.3683575-1-hengyul@cs.unc.edu Signed-off-by: Takashi Iwai diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 66162caa45d4..3c2ac8966d5e 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -921,7 +921,8 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) goto failure; } format_found: - err = _snd_pcm_hw_param_set(sparams, SNDRV_PCM_HW_PARAM_FORMAT, sformat, 0); + err = snd_pcm_hw_param_set(substream, sparams, + SNDRV_PCM_HW_PARAM_FORMAT, sformat, 0); if (err < 0) goto failure;