[alsa-devel] Help With Getting Line-in monitoring working
Hi,
I need some help getting my cards line-in monitoring working. That is analog pass-through from line-in to headphone out.
I am using Ubuntu 10.04 with Linux kernel Linux Intel 2.6.38-10 (Ubuntu package). I am using on-board audio with HDA-Intel with the Realtek ALC892 codec.
With the stock Ubuntu kernel (lets call this setup "stable") I can't get line-in monitoring working (note however I can record from line in, I just can't get the analog pass-through working). However, when I install the latest ALSA drivers (lets call this setup "soso") (recompiled a source package from the Ubuntu-audio-dev ppa, head 7c48f32b). I can get Line-in monitoring but the mixer controls are all mixed up. The Line-in control controls the Line-in volume, but the master control has no effect. Also, the PCM control has no effect on PCM volume and the front control controls the output to the headphone but in order to mute the headphone I still need to use the headphone mute. The mixer work correctly with the stable setup.
Thus I am lead to the conclusion that the latest ALSA drivers are doing something right with line-in but getting a lot of other things wrong.
Attached is the alsa-info output of both setups.
Please give me some guidance on how to debug this problem. For example what is the newer code doing that the old code is not that gets line-in monitoring working but gets a lot of the other mixer setups wrong. I assume it is just a matter of "hooking up" the line in to the headphone out, and all that is needed is the right verb, but I am at a complete lost to what verb that is.
If there is some specific version of the ALSA drivers I should try please let me know. If the Ubuntu kernel is causing a problem I am willing to install a stock kernel, but I rather not unless absolutely necessary.
2011/9/5 Kevin Atkinson kevina@gnu.org:
Hi,
I need some help getting my cards line-in monitoring working. That is analog pass-through from line-in to headphone out.
I am using Ubuntu 10.04 with Linux kernel Linux Intel 2.6.38-10 (Ubuntu package). I am using on-board audio with HDA-Intel with the Realtek ALC892 codec.
With the stock Ubuntu kernel (lets call this setup "stable") I can't get line-in monitoring working (note however I can record from line in, I just can't get the analog pass-through working). However, when I install the latest ALSA drivers (lets call this setup "soso") (recompiled a source package from the Ubuntu-audio-dev ppa, head 7c48f32b). I can get Line-in monitoring but the mixer controls are all mixed up. The Line-in control controls the Line-in volume, but the master control has no effect. Also, the PCM control has no effect on PCM volume and the front control controls the output to the headphone but in order to mute the headphone I still need to use the headphone mute. The mixer work correctly with the stable setup.
Thus I am lead to the conclusion that the latest ALSA drivers are doing something right with line-in but getting a lot of other things wrong.
connect node 0x1b HP to 0x02 instead of 0x26, you will unable to use the headphone playback volume at 0x25
Node 0x1b [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out + Control: name="Headphone Playback Switch", index=0, device=0 + ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 @@ -436,11 +444,11 @@ Conn = 1/8, Color = Green DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP VREF_HIZ - Unsolicited: tag=00, enabled=0 + Unsolicited: tag=04, enabled=1 Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0 Connection: 5 - 0x0c 0x0d 0x0e 0x0f 0x26* + 0x0c* 0x0d 0x0e 0x0f 0x26
Node 0x25 [Audio Output] wcaps 0x41d: Stereo Amp-Out Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0 Amp-Out vals: [0x40 0x40] Converter: stream=5, channel=0 PCM: rates [0x560]: 44100 48000 96000 192000 bits [0xe]: 16 20 24 formats [0x1]: PCM Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0 Node 0x26 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80] Connection: 2 0x25 0x0b
[ 6.272032] snd: bad kfree (called from f87381e3) -- [ 6.272043] [<f85612b1>] ? snd_hidden_kfree+0x91/0xa0 [snd] [ 6.272048] [<f87381e3>] ? snd_array_free+0x13/0x30 [snd_hda_codec] [ 6.272052] [<f87381e3>] ? snd_array_free+0x13/0x30 [snd_hda_codec] [ 6.272057] [<f87abfaf>] ? alc_free_kctls+0x4f/0x60 [snd_hda_codec_realtek] [ 6.272061] [<f87affed>] ? alc_build_controls+0x44d/0x4b0 [snd_hda_codec_realtek] [ 6.272066] [<f873c4a5>] ? snd_hda_codec_build_controls+0x45/0x50 [snd_hda_codec] [ 6.272071] [<f873c4df>] ? snd_hda_build_controls+0x2f/0x90 [snd_hda_codec] [ 6.272074] [<f857651d>] ? azx_probe+0xc5c/0x173f [snd_hda_intel] [ 6.272078] [<f8575590>] ? azx_send_cmd+0x0/0x2a0 [snd_hda_intel] [ 6.272080] [<f85752b0>] ? azx_get_response+0x0/0x2e0 [snd_hda_intel] [ 6.272083] [<f8574660>] ? azx_attach_pcm_stream+0x0/0x1b0 [snd_hda_intel] [ 6.272086] [<f8574300>] ? azx_bus_reset+0x0/0x70 [snd_hda_intel] [ 6.272088] [<f8573ff0>] ? azx_power_notify+0x0/0xa0 [snd_hda_intel] [ 6.272092] [<c129b807>] ? local_pci_probe+0x47/0xb0 -- [ 6.272116] [<c129c935>] ? __pci_register_driver+0x45/0xb0 [ 6.272119] [<f8542017>] ? alsa_card_azx_init+0x17/0x1000 [snd_hda_intel] [ 6.272122] [<c1003045>] ? do_one_initcall+0x35/0x170 [ 6.272125] [<f8542000>] ? alsa_card_azx_init+0x0/0x1000 [snd_hda_intel] [ 6.272129] [<c108f32b>] ? sys_init_module+0xdb/0x230 -- [ 6.272136] [<c100a99f>] ? sysenter_do_call+0x12/0x28
Take a diff of your alsa-info,
"Side Playback Volume" and "auto-mute mode"
!!Amixer output !!------------- @@ -649,8 +658,8 @@ Card hw:0 'Intel'/'HDA Intel at 0xf7ef4000 irq 42' Mixer name : 'Intel IbexPeak HDMI' Components : 'HDA:10ec0892,10438436,00100302 HDA:80862804,80860101,00100000' - Controls : 37 - Simple ctrls : 20 + Controls : 40 + Simple ctrls : 22 Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum Playback channels: Mono @@ -708,6 +717,13 @@ Playback channels: Mono Limits: Playback 0 - 64 Mono: Playback 0 [0%] [-64.00dB] [off] +Simple mixer control 'Side',0 + Capabilities: pvolume pswitch penum + Playback channels: Front Left - Front Right + Limits: Playback 0 - 64 + Mono: + Front Left: Playback 0 [0%] [-64.00dB] [on] + Front Right: Playback 0 [0%] [-64.00dB] [on] Simple mixer control 'Line',0 Capabilities: pvolume pswitch penum Playback channels: Front Left - Front Right @@ -739,6 +755,10 @@ Limits: Capture 0 - 46 Front Left: Capture 19 [41%] [3.00dB] [off] Front Right: Capture 19 [41%] [3.00dB] [off] +Simple mixer control 'Auto-Mute Mode',0 + Capabilities: enum + Items: 'Disabled' 'Enabled' + Item0: 'Enabled' Simple mixer control 'Digital',0 Capabilities: cvolume penum Capture channels: Front Left - Front Right
[I wasn't sure if this post was directed at me or Takashi Iwai.]
I spent several hours going over the data sheet (ver 1.3, you can find it at http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&PNid=24&... or just Google it if you don't already have it) and in particular the Block Diagram on page 5. And, things are finally making sense to me.
Apparently there is no hardware master control and the master and PCM slider must be implemented in software.
So, after the change you suggest below the mixer are mapped better in the newer drivers. But things can be still be improved. More below.
On Mon, 5 Sep 2011, Raymond Yau wrote:
2011/9/5 Kevin Atkinson kevina@gnu.org:
Hi,
I need some help getting my cards line-in monitoring working. That is analog pass-through from line-in to headphone out.
I am using Ubuntu 10.04 with Linux kernel Linux Intel 2.6.38-10 (Ubuntu package). I am using on-board audio with HDA-Intel with the Realtek ALC892 codec.
With the stock Ubuntu kernel (lets call this setup "stable") I can't get line-in monitoring working (note however I can record from line in, I just can't get the analog pass-through working). However, when I install the latest ALSA drivers (lets call this setup "soso") (recompiled a source package from the Ubuntu-audio-dev ppa, head 7c48f32b). I can get Line-in monitoring but the mixer controls are all mixed up. The Line-in control controls the Line-in volume, but the master control has no effect. Also, the PCM control has no effect on PCM volume and the front control controls the output to the headphone but in order to mute the headphone I still need to use the headphone mute. The mixer work correctly with the stable setup.
Thus I am lead to the conclusion that the latest ALSA drivers are doing something right with line-in but getting a lot of other things wrong.
connect node 0x1b HP to 0x02 instead of 0x26, you will unable to use the headphone playback volume at 0x25
This doesn't make sense, I think you meant connect 0x1b to 0x26 like it was in the older drivers. At least for me, my headphone mixer is working correctly after making this change (with the newer driver).
Node 0x1b [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
- Control: name="Headphone Playback Switch", index=0, device=0
- ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
@@ -436,11 +444,11 @@ Conn = 1/8, Color = Green DefAssociation = 0x2, Sequence = 0x0 Pin-ctls: 0xc0: OUT HP VREF_HIZ
- Unsolicited: tag=00, enabled=0
- Unsolicited: tag=04, enabled=1 Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0 Connection: 5
0x0c 0x0d 0x0e 0x0f 0x26*
0x0c* 0x0d 0x0e 0x0f 0x26
Also to get line-in pass-through working via headphone out please unmute the second set of Amp-in vals of pin 0x26.
Node 0x26 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80]
^^^^^^^^^^^ set these to 0x00
Connection: 2 0x25 0x0b
Apparently all analog inputs are mixed together using 0x0B and then the output is sent to a bunch of other audio mixers, but these mixers don't really control the volume, they just have a separate mute for the PCM and analog input. That being said, it probably also makes sense to mute analog audio (coming from 0x0B) on all but pins 0x26 (headphone) and 0x0C (front) by default.
The fact that the master (or individual output controls for that matter) doesn't control the analog pass-through volume is unfortunate, but I can live with. At least with the newer drivers the mute also mute the analog pass-through which was not the case with the old drivers.
Speaking of mixer settings, for pins that are configured to output and have the "HP" capacity, please expose this widget control somehow on the mixer. I am not sure I would call it call it an amp toggle because what it really does is switch between line-out and headphone-out. This is important because when I first tried the card I wasn't sure what the front Headphone out and the back Front out where configured as (I knew they could be both from the motherboard manual). A switch will give me confidence that they are configured correctly. In addition, this is something users should be able to control without having to know the intricacies of the Intel HDA spec and using hda-analyze.
On a lesser note the mixer settings for recording are really don't really correspond to how to hardware is set up. According to the diagram there are two separate PCM recorders and each of them can take input from the analog mixer (0x0B) or they can bypass the mixer by unmuting any of the analog inputs (controlled by mixer 22h and 23h), then after that there is another volume control which controls the combined input (0x09 0x08).
The current mixer only allows one to select source for each PCM recorders and does not give the option to use the analog mixer (0x0B) which might make sense if you want to record from two mics.
On an even lesser note, it would be really nice if ALSA could expose the full capacity of the hardware without having an unwieldy number of mixer controls. For example each of the 5 output mixers have a separate PCM and analog pass-though mute control, it would be nice to expose this. Also, each of the 8 analog pins can be repurposed as either input or output, some of them have a headphone amp, some of them have a mic boost, it would be nice if all this could all be exposed. However, I can see how exposing all this will lead to a lot of confusing mixer settings.
Short of that, it would be nice if it would be possible to reconfigure mixer hookups and add new mixers. For example if I repurpose the one of the output pins for an additional line-in it would like to be able to control the volume for it and select it for recording. I can see how to reconfigure the HDA-Intel setting via /sys/class/sound but I can not see how to control the mixer configuration. In can reconfigure the card using hda_analyzer but it is very non-obvious how to get the codec to re-configuration based on those settings (and possible expose some additional mixer settings, if say one of the output pins becomes an input pin). Nor is it obvious how to make those settings persistent. An option for hda_analyzer to expose the difference in a way that can be used by /sys/class/sound and/or via the Early Patching option would be helpful.
participants (2)
-
Kevin Atkinson
-
Raymond Yau