Re: [alsa-devel] Throughts on getting ALC892 working better (was Re: Help With Getting Line-in monitoring working)
2011/9/6 Kevin Atkinson kevin@atkinson.dhs.org:
How did you get "snd: bad kfree" in the system log ?
[ 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]
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&...
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.
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
The ALC892 provides ten DAC channels that simultaneously support 7.1 channel sound playback, plus 2 channels of independent stereo sound output (multiple streaming) through the front panel stereo outputs.
you can create playback device 2 for the front panel headphone by adding
spec->alt_dac_nid = 0x25;
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 hardest thing is how to add the controls for this alc892
http://thread.gmane.org/gmane.linux.alsa.devel/88324
The laptop has built-in 5.1, and 5.1 or 7.1 output via jacks.
DAC NIDs: 0x02 front 0x03 rear 0x04 clfe 0x05 side
internal mixers: 0x0c front 0x0d rear 0x0e clfe 0x0f side
internal speaker pins: 0x14 front 0x15 "rear" (front of laptop) 0x16 clfe
external ports: fixed route: 0x17 side
can select any output: 0x18 mic / output 0x1a line-in / output 0x1b headphone
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.
does any user really want to pass the stereo signal from line in to "center/lfe" ?
On Tue, 6 Sep 2011, Raymond Yau wrote:
2011/9/6 Kevin Atkinson kevin@atkinson.dhs.org:
How did you get "snd: bad kfree" in the system log ?
No idea. I am using alsa-driver.git, kernel incompatibility?
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&...
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.
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
The ALC892 provides ten DAC channels that simultaneously support 7.1 channel sound playback, plus 2 channels of independent stereo sound output (multiple streaming) through the front panel stereo outputs.
you can create playback device 2 for the front panel headphone by adding
spec->alt_dac_nid = 0x25;
I'm sorry I know nothing of the alsa code, but this doesn't seam like it will do what we want. What is this doing? Basically I want the driver to unmute the input from 0x0b for mixer 0x26, like it doesn't on all the other internal mixers that have 0x0b going into it.
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 hardest thing is how to add the controls for this alc892
I think we are talking past each other here....
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.
does any user really want to pass the stereo signal from line in to "center/lfe" ?
I did say "On an even lesser note", my point is the hardware can do it, the driver should be able to expose the functionality somehow. I don't really care through.
Anyway the point is that on my machine using the latest code from the alsa-driver.git all the mixer setups are working well after I make the two additional changes to the initial setup everything seams to work.
If it helps I can resend the /proc/* output after I manually tweak the setting so that things work correctly for me.
I don't have time right now to figure out how to get these changes into the code, but if someone can give me a patch to try or a strong hint on what needs to change I am willing to try it out.
At this point I don't have time to try the latest kernel code.
I guess the point of this post is to serve as a data points on what work on my hardware with the alc892 which is the ASUS P7H55-M motherboard. The alc892 matches perfectly with what are in the official data sheet, except that some of the pins are not hooked up to anything (BEEP-IN, CD-IN, S/PDIF-IN)
participants (2)
-
Kevin Atkinson
-
Raymond Yau