Re: [alsa-devel] S/PDIF-Out on Asus M3A-H/HDMI with ALC1200]
Hi,
here is the output from alsa-info.sh
http://www.alsa-project.org/db/?f=8282910dc807e1f141896886cd5f8fd574117000
I found another small mistake. In the Mixer my Soundcard is shown as "Realtek ALC888". When i switch this to lines in patch_realtek.c then it is shown as "Realtek ALC1200".
static struct hda_codec_preset snd_hda_preset_realtek[] = { ......
{ .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 }, { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", .patch = patch_alc883 },
.....
Thomas
Am 25.12.2008 05:31, schrieb Wu Fengguang:
Hi Thomas,
Could you provide more information by running http://www.alsa-project.org/alsa-info.sh
I'm particularity interested in the full dmesg and contents of /proc/asound/card?/*#?
Thanks, Fengguang
On Tue, Dec 23, 2008 at 12:22:29PM +0100, Thomas Schneider wrote:
Hi,
i am looking for a way to make Digital-Audio work with the external and internal S/PDIF-Output of my Motherboard Asus M3A-H/HDMI with ALC1200 Soundard. I use the latest unstable snapshot and i can´t make it work at the same time.
On the external S/PDIF-Output is my Digital Receiver connected, on the internal one my GeForce 8500GT to get sound over HDMI on my LCT-TV.
When i load the driver without any model-options my Soundcard is detected as Asus P5Q-EM HDMI
ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:2716: hda_codec: model 'asus-p5q' is selected for config 1043:82fe (Asus P5Q-EM HDMI) [ 6.721700] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave Headphone Playback Volume, skipped [ 6.721714] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave Speaker Playback Volume, skipped [ 6.721716] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave Mono Playback Volume, skipped [ 6.721719] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave Line-Out Playback Volume, skipped [ 6.721721] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave PCM Playback Volume, skipped [ 6.721729] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave Speaker Playback Switch, skipped [ 6.721731] ALSA /usr/local/src/alsa-driver-unstable/pci/hda/hda_codec.c:1339: Cannot find slave Mono Playback Switch, skipped
Now i have sound on my LCD-TV over HDMI (internal S/PDIF-Out)
When i load the driver with model=6stack-dig i have sound on my Digital-Receiver (external S/PDIF-Out).
In the mailinglist-archive or in the doku i have seen, that the only difference between this models is the DIGOUT_NID
asus-p5q = 0x10 6stack-dig = 0x06
I there a way to get both output to work at the same time so i have sound on my LCD-TV and my Digital-Receiver ?
Regards
Thomas _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Hi Thomas,
This patch adds the SPDIF pin as slave digital out which I hope to create concurrent HDMI/SPDIF outputs for you.
It's against today's sound-2.6 git tree.
Thanks, Fengguang --- diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 6f2fe0f..c9262f0 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -227,6 +227,7 @@ struct hda_multi_out { hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ hda_nid_t dig_out_nid; /* digital out audio widget */ + hda_nid_t *slave_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */ diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0bd4e6b..08bedee 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -336,6 +336,7 @@ struct alc_config_preset { hda_nid_t *dac_nids; hda_nid_t dig_out_nid; /* optional */ hda_nid_t hp_nid; /* optional */ + hda_nid_t *slave_dig_outs; unsigned int num_adc_nids; hda_nid_t *adc_nids; hda_nid_t *capsrc_nids; @@ -810,6 +811,7 @@ static void setup_preset(struct alc_spec *spec, spec->multiout.num_dacs = preset->num_dacs; spec->multiout.dac_nids = preset->dac_nids; spec->multiout.dig_out_nid = preset->dig_out_nid; + spec->multiout.slave_dig_outs = preset->slave_dig_outs; spec->multiout.hp_nid = preset->hp_nid;
spec->num_mux_defs = preset->num_mux_defs; @@ -3085,6 +3087,7 @@ static int alc_build_pcms(struct hda_codec *codec) /* SPDIF for stream index #1 */ if (spec->multiout.dig_out_nid || spec->dig_in_nid) { codec->num_pcms = 2; + codec->slave_dig_outs = spec->multiout.slave_dig_outs; info = spec->pcm_rec + 1; info->name = spec->stream_name_digital; info->pcm_type = HDA_PCM_TYPE_SPDIF; @@ -8865,6 +8868,7 @@ static struct alc_config_preset alc883_presets[] = { .dac_nids = alc883_dac_nids, .dig_out_nid = ALC1200_DIGOUT_NID, .dig_in_nid = ALC883_DIGIN_NID, + .slave_dig_outs = { ALC883_DIGOUT_NID, 0 }, .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), .channel_mode = alc883_sixstack_modes, .input_mux = &alc883_capture_source,
Hi,
sorry, i get a kernel oops with this changes when i activate iec958 in the mixer !
[ 1435.041914] BUG: unable to handle kernel NULL pointer dereference at 0000000000000006 [ 1435.041914] IP: [<ffffffff880d0223>] :snd_hda_codec:set_dig_out+0x47/0x57 [ 1435.041914] PGD 6b5c3067 PUD 781ba067 PMD 0 [ 1435.041914] Oops: 0000 [1] SMP [ 1435.041914] CPU 1 [ 1435.041914] Modules linked in: snd_pcm_oss snd_mixer_oss snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_timer snd_seq_device snd soundcore snd_page_alloc lirc_serial lirc_dev mantis mb86a16 stb6100 stb0899 b2c2_flexcop_pci b2c2_flexcop s5h1420 mt352 itd1000 bcm3510 dvb_pll nxt200x isl6421 tuner_simple tuner_types cx24123 lgdt330x mt312 v4l2_common dvb_ttpci lnbp21 l64781 saa7146_vv saa7146 videobuf_dma_sg videobuf_core ves1820 tda8083 sp8870 firmware_class stv0297 ves1x93 ttpci_eeprom stv0299 dvb_core videodev v4l1_compat nvidia(P) battery ppdev parport_pc lp parport ipv6 cpufreq_ondemand cpufreq_conservative cpufreq_userspace nls_iso8859_1 nls_cp437 joydev usb_storage usbhid hid serio_raw pcspkr psmouse evdev i2c_piix4 k8temp atl1 i2c_core mii ehci_hcd ohci_hcd wmi button [last unloaded: soundcore] [ 1435.041914] Pid: 17229, comm: alsamixer Tainted: P 2.6.25.16 #5 [ 1435.041914] RIP: 0010:[<ffffffff880d0223>] [<ffffffff880d0223>] :snd_hda_codec:set_dig_out+0x47/0x57 [ 1435.041914] RSP: 0018:ffff81006f86fcb8 EFLAGS: 00010206 [ 1435.041914] RAX: 0000000000000000 RBX: 0000000000000006 RCX: 0000000000000010 [ 1435.041914] RDX: 0000000000000001 RSI: ffff81007cd1f1f0 RDI: ffff81007dc05828 [ 1435.041914] RBP: ffff81007dc05828 R08: 0000000000000001 R09: 0000000000200200 [ 1435.041914] R10: ffff81007cd1f208 R11: ffffffff880d08ae R12: 0000000000000001 [ 1435.041914] R13: 000000000000070d R14: 0000000000000001 R15: ffff81007dc05a30 [ 1435.041914] FS: 00007faf065546e0(0000) GS:ffff81007fb7fbc0(0000) knlGS:0000000000000000 [ 1435.041914] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1435.041914] CR2: 0000000000000006 CR3: 000000006f849000 CR4: 00000000000006e0 [ 1435.041914] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1435.041914] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 1435.041914] Process alsamixer (pid: 17229, threadinfo ffff81006f86e000, task ffff81007e7395c0) [ 1435.041914] Stack: ffff81006f86fcd8 0000000000000010 ffff81007dc05828 0000000000000010 [ 1435.041914] 0000000000000001 ffffffff880d0926 ffff81007ccd2028 ffff81007c89e2e8 [ 1435.041914] ffff81007ccd2028 ffff81007dc049c0 ffff81007dc04828 ffff81007c89e2e8 [ 1435.041914] Call Trace: [ 1435.041914] [<ffffffff880d0926>] ? :snd_hda_codec:snd_hda_spdif_out_switch_put+0x78/0xe4 [ 1435.041914] [<ffffffff8806f184>] ? :snd:snd_ctl_elem_write+0x9c/0xdb [ 1435.041914] [<ffffffff8806fc16>] ? :snd:snd_ctl_ioctl+0x2d3/0x770 [ 1435.041914] [<ffffffff8024be32>] ? hrtimer_start+0x115/0x137 [ 1435.041914] [<ffffffff8020bef9>] ? sysret_signal+0x2b/0x45 [ 1435.041914] [<ffffffff802341e5>] ? hrtick_set+0xa1/0x10a [ 1435.041914] [<ffffffff8020b95a>] ? do_notify_resume+0x850/0x871 [ 1435.041914] [<ffffffff8022f636>] ? __wake_up+0x38/0x4f [ 1435.041914] [<ffffffff8023b7d6>] ? current_fs_time+0x1e/0x24 [ 1435.041914] [<ffffffff802ab23d>] ? vfs_ioctl+0x21/0x6c [ 1435.041914] [<ffffffff802ab4c1>] ? do_vfs_ioctl+0x239/0x24f [ 1435.041914] [<ffffffff802a061f>] ? vfs_read+0x11e/0x152 [ 1435.041914] [<ffffffff802ab528>] ? sys_ioctl+0x51/0x71 [ 1435.041914] [<ffffffff8020bef9>] ? sysret_signal+0x2b/0x45 [ 1435.041914] [<ffffffff8020be4a>] ? system_call_after_swapgs+0x8a/0x8f [ 1435.041914] [ 1435.041914] [ 1435.041914] Code: 08 e8 36 ff ff ff 48 8b 9d 30 02 00 00 48 85 db 75 19 eb 1f 0f b7 f0 45 89 e0 44 89 e9 31 d2 48 89 ef 48 83 c3 02 e8 11 ff ff ff <66> 8b 03 66 85 c0 75 e1 5b 5b 5d 41 5c 41 5d c3 41 57 41 56 41 [ 1435.041914] RIP [<ffffffff880d0223>] :snd_hda_codec:set_dig_out+0x47/0x57 [ 1435.041914] RSP <ffff81006f86fcb8> [ 1435.041914] CR2: 0000000000000006 [ 1435.041930] ---[ end trace 9b9cd1aadfad1315 ]---
Thomas
Am 26.12.2008 03:48, schrieb Wu Fengguang:
Hi Thomas,
This patch adds the SPDIF pin as slave digital out which I hope to create concurrent HDMI/SPDIF outputs for you.
It's against today's sound-2.6 git tree.
Thanks, Fengguang
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 6f2fe0f..c9262f0 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -227,6 +227,7 @@ struct hda_multi_out { hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ hda_nid_t dig_out_nid; /* digital out audio widget */
- hda_nid_t *slave_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0bd4e6b..08bedee 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -336,6 +336,7 @@ struct alc_config_preset { hda_nid_t *dac_nids; hda_nid_t dig_out_nid; /* optional */ hda_nid_t hp_nid; /* optional */
- hda_nid_t *slave_dig_outs; unsigned int num_adc_nids; hda_nid_t *adc_nids; hda_nid_t *capsrc_nids;
@@ -810,6 +811,7 @@ static void setup_preset(struct alc_spec *spec, spec->multiout.num_dacs = preset->num_dacs; spec->multiout.dac_nids = preset->dac_nids; spec->multiout.dig_out_nid = preset->dig_out_nid;
spec->multiout.slave_dig_outs = preset->slave_dig_outs; spec->multiout.hp_nid = preset->hp_nid;
spec->num_mux_defs = preset->num_mux_defs;
@@ -3085,6 +3087,7 @@ static int alc_build_pcms(struct hda_codec *codec) /* SPDIF for stream index #1 */ if (spec->multiout.dig_out_nid || spec->dig_in_nid) { codec->num_pcms = 2;
info = spec->pcm_rec + 1; info->name = spec->stream_name_digital; info->pcm_type = HDA_PCM_TYPE_SPDIF;codec->slave_dig_outs = spec->multiout.slave_dig_outs;
@@ -8865,6 +8868,7 @@ static struct alc_config_preset alc883_presets[] = { .dac_nids = alc883_dac_nids, .dig_out_nid = ALC1200_DIGOUT_NID, .dig_in_nid = ALC883_DIGIN_NID,
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), .channel_mode = alc883_sixstack_modes, .input_mux =&alc883_capture_source,.slave_dig_outs = { ALC883_DIGOUT_NID, 0 },
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On Fri, Dec 26, 2008 at 01:29:30PM +0100, Thomas Schneider wrote:
Hi,
sorry, i get a kernel oops with this changes when i activate iec958 in the mixer !
[ 1435.041914] BUG: unable to handle kernel NULL pointer dereference at 0000000000000006 [ 1435.041914] IP: [<ffffffff880d0223>] :snd_hda_codec:set_dig_out+0x47/0x57 [ 1435.041914] PGD 6b5c3067 PUD 781ba067 PMD 0 [ 1435.041914] Oops: 0000 [1] SMP
Sorry, does this new patch fixed the oops?
Thanks, Fengguang --- sound/pci/hda/hda_local.h | 1 + sound/pci/hda/patch_realtek.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
--- sound-2.6.orig/sound/pci/hda/hda_local.h +++ sound-2.6/sound/pci/hda/hda_local.h @@ -227,6 +227,7 @@ struct hda_multi_out { hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ hda_nid_t dig_out_nid; /* digital out audio widget */ + hda_nid_t *slave_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */ --- sound-2.6.orig/sound/pci/hda/patch_realtek.c +++ sound-2.6/sound/pci/hda/patch_realtek.c @@ -336,6 +336,7 @@ struct alc_config_preset { hda_nid_t *dac_nids; hda_nid_t dig_out_nid; /* optional */ hda_nid_t hp_nid; /* optional */ + hda_nid_t *slave_dig_outs; unsigned int num_adc_nids; hda_nid_t *adc_nids; hda_nid_t *capsrc_nids; @@ -810,6 +811,7 @@ static void setup_preset(struct alc_spec spec->multiout.num_dacs = preset->num_dacs; spec->multiout.dac_nids = preset->dac_nids; spec->multiout.dig_out_nid = preset->dig_out_nid; + spec->multiout.slave_dig_outs = preset->slave_dig_outs; spec->multiout.hp_nid = preset->hp_nid;
spec->num_mux_defs = preset->num_mux_defs; @@ -3085,6 +3087,7 @@ static int alc_build_pcms(struct hda_cod /* SPDIF for stream index #1 */ if (spec->multiout.dig_out_nid || spec->dig_in_nid) { codec->num_pcms = 2; + codec->slave_dig_outs = spec->multiout.slave_dig_outs; info = spec->pcm_rec + 1; info->name = spec->stream_name_digital; info->pcm_type = HDA_PCM_TYPE_SPDIF; @@ -8525,6 +8528,10 @@ static struct snd_pci_quirk alc883_cfg_t {} };
+static hda_nid_t alc1200_slave_dig_outs[] = { + ALC883_DIGOUT_NID, 0, +}; + static struct alc_config_preset alc883_presets[] = { [ALC883_3ST_2ch_DIG] = { .mixers = { alc883_3ST_2ch_mixer }, @@ -8865,13 +8872,13 @@ static struct alc_config_preset alc883_p .dac_nids = alc883_dac_nids, .dig_out_nid = ALC1200_DIGOUT_NID, .dig_in_nid = ALC883_DIGIN_NID, + .slave_dig_outs = alc1200_slave_dig_outs, .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), .channel_mode = alc883_sixstack_modes, .input_mux = &alc883_capture_source, }, };
- /* * BIOS auto configuration */
Hi,
yes the new patch fix the oops. And now i have sound on both connections at the same time !!!
Many Thanks
Am 30.12.2008 10:54, schrieb Wu Fengguang:
On Fri, Dec 26, 2008 at 01:29:30PM +0100, Thomas Schneider wrote:
Hi,
sorry, i get a kernel oops with this changes when i activate iec958 in the mixer !
[ 1435.041914] BUG: unable to handle kernel NULL pointer dereference at 0000000000000006 [ 1435.041914] IP: [<ffffffff880d0223>] :snd_hda_codec:set_dig_out+0x47/0x57 [ 1435.041914] PGD 6b5c3067 PUD 781ba067 PMD 0 [ 1435.041914] Oops: 0000 [1] SMP
Sorry, does this new patch fixed the oops?
Thanks, Fengguang
sound/pci/hda/hda_local.h | 1 + sound/pci/hda/patch_realtek.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-)
--- sound-2.6.orig/sound/pci/hda/hda_local.h +++ sound-2.6/sound/pci/hda/hda_local.h @@ -227,6 +227,7 @@ struct hda_multi_out { hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ hda_nid_t dig_out_nid; /* digital out audio widget */
- hda_nid_t *slave_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */
--- sound-2.6.orig/sound/pci/hda/patch_realtek.c +++ sound-2.6/sound/pci/hda/patch_realtek.c @@ -336,6 +336,7 @@ struct alc_config_preset { hda_nid_t *dac_nids; hda_nid_t dig_out_nid; /* optional */ hda_nid_t hp_nid; /* optional */
- hda_nid_t *slave_dig_outs; unsigned int num_adc_nids; hda_nid_t *adc_nids; hda_nid_t *capsrc_nids;
@@ -810,6 +811,7 @@ static void setup_preset(struct alc_spec spec->multiout.num_dacs = preset->num_dacs; spec->multiout.dac_nids = preset->dac_nids; spec->multiout.dig_out_nid = preset->dig_out_nid;
spec->multiout.slave_dig_outs = preset->slave_dig_outs; spec->multiout.hp_nid = preset->hp_nid;
spec->num_mux_defs = preset->num_mux_defs;
@@ -3085,6 +3087,7 @@ static int alc_build_pcms(struct hda_cod /* SPDIF for stream index #1 */ if (spec->multiout.dig_out_nid || spec->dig_in_nid) { codec->num_pcms = 2;
info = spec->pcm_rec + 1; info->name = spec->stream_name_digital; info->pcm_type = HDA_PCM_TYPE_SPDIF;codec->slave_dig_outs = spec->multiout.slave_dig_outs;
@@ -8525,6 +8528,10 @@ static struct snd_pci_quirk alc883_cfg_t {} };
+static hda_nid_t alc1200_slave_dig_outs[] = {
- ALC883_DIGOUT_NID, 0,
+};
- static struct alc_config_preset alc883_presets[] = { [ALC883_3ST_2ch_DIG] = { .mixers = { alc883_3ST_2ch_mixer },
@@ -8865,13 +8872,13 @@ static struct alc_config_preset alc883_p .dac_nids = alc883_dac_nids, .dig_out_nid = ALC1200_DIGOUT_NID, .dig_in_nid = ALC883_DIGIN_NID,
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), .channel_mode = alc883_sixstack_modes, .input_mux =&alc883_capture_source, }, };.slave_dig_outs = alc1200_slave_dig_outs,
- /*
*/
- BIOS auto configuration
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com --- sound/pci/hda/hda_local.h | 1 + sound/pci/hda/patch_realtek.c | 8 ++++++++ 2 files changed, 9 insertions(+)
--- sound-2.6.orig/sound/pci/hda/hda_local.h +++ sound-2.6/sound/pci/hda/hda_local.h @@ -229,6 +229,7 @@ struct hda_multi_out { hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ hda_nid_t dig_out_nid; /* digital out audio widget */ + hda_nid_t *slave_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */ --- sound-2.6.orig/sound/pci/hda/patch_realtek.c +++ sound-2.6/sound/pci/hda/patch_realtek.c @@ -349,6 +349,7 @@ struct alc_config_preset { hda_nid_t *dac_nids; hda_nid_t dig_out_nid; /* optional */ hda_nid_t hp_nid; /* optional */ + hda_nid_t *slave_dig_outs; unsigned int num_adc_nids; hda_nid_t *adc_nids; hda_nid_t *capsrc_nids; @@ -824,6 +825,7 @@ static void setup_preset(struct alc_spec spec->multiout.num_dacs = preset->num_dacs; spec->multiout.dac_nids = preset->dac_nids; spec->multiout.dig_out_nid = preset->dig_out_nid; + spec->multiout.slave_dig_outs = preset->slave_dig_outs; spec->multiout.hp_nid = preset->hp_nid;
spec->num_mux_defs = preset->num_mux_defs; @@ -3107,6 +3109,7 @@ static int alc_build_pcms(struct hda_cod /* SPDIF for stream index #1 */ if (spec->multiout.dig_out_nid || spec->dig_in_nid) { codec->num_pcms = 2; + codec->slave_dig_outs = spec->multiout.slave_dig_outs; info = spec->pcm_rec + 1; info->name = spec->stream_name_digital; if (spec->dig_out_type) @@ -8603,6 +8606,10 @@ static struct snd_pci_quirk alc883_cfg_t {} };
+static hda_nid_t alc1200_slave_dig_outs[] = { + ALC883_DIGOUT_NID, 0, +}; + static struct alc_config_preset alc883_presets[] = { [ALC883_3ST_2ch_DIG] = { .mixers = { alc883_3ST_2ch_mixer }, @@ -8943,6 +8950,7 @@ static struct alc_config_preset alc883_p .dac_nids = alc883_dac_nids, .dig_out_nid = ALC1200_DIGOUT_NID, .dig_in_nid = ALC883_DIGIN_NID, + .slave_dig_outs = alc1200_slave_dig_outs, .num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), .channel_mode = alc883_sixstack_modes, .input_mux = &alc883_capture_source,
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
Applied now. Thanks.
(We need a bit more (clean-up) work on these issues...)
Takashi
sound/pci/hda/hda_local.h | 1 + sound/pci/hda/patch_realtek.c | 8 ++++++++ 2 files changed, 9 insertions(+)
--- sound-2.6.orig/sound/pci/hda/hda_local.h +++ sound-2.6/sound/pci/hda/hda_local.h @@ -229,6 +229,7 @@ struct hda_multi_out { hda_nid_t hp_nid; /* optional DAC for HP, 0 when not exists */ hda_nid_t extra_out_nid[3]; /* optional DACs, 0 when not exists */ hda_nid_t dig_out_nid; /* digital out audio widget */
- hda_nid_t *slave_dig_outs; int max_channels; /* currently supported analog channels */ int dig_out_used; /* current usage of digital out (HDA_DIG_XXX) */ int no_share_stream; /* don't share a stream with multiple pins */
--- sound-2.6.orig/sound/pci/hda/patch_realtek.c +++ sound-2.6/sound/pci/hda/patch_realtek.c @@ -349,6 +349,7 @@ struct alc_config_preset { hda_nid_t *dac_nids; hda_nid_t dig_out_nid; /* optional */ hda_nid_t hp_nid; /* optional */
- hda_nid_t *slave_dig_outs; unsigned int num_adc_nids; hda_nid_t *adc_nids; hda_nid_t *capsrc_nids;
@@ -824,6 +825,7 @@ static void setup_preset(struct alc_spec spec->multiout.num_dacs = preset->num_dacs; spec->multiout.dac_nids = preset->dac_nids; spec->multiout.dig_out_nid = preset->dig_out_nid;
spec->multiout.slave_dig_outs = preset->slave_dig_outs; spec->multiout.hp_nid = preset->hp_nid;
spec->num_mux_defs = preset->num_mux_defs;
@@ -3107,6 +3109,7 @@ static int alc_build_pcms(struct hda_cod /* SPDIF for stream index #1 */ if (spec->multiout.dig_out_nid || spec->dig_in_nid) { codec->num_pcms = 2;
info = spec->pcm_rec + 1; info->name = spec->stream_name_digital; if (spec->dig_out_type)codec->slave_dig_outs = spec->multiout.slave_dig_outs;
@@ -8603,6 +8606,10 @@ static struct snd_pci_quirk alc883_cfg_t {} };
+static hda_nid_t alc1200_slave_dig_outs[] = {
- ALC883_DIGOUT_NID, 0,
+};
static struct alc_config_preset alc883_presets[] = { [ALC883_3ST_2ch_DIG] = { .mixers = { alc883_3ST_2ch_mixer }, @@ -8943,6 +8950,7 @@ static struct alc_config_preset alc883_p .dac_nids = alc883_dac_nids, .dig_out_nid = ALC1200_DIGOUT_NID, .dig_in_nid = ALC883_DIGIN_NID,
.num_channel_mode = ARRAY_SIZE(alc883_sixstack_modes), .channel_mode = alc883_sixstack_modes, .input_mux = &alc883_capture_source,.slave_dig_outs = alc1200_slave_dig_outs,
On Fri, Feb 06, 2009 at 10:01:54AM +0200, Takashi Iwai wrote:
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
Applied now. Thanks.
(We need a bit more (clean-up) work on these issues...)
I have an old patch that tries to convert the dig_out_pin from a scaler into an array. I wonder if this is the way to go...
static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list) diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 7957fef..989e04b 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -341,7 +341,8 @@ struct auto_pin_cfg { int line_out_type; /* AUTO_PIN_XXX_OUT */ hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; hda_nid_t input_pins[AUTO_PIN_LAST]; - hda_nid_t dig_out_pin; + int dig_outs; + hda_nid_t dig_out_pins[AUTO_CFG_MAX_OUTS]; hda_nid_t dig_in_pin; hda_nid_t mono_out_pin; }; diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2b00c4a..bf94481 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -2841,7 +2841,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = AD1988_SPDIF_IN; diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c2ff85d..47f06d0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3784,7 +3784,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = ALC880_DIGIN_NID; @@ -5185,7 +5185,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC260_DIGOUT_NID; if (spec->kctl_alloc) spec->mixers[spec->num_mixers++] = spec->kctl_alloc; @@ -10249,7 +10249,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC262_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = ALC262_DIGIN_NID; @@ -11382,7 +11382,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec) spec->multiout.max_channels = 2;
/* digital only support output */ - if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC268_DIGOUT_NID;
if (spec->kctl_alloc) @@ -12154,7 +12154,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC269_DIGOUT_NID;
if (spec->kctl_alloc) @@ -13252,7 +13252,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC861_DIGOUT_NID;
if (spec->kctl_alloc) @@ -14363,7 +14363,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC861VD_DIGOUT_NID;
if (spec->kctl_alloc) @@ -16182,7 +16182,7 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC880_DIGOUT_NID;
if (spec->kctl_alloc) diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 63e4871..cf0ce0b 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -1368,7 +1368,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1708_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = VT1708_DIGIN_NID; @@ -1841,7 +1841,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1709_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = VT1709_DIGIN_NID; @@ -2385,7 +2385,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = VT1708B_DIGIN_NID; @@ -2850,7 +2850,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID;
spec->extra_dig_out_nid = 0x15; @@ -3169,7 +3169,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin) + if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1702_DIGOUT_NID;
spec->extra_dig_out_nid = 0x1B;
At Fri, 6 Feb 2009 16:13:06 +0800, Wu Fengguang wrote:
On Fri, Feb 06, 2009 at 10:01:54AM +0200, Takashi Iwai wrote:
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
Applied now. Thanks.
(We need a bit more (clean-up) work on these issues...)
I have an old patch that tries to convert the dig_out_pin from a scaler into an array. I wonder if this is the way to go...
Well, my original thought was about the situation that both codec and spec->multiout have the same slave_dig_out array. It's a bit confusing.
Takashi
static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list) diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index 7957fef..989e04b 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -341,7 +341,8 @@ struct auto_pin_cfg { int line_out_type; /* AUTO_PIN_XXX_OUT */ hda_nid_t hp_pins[AUTO_CFG_MAX_OUTS]; hda_nid_t input_pins[AUTO_PIN_LAST];
- hda_nid_t dig_out_pin;
- int dig_outs;
- hda_nid_t dig_out_pins[AUTO_CFG_MAX_OUTS]; hda_nid_t dig_in_pin; hda_nid_t mono_out_pin;
}; diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 2b00c4a..bf94481 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -2841,7 +2841,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = AD1988_SPDIF_IN;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c2ff85d..47f06d0 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3784,7 +3784,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC880_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = ALC880_DIGIN_NID;
@@ -5185,7 +5185,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC260_DIGOUT_NID; if (spec->kctl_alloc) spec->mixers[spec->num_mixers++] = spec->kctl_alloc;
@@ -10249,7 +10249,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC262_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = ALC262_DIGIN_NID;
@@ -11382,7 +11382,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec) spec->multiout.max_channels = 2;
/* digital only support output */
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC268_DIGOUT_NID;
if (spec->kctl_alloc)
@@ -12154,7 +12154,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC269_DIGOUT_NID;
if (spec->kctl_alloc)
@@ -13252,7 +13252,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC861_DIGOUT_NID;
if (spec->kctl_alloc)
@@ -14363,7 +14363,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC861VD_DIGOUT_NID;
if (spec->kctl_alloc)
@@ -16182,7 +16182,7 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = ALC880_DIGOUT_NID;
if (spec->kctl_alloc)
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 63e4871..cf0ce0b 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -1368,7 +1368,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1708_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = VT1708_DIGIN_NID;
@@ -1841,7 +1841,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1709_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = VT1709_DIGIN_NID;
@@ -2385,7 +2385,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
- if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1708B_DIGOUT_NID; if (spec->autocfg.dig_in_pin) spec->dig_in_nid = VT1708B_DIGIN_NID;
@@ -2850,7 +2850,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1708S_DIGOUT_NID;
spec->extra_dig_out_nid = 0x15;
@@ -3169,7 +3169,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
spec->multiout.max_channels = spec->multiout.num_dacs * 2;
- if (spec->autocfg.dig_out_pin)
if (spec->autocfg.dig_outs) spec->multiout.dig_out_nid = VT1702_DIGOUT_NID;
spec->extra_dig_out_nid = 0x1B;
On Fri, Feb 06, 2009 at 10:23:10AM +0200, Takashi Iwai wrote:
At Fri, 6 Feb 2009 16:13:06 +0800, Wu Fengguang wrote:
On Fri, Feb 06, 2009 at 10:01:54AM +0200, Takashi Iwai wrote:
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
Applied now. Thanks.
(We need a bit more (clean-up) work on these issues...)
I have an old patch that tries to convert the dig_out_pin from a scaler into an array. I wonder if this is the way to go...
Well, my original thought was about the situation that both codec and spec->multiout have the same slave_dig_out array. It's a bit confusing.
Ah yes, there are so many slave_dig_outs now ;-)
alc1200_slave_dig_outs => preset->slave_dig_outs => spec->multiout.slave_dig_outs => codec->slave_dig_outs
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
BTW, Thomas, could you give the output of alsa-info.sh (with --no-upload option)? The script is found at http://www.alsa-project.org/alsa-info.sh
thanks,
Takashi
On Fri, Feb 06, 2009 at 10:26:16AM +0200, Takashi Iwai wrote:
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
BTW, Thomas, could you give the output of alsa-info.sh (with --no-upload option)? The script is found at http://www.alsa-project.org/alsa-info.sh
He once uploaded one here: http://www.alsa-project.org/db/?f=8282910dc807e1f141896886cd5f8fd574117000
Thanks, Fengguang
At Fri, 6 Feb 2009 16:30:35 +0800, Wu Fengguang wrote:
On Fri, Feb 06, 2009 at 10:26:16AM +0200, Takashi Iwai wrote:
At Fri, 6 Feb 2009 15:02:27 +0800, Wu Fengguang wrote:
Add the SPDIF pin as slave digital out to enable concurrent HDMI/SPDIF outputs for ASUS M3A-H/HDMI with ALC1200 codec.
Tested-by: Thomas Schneider nailstudio@gmx.net Signed-off-by: Wu Fengguang fengguang.wu@intel.com
BTW, Thomas, could you give the output of alsa-info.sh (with --no-upload option)? The script is found at http://www.alsa-project.org/alsa-info.sh
He once uploaded one here: http://www.alsa-project.org/db/?f=8282910dc807e1f141896886cd5f8fd574117000
Thanks, I took it.
Takashi
participants (3)
-
Takashi Iwai
-
Thomas Schneider
-
Wu Fengguang