From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 090B0C433DF for ; Sun, 24 May 2020 08:38:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 804D92076C for ; Sun, 24 May 2020 08:38:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Q6S85ywv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 804D92076C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B69A11730; Sun, 24 May 2020 10:37:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B69A11730 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1590309513; bh=WY8mtjZCSHbo6LcrJoCH5pMZ3A2KJqEYElpFNNvz2FA=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Q6S85ywvB1ct3QRpkRPw3x9otRWUDQp3lCWZFkpIDaM+ylZuoZwTuVjjnjIrkBQeA Ok+em7oZyxL0Z2uLaahywKAuNhcTA8oDsltABUWJs4RgmX89Dyp0Q6HW2TCwKEDDHZ Nabx1Wk4wMFQ31XJlfe2ZgyXuGIr8vhzQmKDoR1w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2000EF8013C; Sun, 24 May 2020 10:37:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8CBF8F8015C; Sun, 24 May 2020 10:37:41 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4BDAAF8013C for ; Sun, 24 May 2020 10:37:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4BDAAF8013C X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D376CAC6D; Sun, 24 May 2020 08:37:38 +0000 (UTC) Date: Sun, 24 May 2020 10:37:34 +0200 Message-ID: From: Takashi Iwai To: Erwin Burema Subject: Re: [PATCH] Add duplex sound support for USB devices using implicit feedback In-Reply-To: <1674042.U9NR2fmVFg@alpha-wolf> References: <2410739.SCZni40SNb@alpha-wolf> <6103f3aba91020ea345e9146da82e52823b7c298.camel@tsoy.me> <1674042.U9NR2fmVFg@alpha-wolf> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, Alexander Tsoy X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Sat, 23 May 2020 20:09:31 +0200, Erwin Burema wrote: > > On zaterdag 23 mei 2020 19:53:49 CEST Alexander Tsoy wrote: > > В Вс, 10/05/2020 в 20:29 +0200, Erwin Burema пишет: > > > For USB sound devices using implicit feedback the endpoint used for > > > this feedback should be able to be opened twice, once for required > > > feedback and second time for audio data. This way these devices can > > > be put in duplex audio mode. Since this only works if the settings of > > > the endpoint don't change a check is included for this. > > > > > > This fixes bug 207023 ("MOTU M2 regression on duplex audio") and > > > should also fix bug 103751 ("M-Audio Fast Track Ultra usb audio > > > device will not operate full-duplex") > > > > > > Signed-off-by: Erwin Burema > > > --- > > > > This patch seems to cause kernel panic on my system. This happens > > during boot when gdm (with pulseaudio) is starting up. > > > > That's interesting, not running gnome (and thus also not running gdm, > currently KDE with SDDM) here so would need to take some time troubleshooting. > Suspect I missed something in the check if both input and output are similarly > configured. > > Will see if I can reproduce it and where exactly it goes wrong, in the > meantime would it be possible to test if 5.6 or later show the same issue > since I intially developed the patch against that release? Judging from the point triggering the bug (memset()), this can be a leftover URB handling that is performed even after the capture stream is closed. If so, the procedure would be: - start capture - start playback - stop capture while keeping playback running If my guess is correct, can the patch below work around the issue? thanks, Takashi --- --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -1782,6 +1782,7 @@ static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream return 0; case SNDRV_PCM_TRIGGER_STOP: stop_endpoints(subs); + subs->data_endpoint->retire_data_urb = NULL; subs->running = 0; return 0; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: