2015-3-22 下午11:17 於 "Takashi Iwai" tiwai@suse.de 寫道:
At Sun, 22 Mar 2015 21:27:24 +0800, Raymond Yau 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.
Why beep generator cannot automically found by auto parser ?
It can be, but it's not always connected to the right I/O in the topology, so left as codec-specific for now.
set_beep_amp() use beep_nid if beep generator widget has wcap Amp-Out
If the beep generator widget does not has wcap Amp-Out, it need to find out the node which has wcap Amp-Out and connect to beep generator widget
Node 0x0d [Audio Selector] wcaps 0x30010c: 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=0x0f, nsteps=0x0f, stepsize=0x0b, mute=1 Amp-Out vals: [0x80] Connection: 2 0x10* 0x16
Node 0x10 [Beep Generator Widget] wcaps 0x700000: Mono
Node 0x14 [Power Widget] wcaps 0x500500: Mono Power states: D0 D3 Power: setting=D0, actual=D0 Connection: 13 0x0d 0x0e 0x0f 0x10 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1d