Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A95B1C4332F for ; Wed, 2 Nov 2022 12:46:25 +0000 (UTC) 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 E35A71673; Wed, 2 Nov 2022 13:45:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E35A71673 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1667393183; bh=KAiVP4hxsu2L5NGBGFNjqIPHr9XIdTvyA+XjlWITq90=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vMnig6v05OQ3xH79Y4jrJlY+siWCgoMt0mPhfp9f+MPS3lyPVUMrXqOmhnkcCDAis Vy0i5JIsVjhD/Kaq0tS5/npcz1tO/Mo13qyx7NrOTibV5JmQJZqGunVy6MW0I6Rb+7 GJDjlGyCe9Kkf45zr2mcjkLDG1BVm0FP+m4OvQxU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7DDCCF80254; Wed, 2 Nov 2022 13:45:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94A6FF8026D; Wed, 2 Nov 2022 13:45:31 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 86008F80085 for ; Wed, 2 Nov 2022 13:45:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 86008F80085 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="vrDbIHsd"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="nbEv8Nqz" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DECE71F38A; Wed, 2 Nov 2022 12:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667393124; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=37peSDiQBraTacaLpn6cE6W4mv8fdwZTVU6K3GDBugU=; b=vrDbIHsdiRC126CyGrW1B0neHCh8HXqw/6Gvouc/i8fjJJPhO6XdydPagZL/qLZmcILP2X IOqrZRgMJYcOCUboo9Mc28dZYhEynweNgg0+Y/uXS773m0g+1mbpz22pWcZbsK6tzikDjh sfdx0Jyx/3uVT2sAmtnAW2KDfvzKNwE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667393124; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=37peSDiQBraTacaLpn6cE6W4mv8fdwZTVU6K3GDBugU=; b=nbEv8NqzxL41dIrt76DiSJzrzWRy4rrsxnNLD6rTkM+NbcW5bRq++2cQXArT8i1QuUB5BI RrItw4Tpr8Jx1DAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D22DD13AE0; Wed, 2 Nov 2022 12:45:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id owHFMmRmYmPNHwAAMHmgww (envelope-from ); Wed, 02 Nov 2022 12:45:24 +0000 Date: Wed, 02 Nov 2022 13:45:24 +0100 Message-ID: <87r0ylsexn.wl-tiwai@suse.de> From: Takashi Iwai To: Jaroslav Kysela Subject: Re: [PATCH] ALSA: usb-audio: Fix regression with Dell Dock jack detection In-Reply-To: <8166d07d-804b-f81e-7b2b-c848da851527@perex.cz> References: <20221102113404.11291-1-tiwai@suse.de> <9b0c4f2d-1856-a80d-ad9d-9b34436fdc1c@perex.cz> <877d0dtvm2.wl-tiwai@suse.de> <8735b1tvbs.wl-tiwai@suse.de> <8166d07d-804b-f81e-7b2b-c848da851527@perex.cz> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org 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 Wed, 02 Nov 2022 13:18:05 +0100, Jaroslav Kysela wrote: > > On 02. 11. 22 13:05, Takashi Iwai wrote: > > On Wed, 02 Nov 2022 12:59:49 +0100, > > Takashi Iwai wrote: > >> > >> On Wed, 02 Nov 2022 12:53:48 +0100, > >> Jaroslav Kysela wrote: > >>> > >>> On 02. 11. 22 12:34, Takashi Iwai wrote: > >>>> The recent commit added Jack controls to Dell Dock, but it added with > >>>> iface = SNDRV_CTL_ELEM_IFACE_CARD. Unfortunately this doesn't match > >>>> with the changes in user-space UCM profile, which expects iface = > >>>> SNDRV_CTL_ELEM_IFACE_MIXER as default. This mismatch resulted in the > >>>> non-working profile, and the Dell Dock is gone on pipewire / > >>>> PulseAudio after the kernel update. > >>>> > >>>> Fix the regression by adjusting the iface of the new ctl elements to > >>>> *_MIXER. > >>> > >>> Hi Takashi, > >>> > >>> UCM expects SNDRV_CTL_ELEM_IFACE_CARD for jacks by default. Which > >>> change do you refer? I would drop this patch. > >> > >> It's about ucm2/USB-Audio/Dell/WD15-Dock-HiFi.conf, the JackControl > >> entries. For example, > >> JackControl "Headphone Jack" > >> expects the mixer element. The bad thing is that the complete card > >> entry disappears because of inconsistency. > >> If you modify the entry as > >> JackControl "name='Headphone Jack',iface=CARD" > >> it would work. But the fact that other JackControl stuff works, it's > >> better to align the USB-audio with IFACE_MIXER, I guess. > > > > Hm, looking at the UCM code, UCM should treat IFACE_CARD as default, > > indeed. Something went south. Will take a deeper look. > > Perhaps, it's this issue - > https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2744 . The > configuration for the Dell's docking station has also defined all > jacks. If only an output equipment is connected, the pipewire may set > the profile as not available. My fix (MR1429) should work. No idea why > this issue is not visible in PA. Yeah, I guess you're right, it's an issue in pipewire. Let's scratch my previous patch. My bogus fix in the kernel looked as if working just because it made the jack unmatching (again), hence it skips the bug of pipewire. BTW, while looking at this bug, I noticed another bug in alsa-lib src/ucm/main.c. The check in snd_use_case_parse_ctl_elem_id() should be rather to the value, not the identifier: --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -2793,7 +2793,7 @@ int snd_use_case_parse_ctl_elem_id(snd_ctl_elem_id_t *dst, strcmp(ucm_id, "CaptureSwitch")) return -EINVAL; snd_ctl_elem_id_clear(dst); - if (strcasestr(ucm_id, "name=")) + if (strcasestr(value, "name=")) return __snd_ctl_ascii_elem_id_parse(dst, value, NULL); iface = SND_CTL_ELEM_IFACE_MIXER; if (jack_control) Takashi