Recent code changes for HD-audio on HG repo
As you said, the patch didn't solve the problem.
To test audio I used this simple command:
aplay < /bin/bash
but if there is no audio output for a while, executing it produces no noise. When I said the sound goes mute, I meant there is no sound, not that some audio channel is muted.
If I set the power_save_controller=0 module option the sound works always, so these are the details of my hardware:
lspci -v
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
Subsystem: Realtek Semiconductor Co., Ltd. Unknown device 0885
Flags: bus master, fast devsel, latency 0, IRQ 21
Memory at 52400000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Unknown type IRQ 0
cat /proc/asound/card0/codec#0
Codec: Realtek ALC885
Address: 0
Vendor Id: 0x10ec0885
Subsystem Id: 0x106b1000
Revision Id: 0x100103
No Modem Function Group found
Default PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCMDefault Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x02 [Audio Output] wcaps 0x11: Stereo
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Node 0x03 [Audio Output] wcaps 0x11: Stereo
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Node 0x04 [Audio Output] wcaps 0x11: Stereo
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Node 0x05 [Audio Output] wcaps 0x11: Stereo
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Node 0x06 [Audio Output] wcaps 0x211: Stereo Digital
PCM:
rates [0x5e0]: 44100 48000 88200 96000 192000
bits [0x1e]: 16 20 24 32
formats [0x1]: PCMNode 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In
Amp-In caps: ofs=0x10, nsteps=0x2e, stepsize=0x03, mute=1 Amp-In vals: [0x00 0x00]
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Connection: 1
0x24Node 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In
Amp-In caps: ofs=0x10, nsteps=0x2e, stepsize=0x03, mute=1 Amp-In vals: [0x00 0x00]
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Connection: 1
0x23Node 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In
Amp-In caps: ofs=0x10, nsteps=0x2e, stepsize=0x03, mute=1 Amp-In vals: [0x00 0x00]
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCM
Connection: 1
0x22
Node 0x0a [Audio Input] wcaps 0x100391: Stereo Digital
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0x1e]: 16 20 24 32
formats [0x1]: PCM
Connection: 1
0x1fNode 0x0b [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
Amp-In vals: [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97]
Connection: 10
0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x14 0x15 0x16 0x17
Node 0x0c [Audio Mixer] wcaps 0x20010f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80]
Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0 Amp-Out vals: [0x2c 0x2c]
Connection: 2
0x02 0x0b
Node 0x0d [Audio Mixer] wcaps 0x20010f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80]
Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0 Amp-Out vals: [0x40 0x40]
Connection: 2
0x03 0x0b
Node 0x0e [Audio Mixer] wcaps 0x20010f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80]
Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0 Amp-Out vals: [0x40 0x40]
Connection: 2
0x04 0x0b
Node 0x0f [Audio Mixer] wcaps 0x20010f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80]
Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0 Amp-Out vals: [0x40 0x40]
Connection: 2
0x05 0x0b
Node 0x10 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x11 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x12 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x13 [Vendor Defined Widget] wcaps 0xf00000: Mono
Node 0x14 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00]
Pincap 0x08373c: IN OUT HP Detect
Pin Default 0x012b4050: [Jack] HP Out at Ext Rear
Conn = Comb, Color = Green
Pin-ctls: 0xc0: OUT HP
Connection: 5
0x0c* 0x0d 0x0e 0x0f 0x26
Node 0x15 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x08373c: IN OUT HP Detect
Pin Default 0x018b3020: [Jack] Line In at Ext Rear
Conn = Comb, Color = Blue
Pin-ctls: 0x20: IN
Connection: 5
0x0c 0x0d* 0x0e 0x0f 0x26
Node 0x16 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x083c: IN OUT HP Detect
Pin Default 0x400000f0: [N/A] Line Out at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x20: IN
Connection: 5
0x0c 0x0d 0x0e* 0x0f 0x26
Node 0x17 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x083c: IN OUT HP Detect
Pin Default 0x400000f0: [N/A] Line Out at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x20: IN
Connection: 5
0x0c 0x0d 0x0e 0x0f* 0x26
Node 0x18 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00]
Pincap 0x08373c: IN OUT HP Detect
Pin Default 0x90100140: [Fixed] Speaker at Int N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x40: OUT
Connection: 5
0x0c* 0x0d 0x0e 0x0f 0x26
Node 0x19 [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x08373c: IN OUT HP Detect
Pin Default 0x90a00110: [Fixed] Mic at Int N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x24: IN
Connection: 5
0x0c* 0x0d 0x0e 0x0f 0x26
Node 0x1a [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00]
Pincap 0x08373c: IN OUT HP Detect
Pin Default 0x90100141: [Fixed] Speaker at Int N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x40: OUT
Connection: 5
0x0c* 0x0d 0x0e 0x0f 0x26
Node 0x1b [Pin Complex] wcaps 0x40018f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] [0x00 0x00] Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x08373c: IN OUT HP Detect
Pin Default 0x400000f0: [N/A] Line Out at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x20: IN
Connection: 5
0x0c* 0x0d 0x0e 0x0f 0x26
Node 0x1c [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x400000f0: [N/A] Line Out at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x20: IN
Node 0x1d [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x400000f0: [N/A] Line Out at Ext N/A
Conn = Unknown, Color = Unknown
Pin-ctls: 0x20: IN
Node 0x1e [Pin Complex] wcaps 0x400300: Mono Digital
Pincap 0x0810: OUT
Pin Default 0x014be060: [Jack] SPDIF Out at Ext Rear
Conn = Comb, Color = White
Pin-ctls: 0x40: OUT
Connection: 1
0x06
Node 0x1f [Pin Complex] wcaps 0x400200: Mono Digital
Pincap 0x0820: IN
Pin Default 0x01cbe030: [Jack] SPDIF In at Ext Rear
Conn = Comb, Color = White
Pin-ctls: 0x20: IN
Node 0x20 [Vendor Defined Widget] wcaps 0xf00040: Mono
Node 0x21 [Volume Knob Widget] wcaps 0x600080: Mono
Node 0x22 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
Connection: 11
0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x14 0x15 0x16 0x17 0x0b
Node 0x23 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
Connection: 11
0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x14 0x15 0x16 0x17 0x0b
Node 0x24 [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-In vals: [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x80 0x80]
Connection: 11
0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x14 0x15 0x16 0x17 0x0b
Node 0x25 [Audio Output] wcaps 0x11: Stereo
PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
formats [0x1]: PCMNode 0x26 [Audio Mixer] wcaps 0x20010f: Stereo Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x00 0x00] [0x80 0x80]
Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0 Amp-Out vals: [0x40 0x40]
Connection: 2
0x25 0x0b
amixer
Simple mixer control 'Master',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 44 [69%] [-20.00dB] [on] Front Right: Playback 44 [69%] [-20.00dB] [on]
Simple mixer control 'PCM',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 255 [100%] [0.00dB]
Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined cswitch cswitch-joined Playback channels: Mono
Capture channels: Mono
Mono: Playback [off] Capture [off]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 46
Front Left: Capture 0 [0%] [-16.00dB] [on]
Front Right: Capture 0 [0%] [-16.00dB] [on]
Simple mixer control 'Capture',1
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 46
Front Left: Capture 0 [0%] [-16.00dB] [on]
Front Right: Capture 0 [0%] [-16.00dB] [on]
Simple mixer control 'Capture',2
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 46
Front Left: Capture 0 [0%] [-16.00dB] [on]
Front Right: Capture 0 [0%] [-16.00dB] [on]
Simple mixer control 'Digital',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 120
Front Left: Capture 60 [50%] [0.00dB]
Front Right: Capture 60 [50%] [0.00dB]
Simple mixer control 'Input Source',0
Capabilities: enum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'Mic'
Simple mixer control 'Input Source',1
Capabilities: enum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'Mic'
Simple mixer control 'Input Source',2
Capabilities: enum
Items: 'Mic' 'Front Mic' 'Line' 'CD'
Item0: 'Mic'
If this isn't enough, let me know.
Thanks
Nicola Fagnani
At Thu, 16 Aug 2007 00:33:15 +0200,
Quoted 9 lines · Nicola Fagnani
As you said, the patch didn't solve the problem.
To test audio I used this simple command:aplay <
/bin/bashbut if there is no audio output for a while, executing it produces no noise. When I said the sound goes mute, I meant there is no sound, not that some audio channel is muted.
Ah, so you mean that the sound goes away once after 10 second inactive state that results in the automatic power-off?
I thought you meaning that the sound vanishes suddenly _during_ playing back.
Quoted 2 lines
If I set the power_save_controller=0 module option the sound works always, so these are the details of my hardware:
Are you sure that you passed power_save_controller=0, not power_save=0? See below.
Quoted 6 lines
cat /proc/asound/card0/codec#0
Codec: Realtek ALC885
Address: 0
Vendor Id:0x10ec0885
Subsystem Id:0x106b1000
OK, it's an Intel Mac, right? Then maybe the culprit is the missing GPIO initialization. It's done only at creation time. Did you get the PM suspend/resume working with this machine? I guess you'll have the same problem, too.
Anyway, try the patch below. Hopefully it fixes the power-save problem too.
Takashi
pci/hda/patch_realtek.c +16 -6
@@ -5275,6 +5275,20 @@ static void alc882_gpio_mute(struct hda_ AC_VERB_SET_GPIO_DATA, gpiostate); } +/* set up GPIO at initialization */ +static void alc885_macpro_init_hook (struct hda_codec *codec) +{ +alc882_gpio_mute (codec,0 ,0 ); +alc882_gpio_mute (codec,1 ,0 ); +} + +/* set up GPIO and update auto-muting at initialization */ +static void alc885_imac24_init_hook (struct hda_codec *codec) +{ +alc885_macpro_init_hook (codec); +alc885_imac24_automute (codec); +} +/* * generic initialization of ADC, input mixers and output mixers */
@@ -5479,6 +5493,7 @@ static struct alc_config_preset alc882_p .num_channel_mode = ARRAY_SIZE(alc882_ch_modes), .channel_mode = alc882_ch_modes, .input_mux = &alc882_capture_source, + .init_hook = alc885_macpro_init_hook, }, [ALC885_IMAC24] = { .mixers = { alc885_imac24_mixer },
@@ -5491,7 +5506,7 @@ static struct alc_config_preset alc882_p .channel_mode = alc882_ch_modes, .input_mux = &alc882_capture_source, .unsol_event = alc885_imac24_unsol_event, - .init_hook = alc885_imac24_automute, + .init_hook = alc885_imac24_init_hook, }, [ALC882_TARGA] = { .mixers = { alc882_targa_mixer, alc882_chmode_mixer,
@@ -5693,11 +5708,6 @@ static int patch_alc882(struct hda_codecif (board_config !=ALC882_AUTO )setup_preset (spec, &alc882_presets[board_config]); - -if (board_config ==ALC885_MACPRO || board_config ==ALC885_IMAC24 ) { -alc882_gpio_mute (codec,0 ,0 ); -alc882_gpio_mute (codec,1 ,0 ); - } spec->stream_name_analog ="ALC882 Analog" ; spec->stream_analog_playback = &alc882_pcm_analog_playback;
Quoted 4 lines
Are you sure that you passed power_save_controller=0, not power_save=0? See below.
Yes, I set power_save_controller=0. This should have disabled the power save
timeout, preventing the call of azx_stop_chip().
Quoted 5 lines
OK, it's an Intel Mac, right? Then maybe the culprit is the missing GPIO initialization. It's done only at creation time. Did you get the PM suspend/resume working with this machine? I guess you'll have the same problem, too.
Right, I forgot that initialization and in fact the sound never worked after a
suspend.
Quoted 2 lines
Anyway, try the patch below. Hopefully it fixes the power-save problem too.
Yes, it does. :-) Great work!
It fixes suspend too :-D
Thanks very much
Nicola Fagnani
At Thu, 16 Aug 2007 14:21:39 +0200,
Quoted 9 lines · Nicola Fagnani
Quoted 5 lines
Are you sure that you passed power_save_controller=0, not power_save=0? See below.
Yes, I set power_save_controller=0. This should have disabled the power save
timeout, preventing the call ofazx_stop_chip().
So, GPIO isn't reset as long as the controller alive. It sounds reasonable.
Quoted 10 lines
Quoted 5 lines
OK, it's an Intel Mac, right? Then maybe the culprit is the missing GPIO initialization. It's done only at creation time. Did you get the PM suspend/resume working with this machine? I guess you'll have the same problem, too.
Right, I forgot that initialization and in fact the sound never worked after a
suspend.
Quoted 5 lines
Quoted 2 lines
Anyway, try the patch below. Hopefully it fixes the power-save problem too.
Yes, it does. :-) Great work!
It fixes suspend too :-D
Thanks for confirmation. I committed it now to HG tree.
Takashi