Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@perex.cz>
Cc: alsa-devel@alsa-project.org,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	Takashi Iwai <tiwai@suse.com>,
	Ruud van Asseldonk <ruud@veniogames.com>,
	Geraldo Nascimento <geraldogabriel@gmail.com>
Subject: Re: Regression playing 24bit/96kHz audio on USB audio interface between 5.10.94 and 5.15.21
Date: Sat, 31 Dec 2022 14:20:56 +0100	[thread overview]
Message-ID: <87wn67wvyf.wl-tiwai@suse.de> (raw)
In-Reply-To: <47ec3cbb-19d1-ead1-46e8-3558ee7a8bcb@perex.cz>

On Sat, 31 Dec 2022 13:10:18 +0100,
Jaroslav Kysela wrote:
> 
> On 31. 12. 22 12:38, Ruud van Asseldonk wrote:
> > Hi all,
> > 
> > I bisected this and identified e4ea77f8e53f9accb9371fba34c189d0447ecce0
> > (ALSA: usb-audio: Always apply the hw constraints for implicit fb sync)
> > as the first commit where it is no longer possible to change the sample
> > rate. On the parent commit, my sample program successfully changes the
> > sample rate from 44100 Hz to 96000 Hz, but on e4ea77f8e53f9, the second
> > call to snd_pcm_hw_params fails.
> 
> There is an easy workaround - call snd_pcm_hw_free() between the
> params setup. This call ensure that the sync ep is freed. I can just
> confirm that this
> problem is only for USB hw with the implicit feedback (tested with 6.0.11 kernel).
> 
> I will try to debug this when I find a little free time. Perhaps,
> Takashi may have a straight idea, what's wrong. When only one stream
> is used, this hw_params call should succeed, too.

The patch like below might help (note: totally untested).

My wild guess is that it's an internal stream start for the implicit
fb case at prepare without actually starting a PCM stream, and it
wasn't stopped properly before the second hw_params call.


Takashi

-- 8< --
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -525,6 +525,8 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
 		if (snd_usb_endpoint_compatible(chip, subs->data_endpoint,
 						fmt, hw_params))
 			goto unlock;
+		if (stop_endpoints(subs, false))
+			sync_pending_stops(subs);
 		close_endpoints(chip, subs);
 	}
 

  reply	other threads:[~2022-12-31 13:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-06 22:18 Regression playing 24bit/96kHz audio on USB audio interface between 5.10.94 and 5.15.21 Ruud van Asseldonk
2022-12-11 15:30 ` Ruud van Asseldonk
2022-12-11 21:08   ` Geraldo Nascimento
2022-12-12  9:48     ` Thorsten Leemhuis
2022-12-12 12:41       ` Jaroslav Kysela
2022-12-30 18:42       ` Ruud van Asseldonk
2022-12-31 11:38         ` Ruud van Asseldonk
2022-12-31 12:03           ` Thorsten Leemhuis
2022-12-31 12:10           ` Jaroslav Kysela
2022-12-31 13:20             ` Takashi Iwai [this message]
2023-01-02 16:57               ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn67wvyf.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=geraldogabriel@gmail.com \
    --cc=perex@perex.cz \
    --cc=regressions@leemhuis.info \
    --cc=ruud@veniogames.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox