Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp559169pxb; Thu, 25 Feb 2021 09:08:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeM1iIBaTzKlchkw7qkdbWib7gicYWMqSw1HyKzUMStYmnzH3eA67GgWkpr2DNQDXQf8WT X-Received: by 2002:a17:906:5391:: with SMTP id g17mr3544980ejo.283.1614272920102; Thu, 25 Feb 2021 09:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614272920; cv=none; d=google.com; s=arc-20160816; b=GXxLW3s9ByK49mIT21+bYsXHid3uDP84UFDN0nS9BXfFrv0+Qg4FhlQ31+b+5tfkR4 CQtr2A3rlKTiEPwAuZg4ULlde55EsI66VAxUqcncDUpZ33gLIar9Eg2rI8CkYqOvMdTD /oB5t7b/GEHge4bTcOjeo1E6SL7aKMUHZdvkPbCQEMDhyZDvkGS6Qf0/ggLVt9cgiAwX A9p821tdthJws+2V/p273JTouiv4JxoZh/QWko91sPqHvut54jTFvxDxPd+WDbe9k1PY xLG00cU2I7SHaNw+cV+6nc0xuIR7M/nm5wmY70Usuq/tu5BOSCqaBsttsZn0iH/C5q78 niIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:openpgp:organization :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=2OnKx270sn1AOBkiX4NyVLDWJ8xXKWQtqpEp+ctOnx0=; b=mbayCzEhysOFtorhhCX1aJo6PkDKHiY0AvFjYxBMF0alh9Binio1KPZPA8XxmMWT+n sPS6qX7m25zi727y6O0b2nMQUZOClf6nXaO+6SUzGs8Lo2TujXUsbATnsaRhoYZLhEDO AKEbvIieU9UWRh7N6hdTiGn7P7YxaGnp+NvtrwrO/SeSzgcuMjoNrM9nggtnJsxixBQq AtF6mbxAXfr1GbLn5J61gKi5W1UaazahzQfmSu+IqWKMDl6izR116DeCu0/KnRFkAdwA nrES2+YKxY9v0nfhkHvCJ4v07NxzNkEqYzqGJHEbE3TftSkoQcDvzFkb+p8nXYnQeGdk F5bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i15si3621804edl.581.2021.02.25.09.08.16; Thu, 25 Feb 2021 09:08:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233501AbhBYRG6 (ORCPT + 99 others); Thu, 25 Feb 2021 12:06:58 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:54969 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234125AbhBYREb (ORCPT ); Thu, 25 Feb 2021 12:04:31 -0500 Received: from localhost ([109.247.224.130]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N9d4t-1lrMUo0Cmb-015YOo; Thu, 25 Feb 2021 18:01:55 +0100 Date: Thu, 25 Feb 2021 18:01:53 +0100 From: Heinz Diehl To: linux-kernel@vger.kernel.org Cc: tiwai@suse.de, lpoetter@redhat.com Subject: [BISECTED] Kernel 5.11.x breaks pulseaudio Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Accept-Language: no,dk,se,en,de Organization: private site OpenPGP: id=60F4A92C; url=http://www.fritha.org/htd.asc; preference=signencrypt User-Agent: Mutt/1.14.7+158 (b0ccf259) (2020-09-25) X-Provags-ID: V03:K1:6kv1+b1m3bpcqzD41nyt84EbcOe+4VwSCoZpqBlydzmzeWzNhJa hjjUDe4ItYgUslZLNmKDoDE0qeEIGIgoiLIl1kZ2KHqbE23nxsMgAFwYJOfDCweH3y4TN3D BpGRvMEzJWufw1mweHHUU85MyAdMuTxwBFebIrW00NsN6IVStbla9jMZb5VSzI8CL002FcB W933FdCl8AqAOeqYaVSIw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Vo8d7Ye1T3w=:6xVerhlssNvFcoZowoiicH SzrANwTKQ64XmUQkt1okR5cu+XxGbnOupnZpZXuW+kWFL4mqtWAZC7/4z89DLaZpgJ0Ycaa7u lG8Q9dhKh7WxXszBIXUcCMx/O0zt6f2n4cyScHUlY5UTIhcO+B294cNcKvIRmQY3ZiuNqsnXk YTkyvcjybPo0ZHRQVpQFPOPwyrnETpN0wH9VYZCHRxk9GqEl4ApZIx/zDrDgilIf9AOBRcBX1 vcDMPRu+W7PqdpriNjJdVBJV0zJQgPm7/a1+lHkToG1aNKUBCDeH3bdNXMGhQVcK36kFd/vur zYvCuQyB9Ye0E2aDAKY527tcj0MkQzOzLRFteOGnw/nHUKg6eNjmOmpYkcFv/WvekLjhlVDot qvu1h/PJXa8ovPFIwExTABS1pINxM9HklB6gS3YDBhl4rPWHtkvUVkdJ4qHGvHqi82ng4fj7u vamuyNNNhA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, from kernel 5.11 on, pulseaudio always resamples audio to the sample rate specified by default-sample-rate, despite "avoid-resampling = true". Audio that matches alternate-sample-rate is resampled in the same way. This means that both "alternate-sample-rate" and "avoid-resampling=true" are no longer working. Steps to Reproduce: 1. Set "avoid-resampling = true" in daemon.conf 2. Set default-sample-rate = 44100 in daemon.conf 3. Set alternate-sample-rate 48000 in daemon.conf 4. Restart pulseaudio 5. Play a 48000 (or any other) audio file Actual results: File is played as 44100 audio. Pacmd list-sink-inputs shows that resampling is happening. Play an audio file with any other sample rate, and it will be resampled to 44100. Expected results: Audio file plays at 48000. Any other file is played in its own sample rate. In my case, this affects USB audio. Tried both a Dragonfly Red, a Fostex HP-A4 and an unknown Soundblaster USB audio dac/amp, and all of them show the same behaviour as described here. Most probably, the regression affects all USB audio devices. All kernels from the 5.10 series are fine. Here's the offending patch that introduced the regression. Reverting it on top of kernel 5.11 / 5.11.1 resolves the problem: [root@chiara linux-stable]# git bisect good e4ea77f8e53f9accb9371fba34c189d0447ecce0 is the first bad commit commit e4ea77f8e53f9accb9371fba34c189d0447ecce0 Author: Takashi Iwai Date: Mon Jan 11 09:16:11 2021 +0100 ALSA: usb-audio: Always apply the hw constraints for implicit fb sync Since the commit 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync"), we apply the hw constraints for the implicit feedback sync to make the secondary open aligned with the already opened stream setup. This change assumed that the secondary open is performed after the first stream has been already set up, and adds the hw constraints to sync with the first stream's parameters only when the EP setup for the first stream was confirmed at the open time. However, most of applications handling the full-duplex operations do open both playback and capture streams at first, then set up both streams. This results in skipping the additional hw constraints since the counter-part stream hasn't been set up yet at the open of the second stream, and it eventually leads to "incompatible EP" error in the end. This patch corrects the behavior by always applying the hw constraints for the implicit fb sync. The hw constraint rules are defined so that they check the sync EP dynamically at each invocation, instead. This covers the concurrent stream setups better and lets the hw refine calls resolving to the right configuration. Also this patch corrects a minor error that has existed in the debug print that isn't built as default. Fixes: 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync") Link: https://lore.kernel.org/r/20210111081611.12790-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/usb/pcm.c | 171 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 108 insertions(+), 63 deletions(-) [root@chiara linux-stable]# Feel free to contact me if you think I can help. Thanks, Heinz.