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 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 A4263C43334 for ; Mon, 4 Jul 2022 12:30:11 +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 3899A1701; Mon, 4 Jul 2022 14:29:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3899A1701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1656937809; bh=Uzj/tzO1mqwugE25VonXVfE64HN60XkGkvKCkICBP74=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=b2dMe6Bj/hZvyqnnuQ/bDAjIfwvN8C67JEkW7gTkP0r1ga6a4sLh0VMyh9J52hxxB W83eKY47oM4Oi4gQALWBQCgJKn7I//phiS5BJIa3simcEVS2x7Bq8yS4I/1qWEnr2z nIhEqWVDL9vvJREFOvv7roMIsIFJX3jH3E9Stddk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C75A4F80139; Mon, 4 Jul 2022 14:29:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 47970F8014E; Mon, 4 Jul 2022 14:29:15 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 73FA6F80139 for ; Mon, 4 Jul 2022 14:29:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 73FA6F80139 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="1MnlJP/O"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="y8vn3Xys" 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-out1.suse.de (Postfix) with ESMTPS id A9CF7227E3; Mon, 4 Jul 2022 12:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1656937746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OKC1glIhcMx0XecLi7KWS4MMauWMpH5WiVJgOoHrSqo=; b=1MnlJP/OqncCA/vKgXqbRLkRaclxpI92Nq8Ab0ke/XtZnLPconw5UJSJx4f642mmQUI4EY juyEWMbNJWgtkzXePZhQ+Lb2dBQi4EtMUI8ILD8ChY7nNkbLzKxZZAbQcC0hzCMa58/tFn /dfryxNSn+Vyh+Ey9UTYJqXMaVfQhgE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1656937746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OKC1glIhcMx0XecLi7KWS4MMauWMpH5WiVJgOoHrSqo=; b=y8vn3XyseDqNwPF2Lr4JO8+nx5f432Dpo1Lo3Fp6hq5UeHyEy6ani2ozfMk+3LrY3e+RmZ FaZYNJGu3adFG4Ag== 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 48C131342C; Mon, 4 Jul 2022 12:29:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UHDXEBLdwmJELAAAMHmgww (envelope-from ); Mon, 04 Jul 2022 12:29:06 +0000 Date: Mon, 04 Jul 2022 14:29:05 +0200 Message-ID: <874jzxysby.wl-tiwai@suse.de> From: Takashi Iwai To: Jan =?ISO-8859-1?Q?Sch=E4r?= Subject: Re: [PATCH 1/2] ALSA: usb-audio: Support jack detection on Dell dock In-Reply-To: <20220627171855.42338-1-jan@jschaer.ch> References: <20220627171855.42338-1-jan@jschaer.ch> 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=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, Takashi Iwai 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 Mon, 27 Jun 2022 19:18:54 +0200, Jan Schär wrote: > > The Dell WD15 dock has a headset and a line out port. Add support for > detecting if a jack is inserted into one of these ports. > For the headset jack, additionally determine if a mic is present. > > The WD15 contains an ALC4020 USB audio controller and ALC3263 audio codec > from Realtek. It is a UAC 1 device, and UAC 1 does not support jack > detection. Instead, jack detection works by sending HD Audio commands over > vendor-type USB messages. > > I found out how it works by looking at USB captures on Windows. > The audio codec is very similar to the one supported by > sound/soc/codecs/rt298.c / rt298.h, some constant names and the mic > detection are adapted from there. The realtek_add_jack function is adapted > from build_connector_control in sound/usb/mixer.c. > > I tested this on a WD15 dock with the latest firmware. > > Signed-off-by: Jan Schär > --- > For testing this patch, you need to change the content of the file > /usr/share/alsa/ucm2/USB-Audio/Dell-WD15-Dock-HiFi.conf to the following: > ``` > SectionDevice."Headphones" { > Comment "Headphones" > > Value { > PlaybackPriority 100 > PlaybackPCM "hw:${CardId}" > JackControl "Headphone Jack" > > If.Headphone_ctl { > Condition { > Type ControlExists > Control "name='Headphone Playback Switch'" > } > True { > PlaybackMixerElem "Headphone" > PlaybackVolume "Headphone Playback Volume" > PlaybackSwitch "Headphone Playback Switch" > } > } > } > } > > SectionDevice."Line" { > Comment "Line Out" > > Value { > PlaybackPriority 200 > PlaybackPCM "hw:${CardId},1" > JackControl "Line Out Jack" > > If.Line_ctl { > Condition { > Type ControlExists > Control "name='Line Playback Switch'" > } > True { > PlaybackMixerElem "Line" > PlaybackVolume "Line Playback Volume" > PlaybackSwitch "Line Playback Switch" > } > } > } > } > > SectionDevice."Headset" { > Comment "Headset Microphone" > > Value { > CapturePriority 100 > CapturePCM "hw:${CardId}" > JackControl "Headset Mic Jack" > > If.Mic_ctl { > Condition { > Type ControlExists > Control "name='Mic Capture Switch'" > } > True { > CaptureMixerElem "Mic" > CaptureVolume "Mic Capture Volume" > CaptureSwitch "Mic Capture Switch" > } > } > } > } > ``` This is an interesting finding. Applied both patches to for-next branch now. Thanks! Takashi