From: Takashi Iwai Subject: Re: Missing beep controls for Via HDA codec (snd_hda_codec_via) Date: Sun, 22 Mar 2015 09:04:27 +0100 Message-ID: References: <20150322075449.GT18986@odin.tremily.us> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 5ADE12606D9 for ; Sun, 22 Mar 2015 09:04:28 +0100 (CET) In-Reply-To: <20150322075449.GT18986@odin.tremily.us> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "W. Trevor King" Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sun, 22 Mar 2015 00:54:49 -0700, W. Trevor King wrote: > > My VT1802 chip has a beep-generating node: > > $ cat /proc/asound/card1/codec#0 > Codec: VIA VT1802 > ... > Vendor Id: 0x11068446 > Subsystem Id: 0x15587410 > Revision Id: 0x100000 > ... > Node 0x22 [Beep Generator Widget] wcaps 0x70040c: Mono Amp-Out > Amp-Out caps: ofs=0x0a, nsteps=0x12, stepsize=0x05, mute=1 > Amp-Out vals: [0x0a] > Power states: D0 D1 D2 D3 > Power: setting=D0, actual=D0 > ... > > But I'm missing the: > > Control: name=... > > entries that I think I need to manage this widget from alsamixer. For > example, sambrian posts codec output for a CX20561 chip which has [1]: > > Node 0x13 [Beep Generator Widget] wcaps 0x70000c: Mono Amp-Out > Control: name="Beep Playback Volume", index=0, device=0 > ControlAmp: chs=1, dir=Out, idx=0, ofs=0 > Control: name="Beep Playback Switch", index=0, device=0 > ControlAmp: chs=1, dir=Out, idx=0, ofs=0 > Amp-Out caps: ofs=0x03, nsteps=0x03, stepsize=0x17, mute=0 > Amp-Out vals: [0x00] > > I can patch with something like this: > > diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c > index 3de6d3d..85a0c08 100644 > --- a/sound/pci/hda/patch_via.c > +++ b/sound/pci/hda/patch_via.c > @@ -1520,8 +1520,10 @@ static int patch_vt2002P(struct hda_codec *codec) > spec->gen.mixer_nid = 0x21; > override_mic_boost(codec, 0x2b, 0, 3, 40); > override_mic_boost(codec, 0x29, 0, 3, 40); > - if (spec->codec_type == VT1802) > + if (spec->codec_type == VT1802) { > + spec->gen.beep_nid = 0x22; > fix_vt1802_connections(codec); > + } > add_secret_dac_path(codec); > > snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups); > > to get a dmesg entry like: > > input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/sound/card1/hdaudioC1D0/input15 > > but that doesn't add the beep controls. Looking at patch_analog.c, > patch_conexant.c, and patch_realtek.c for inspiration, I expect we'll > need an HDA_CODEC_MUTE_BEEP(_MONO) entry, and possibly an > HDA_CODEC_VOLUME(_MONO) entry, but I'm not sure if these should be > mono or not, or if they should be inputs (following patch_realtek.c) > or outputs (following patch_analog.c and patch_conexant.c). I've > filled out Via's datasheet-request form [2], but I don't know how > likely that is to be accepted. According to your output, the node 0x22 has: Node 0x22 [Beep Generator Widget] wcaps 0x70040c: Mono Amp-Out Amp-Out caps: ofs=0x0a, nsteps=0x12, stepsize=0x05, mute=1 Amp-Out vals: [0x0a] so this should mono and output. Other codecs may have different controls because rather controlling in the input of the mixer widget or such. Takashi