All of lore.kernel.org
 help / color / mirror / Atom feed
* Realtek ALC883 support on Albatron KI690-AM2 motherboard
@ 2007-12-02 21:08 Andrew Paprocki
  2007-12-03 15:31 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Paprocki @ 2007-12-02 21:08 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, Claudio Matsuoka, Jaroslav Kysela

Hello everyone,

I'm currently trying to get the ALC883 on the Albatron KI690-AM2
motherboard working under ALSA and I'm running into problems with some
of the ports. From looking at the patch_realtek.c file inside the
intel_hda driver, it appears there are many variants of hookups to
this chipset which all require some manual configuration in the
driver. I've tried what appears to be the closest match
(ALC883_6ST_DIG or 6stack-dig), but it still does not enable all of
the ports.

The motherboard webpage is here:
http://www.albatron.com.tw/English/product/mb/pro_detail.asp?rlink=Specification&no=239

The board has two audio stacks on the back panel. Facing the jack
inputs, the left-hand stack contains:
    <S/PDIF output>
    <TOSLINK w/ green cover>

Next to that stack is a larger 6-stack with the following configuration:
    <blue> <black>
    <green> <pink>
    <grey> <TOSLINK w/ pink cover>

The box is running a stock debian 2.6.18-4-486 kernel. The kernel
outputs this at startup if the "6stack-dig" model is not explicitly
supplied:

    hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
    hda-intel: Invalid position buffer, using LPIB read method instead.

When using the "6stack-dig" mode, ALSA sees two devices:

    card 0: SB [HDA ATI SB], device 0: ALC883 Analog [ALC883 Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: SB [HDA ATI SB], device 2: ALC883 Digital [ALC883 Digital]
      Subdevices: 1/1
      Subdevice #0: subdevice #0

When attempting to use ALSA to open the first device in raw mode to
output to each stereo pair separately, 5 pairs are detected, and the
outputs appear as follows...

    Pair 1: <green> (working)
    Pair 2: <pink> (working)
    Pair 3: <black> (working)
    Pair 4: (no audio)
    Pair 5: (no audio)

No sound can be heard from the blue or grey jacks in any
configuration. I'm wondering if a special entry is needed in
patch_realtek.c to handle this board's usage of the ALC883. I am
willing to try changing the code and testing if someone can point me
to what might need to be done.

01:05.2 Audio device: ATI Technologies Inc Unknown device 7919
        Subsystem: Albatron Corp. Unknown device 5000
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 64, Cache Line Size: 4 bytes
        Interrupt: pin B routed to IRQ 3
        Region 0: Memory at fdffc000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+
Queue=0/0 Enable-
                Address: 0000000000000000  Data: 0000

Thanks,
-Andrew

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Realtek ALC883 support on Albatron KI690-AM2 motherboard
  2007-12-02 21:08 Realtek ALC883 support on Albatron KI690-AM2 motherboard Andrew Paprocki
@ 2007-12-03 15:31 ` Takashi Iwai
  2007-12-03 19:13   ` Andrew Paprocki
  2007-12-14 22:32   ` Andrew Paprocki
  0 siblings, 2 replies; 7+ messages in thread
From: Takashi Iwai @ 2007-12-03 15:31 UTC (permalink / raw)
  To: Andrew Paprocki; +Cc: alsa-devel, Claudio Matsuoka, Jaroslav Kysela

At Sun, 2 Dec 2007 16:08:32 -0500,
Andrew Paprocki wrote:
> 
> Hello everyone,
> 
> I'm currently trying to get the ALC883 on the Albatron KI690-AM2
> motherboard working under ALSA and I'm running into problems with some
> of the ports. From looking at the patch_realtek.c file inside the
> intel_hda driver, it appears there are many variants of hookups to
> this chipset which all require some manual configuration in the
> driver. I've tried what appears to be the closest match
> (ALC883_6ST_DIG or 6stack-dig), but it still does not enable all of
> the ports.
> 
> The motherboard webpage is here:
> http://www.albatron.com.tw/English/product/mb/pro_detail.asp?rlink=Specification&no=239
> 
> The board has two audio stacks on the back panel. Facing the jack
> inputs, the left-hand stack contains:
>     <S/PDIF output>
>     <TOSLINK w/ green cover>
> 
> Next to that stack is a larger 6-stack with the following configuration:
>     <blue> <black>
>     <green> <pink>
>     <grey> <TOSLINK w/ pink cover>
> 
> The box is running a stock debian 2.6.18-4-486 kernel.

First of all, try the very latest ALSA version (from HG repo) if you
want to debug HD-audio stuff.  It's the most actively changed part in
ALSA drivers.  2.6.18 is way too old as a reference.  Also you should
build the driver with debug option (in the case of alsa-driver tree,
pass --with-debug=full to configure).

If the latest version still doesn't work (with all available models), 
then check /proc/asound/card0/codec#* files.

(Anyway, I'll be on vacation from tomorrow, so cannot work on your
 problem.  Hopefully this will interest other guys...)


Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Realtek ALC883 support on Albatron KI690-AM2 motherboard
  2007-12-03 15:31 ` Takashi Iwai
@ 2007-12-03 19:13   ` Andrew Paprocki
  2007-12-14 22:32   ` Andrew Paprocki
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Paprocki @ 2007-12-03 19:13 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Claudio Matsuoka, Jaroslav Kysela

Takashi,

Thanks, I'll work on getting this upgraded and post results. Some
things I noticed while looking over patch-realtek.c:

1) There is no enum defining the different NID values. The hex values
are used all over the code and you always have to keep referring back
to the list. Would a patch be accepted to convert the hex values to a
proper enum? It makes the code more clear to someone who hasn't looked
at the chipset datasheet before. I see the complete list in the ALC883
datasheet, but I'm not sure if it is specific to the ALC883 or if it
is defined by each HDA spec revision.

2) There does not appear to be an ALC883 profile which sets all
available NIDs to output. In my case, I am attempting to get as many
stereo outputs as possible from the chipset and I do not care at all
about capturing audio. The 6stack profile does not set the pin
configurations for the MIC1/2 and LINE1/2 NIDs. Would a new model be
required if I want to attempt to configure all possible NIDs for
output? Should this be called "all-out"?

3) I noticed a few discrepancies with the hda header files and the
ALC883 documentation in regards to bits being checked for a few
values. I'll follow up with those once I'm back in front of the code.

-Andrew

On Dec 3, 2007 10:31 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Sun, 2 Dec 2007 16:08:32 -0500,
> Andrew Paprocki wrote:
> >
> > Hello everyone,
> >
> > I'm currently trying to get the ALC883 on the Albatron KI690-AM2
> > motherboard working under ALSA and I'm running into problems with some
> > of the ports. From looking at the patch_realtek.c file inside the
> > intel_hda driver, it appears there are many variants of hookups to
> > this chipset which all require some manual configuration in the
> > driver. I've tried what appears to be the closest match
> > (ALC883_6ST_DIG or 6stack-dig), but it still does not enable all of
> > the ports.
> >
> > The motherboard webpage is here:
> > http://www.albatron.com.tw/English/product/mb/pro_detail.asp?rlink=Specification&no=239
> >
> > The board has two audio stacks on the back panel. Facing the jack
> > inputs, the left-hand stack contains:
> >     <S/PDIF output>
> >     <TOSLINK w/ green cover>
> >
> > Next to that stack is a larger 6-stack with the following configuration:
> >     <blue> <black>
> >     <green> <pink>
> >     <grey> <TOSLINK w/ pink cover>
> >
> > The box is running a stock debian 2.6.18-4-486 kernel.
>
> First of all, try the very latest ALSA version (from HG repo) if you
> want to debug HD-audio stuff.  It's the most actively changed part in
> ALSA drivers.  2.6.18 is way too old as a reference.  Also you should
> build the driver with debug option (in the case of alsa-driver tree,
> pass --with-debug=full to configure).
>
> If the latest version still doesn't work (with all available models),
> then check /proc/asound/card0/codec#* files.
>
> (Anyway, I'll be on vacation from tomorrow, so cannot work on your
>  problem.  Hopefully this will interest other guys...)
>
>
> Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Realtek ALC883 support on Albatron KI690-AM2 motherboard
  2007-12-03 15:31 ` Takashi Iwai
  2007-12-03 19:13   ` Andrew Paprocki
@ 2007-12-14 22:32   ` Andrew Paprocki
  2007-12-18 12:11     ` Takashi Iwai
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Paprocki @ 2007-12-14 22:32 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Takashi,

Running with the hg alsa head with full debug, I see the following
output.. The 01:05.2 device is an ATI HDMI port. I appear to have a
card0 after this which is the ALC883 chip. Do you know why the HDMI
port is not correctly detected as an "ATI RS600 HDMI" according to the
patch_atihdmi.c file? Do I need to pass any parameters to the module?

Thanks,
-Andrew

ACPI: PCI Interrupt 0000:00:14.2[A] -> GSI 16 (level, low) -> IRQ 18
hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2792: autoconfig:
line_outs=3 (0x14/0x15/0x16/0x0/0x0)
ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2796:    speaker_outs=0
(0x0/0x0/0x0/0x0/0x0)
ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2800:    hp_outs=1
(0x1b/0x0/0x0/0x0/0x0)
ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2808:    inputs:
mic=0x18, fmic=0x19, line=0x1a, fline=0x0, cd=0x0, aux=0x0
ALSA /usr/src/alsa-driver/acore/init.c:174: cannot find the slot for
index 0 (range 0-0), error: -16
ALSA /usr/src/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1885:
hda-intel: Error creating card!
HDA Intel: probe of 0000:01:05.2 failed with error -12

# lspci -vvs 00:14.2
00:14.2 Audio device: ATI Technologies Inc SB600 Azalia
        Subsystem: Albatron Corp. Unknown device 5000
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 64, Cache Line Size: 4 bytes
        Interrupt: pin ? routed to IRQ 18
        Region 0: Memory at fe024000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

# lspci -vvs 01:05.2
01:05.2 Audio device: ATI Technologies Inc Unknown device 7919
        Subsystem: Albatron Corp. Unknown device 5000
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 64, Cache Line Size: 4 bytes
        Interrupt: pin B routed to IRQ 5
        Region 0: Memory at fdefc000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+
Queue=0/0 Enable-
                Address: 0000000000000000  Data: 0000

On Dec 3, 2007 10:31 AM, Takashi Iwai <tiwai@suse.de> wrote:
> At Sun, 2 Dec 2007 16:08:32 -0500,
> Andrew Paprocki wrote:
> >
> > Hello everyone,
> >
> > I'm currently trying to get the ALC883 on the Albatron KI690-AM2
> > motherboard working under ALSA and I'm running into problems with some
> > of the ports. From looking at the patch_realtek.c file inside the
> > intel_hda driver, it appears there are many variants of hookups to
> > this chipset which all require some manual configuration in the
> > driver. I've tried what appears to be the closest match
> > (ALC883_6ST_DIG or 6stack-dig), but it still does not enable all of
> > the ports.
> >
> > The motherboard webpage is here:
> > http://www.albatron.com.tw/English/product/mb/pro_detail.asp?rlink=Specification&no=239
> >
> > The board has two audio stacks on the back panel. Facing the jack
> > inputs, the left-hand stack contains:
> >     <S/PDIF output>
> >     <TOSLINK w/ green cover>
> >
> > Next to that stack is a larger 6-stack with the following configuration:
> >     <blue> <black>
> >     <green> <pink>
> >     <grey> <TOSLINK w/ pink cover>
> >
> > The box is running a stock debian 2.6.18-4-486 kernel.
>
> First of all, try the very latest ALSA version (from HG repo) if you
> want to debug HD-audio stuff.  It's the most actively changed part in
> ALSA drivers.  2.6.18 is way too old as a reference.  Also you should
> build the driver with debug option (in the case of alsa-driver tree,
> pass --with-debug=full to configure).
>
> If the latest version still doesn't work (with all available models),
> then check /proc/asound/card0/codec#* files.
>
> (Anyway, I'll be on vacation from tomorrow, so cannot work on your
>  problem.  Hopefully this will interest other guys...)
>
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Realtek ALC883 support on Albatron KI690-AM2 motherboard
  2007-12-14 22:32   ` Andrew Paprocki
@ 2007-12-18 12:11     ` Takashi Iwai
  2007-12-18 12:34       ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2007-12-18 12:11 UTC (permalink / raw)
  To: Andrew Paprocki; +Cc: alsa-devel

At Fri, 14 Dec 2007 17:32:54 -0500,
Andrew Paprocki wrote:
> 
> Takashi,
> 
> Running with the hg alsa head with full debug, I see the following
> output.. The 01:05.2 device is an ATI HDMI port. I appear to have a
> card0 after this which is the ALC883 chip. Do you know why the HDMI
> port is not correctly detected as an "ATI RS600 HDMI" according to the
> patch_atihdmi.c file? Do I need to pass any parameters to the module?

Oh, that's an unexpected problem.

Right now, snd-hda-intel driver is designed for a single device.
I wrote it so because I thought the device is only for on-board.
But now, ATI ships the graphic card with the extra sound
controller, and this conflicts.

So, we need a major change in the driver code to allow multiple
devices.  OK, I'll hack it so that it can go to 2.6.25 kernel...


Meanwhile, did you try any model option for ALC883 (check
ALSA-Configuration.txt for the available values)?  If none of them
matches well, we'd need to develop a new model.


thanks,

Takashi


> 
> Thanks,
> -Andrew
> 
> ACPI: PCI Interrupt 0000:00:14.2[A] -> GSI 16 (level, low) -> IRQ 18
> hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
> ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2792: autoconfig:
> line_outs=3 (0x14/0x15/0x16/0x0/0x0)
> ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2796:    speaker_outs=0
> (0x0/0x0/0x0/0x0/0x0)
> ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2800:    hp_outs=1
> (0x1b/0x0/0x0/0x0/0x0)
> ALSA /usr/src/alsa-driver/pci/hda/hda_codec.c:2808:    inputs:
> mic=0x18, fmic=0x19, line=0x1a, fline=0x0, cd=0x0, aux=0x0
> ALSA /usr/src/alsa-driver/acore/init.c:174: cannot find the slot for
> index 0 (range 0-0), error: -16
> ALSA /usr/src/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1885:
> hda-intel: Error creating card!
> HDA Intel: probe of 0000:01:05.2 failed with error -12
> 
> # lspci -vvs 00:14.2
> 00:14.2 Audio device: ATI Technologies Inc SB600 Azalia
>         Subsystem: Albatron Corp. Unknown device 5000
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 64, Cache Line Size: 4 bytes
>         Interrupt: pin ? routed to IRQ 18
>         Region 0: Memory at fe024000 (64-bit, non-prefetchable) [size=16K]
>         Capabilities: [50] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> 
> # lspci -vvs 01:05.2
> 01:05.2 Audio device: ATI Technologies Inc Unknown device 7919
>         Subsystem: Albatron Corp. Unknown device 5000
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 64, Cache Line Size: 4 bytes
>         Interrupt: pin B routed to IRQ 5
>         Region 0: Memory at fdefc000 (64-bit, non-prefetchable) [size=16K]
>         Capabilities: [50] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>         Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+
> Queue=0/0 Enable-
>                 Address: 0000000000000000  Data: 0000
> 
> On Dec 3, 2007 10:31 AM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Sun, 2 Dec 2007 16:08:32 -0500,
> > Andrew Paprocki wrote:
> > >
> > > Hello everyone,
> > >
> > > I'm currently trying to get the ALC883 on the Albatron KI690-AM2
> > > motherboard working under ALSA and I'm running into problems with some
> > > of the ports. From looking at the patch_realtek.c file inside the
> > > intel_hda driver, it appears there are many variants of hookups to
> > > this chipset which all require some manual configuration in the
> > > driver. I've tried what appears to be the closest match
> > > (ALC883_6ST_DIG or 6stack-dig), but it still does not enable all of
> > > the ports.
> > >
> > > The motherboard webpage is here:
> > > http://www.albatron.com.tw/English/product/mb/pro_detail.asp?rlink=Specification&no=239
> > >
> > > The board has two audio stacks on the back panel. Facing the jack
> > > inputs, the left-hand stack contains:
> > >     <S/PDIF output>
> > >     <TOSLINK w/ green cover>
> > >
> > > Next to that stack is a larger 6-stack with the following configuration:
> > >     <blue> <black>
> > >     <green> <pink>
> > >     <grey> <TOSLINK w/ pink cover>
> > >
> > > The box is running a stock debian 2.6.18-4-486 kernel.
> >
> > First of all, try the very latest ALSA version (from HG repo) if you
> > want to debug HD-audio stuff.  It's the most actively changed part in
> > ALSA drivers.  2.6.18 is way too old as a reference.  Also you should
> > build the driver with debug option (in the case of alsa-driver tree,
> > pass --with-debug=full to configure).
> >
> > If the latest version still doesn't work (with all available models),
> > then check /proc/asound/card0/codec#* files.
> >
> > (Anyway, I'll be on vacation from tomorrow, so cannot work on your
> >  problem.  Hopefully this will interest other guys...)
> >
> >
> > Takashi
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> >
> >
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Realtek ALC883 support on Albatron KI690-AM2 motherboard
  2007-12-18 12:11     ` Takashi Iwai
@ 2007-12-18 12:34       ` Takashi Iwai
  2008-01-13  4:51         ` Andrew Paprocki
  0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2007-12-18 12:34 UTC (permalink / raw)
  To: Andrew Paprocki; +Cc: alsa-devel

At Tue, 18 Dec 2007 13:11:49 +0100,
I wrote:
> 
> At Fri, 14 Dec 2007 17:32:54 -0500,
> Andrew Paprocki wrote:
> > 
> > Takashi,
> > 
> > Running with the hg alsa head with full debug, I see the following
> > output.. The 01:05.2 device is an ATI HDMI port. I appear to have a
> > card0 after this which is the ALC883 chip. Do you know why the HDMI
> > port is not correctly detected as an "ATI RS600 HDMI" according to the
> > patch_atihdmi.c file? Do I need to pass any parameters to the module?
> 
> Oh, that's an unexpected problem.
> 
> Right now, snd-hda-intel driver is designed for a single device.
> I wrote it so because I thought the device is only for on-board.
> But now, ATI ships the graphic card with the extra sound
> controller, and this conflicts.
> 
> So, we need a major change in the driver code to allow multiple
> devices.  OK, I'll hack it so that it can go to 2.6.25 kernel...

The below is a quick hack to support multiple cards.

Could you give it a try?


Takashi


diff -r f405fa5b9e7e Documentation/ALSA-Configuration.txt
--- a/Documentation/ALSA-Configuration.txt	Tue Dec 18 13:14:21 2007 +0100
+++ b/Documentation/ALSA-Configuration.txt	Tue Dec 18 15:16:06 2007 +0100
@@ -744,9 +744,12 @@ Prior to version 0.9.0rc4 options had a 
 		VIA VT8251/VT8237A,
 		SIS966, ULI M5461
 
+    [Multiple options for each card instance]
     model	- force the model name
     position_fix - Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)
     probe_mask  - Bitmask to probe codecs (default = -1, meaning all slots)
+    
+    [Single (global) options]
     single_cmd  - Use single immediate commands to communicate with
 		codecs (for debugging only)
     enable_msi	- Enable Message Signaled Interrupt (MSI) (default = off)
@@ -755,8 +758,8 @@ Prior to version 0.9.0rc4 options had a 
     power_save_controller - Reset HD-audio controller in power-saving mode
 		(default = on)
 
-    This module supports one card and autoprobe.
-
+    This module supports multiple cards and autoprobe.
+    
     Each codec may have a model table for different configurations.
     If your machine isn't listed there, the default (usually minimal)
     configuration is set up.  You can pass "model=<name>" option to
diff -r f405fa5b9e7e pci/hda/hda_intel.c
--- a/pci/hda/hda_intel.c	Tue Dec 18 13:14:21 2007 +0100
+++ b/pci/hda/hda_intel.c	Tue Dec 18 15:16:06 2007 +0100
@@ -50,29 +50,32 @@
 #include "hda_codec.h"
 
 
-static int index = SNDRV_DEFAULT_IDX1;
-static char *id = SNDRV_DEFAULT_STR1;
-static char *model;
-static int position_fix;
-static int probe_mask = -1;
+static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
+static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
+static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
+static char *model[SNDRV_CARDS];
+static int position_fix[SNDRV_CARDS];
+static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
 static int single_cmd;
 static int enable_msi;
 
-module_param(index, int, 0444);
+module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
-module_param(id, charp, 0444);
+module_param_array(id, charp, NULL, 0444);
 MODULE_PARM_DESC(id, "ID string for Intel HD audio interface.");
-module_param(model, charp, 0444);
+module_param_array(enable, bool, NULL, 0444);
+MODULE_PARM_DESC(enable, "Enable Intel HD audio interface.");
+module_param_array(model, charp, NULL, 0444);
 MODULE_PARM_DESC(model, "Use the given board model.");
-module_param(position_fix, int, 0444);
+module_param_array(position_fix, int, NULL, 0444);
 MODULE_PARM_DESC(position_fix, "Fix DMA pointer "
 		 "(0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size).");
-module_param(probe_mask, int, 0444);
+module_param_array(probe_mask, int, NULL, 0444);
 MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1).");
 module_param(single_cmd, bool, 0444);
 MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs "
 		 "(for debugging only).");
-module_param(enable_msi, int, 0);
+module_param(enable_msi, int, 0444);
 MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)");
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
@@ -86,10 +89,6 @@ module_param(power_save_controller, bool
 module_param(power_save_controller, bool, 0644);
 MODULE_PARM_DESC(power_save_controller, "Reset controller in power save mode.");
 #endif
-
-/* just for backward compatibility */
-static int enable;
-module_param(enable, bool, 0444);
 
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
@@ -1038,7 +1037,8 @@ static unsigned int azx_max_codecs[] __d
 	[AZX_DRIVER_NVIDIA] = 3,	/* FIXME: correct? */
 };
 
-static int __devinit azx_codec_create(struct azx *chip, const char *model)
+static int __devinit azx_codec_create(struct azx *chip, const char *model,
+				      unsigned int codec_probe_mask)
 {
 	struct hda_bus_template bus_temp;
 	int c, codecs, audio_codecs, err;
@@ -1059,7 +1059,7 @@ static int __devinit azx_codec_create(st
 
 	codecs = audio_codecs = 0;
 	for (c = 0; c < AZX_MAX_CODECS; c++) {
-		if ((chip->codec_mask & (1 << c)) & probe_mask) {
+		if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
 			struct hda_codec *codec;
 			err = snd_hda_codec_new(chip->bus, c, &codec);
 			if (err < 0)
@@ -1072,7 +1072,7 @@ static int __devinit azx_codec_create(st
 	if (!audio_codecs) {
 		/* probe additional slots if no codec is found */
 		for (; c < azx_max_codecs[chip->driver_type]; c++) {
-			if ((chip->codec_mask & (1 << c)) & probe_mask) {
+			if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
 				err = snd_hda_codec_new(chip->bus, c, NULL);
 				if (err < 0)
 					continue;
@@ -1683,18 +1683,18 @@ static struct snd_pci_quirk probe_mask_l
 	{}
 };
 
-static void __devinit check_probe_mask(struct azx *chip)
+static void __devinit check_probe_mask(struct azx *chip, int dev)
 {
 	const struct snd_pci_quirk *q;
 
-	if (probe_mask == -1) {
+	if (probe_mask[dev] == -1) {
 		q = snd_pci_quirk_lookup(chip->pci, probe_mask_list);
 		if (q) {
 			printk(KERN_INFO
 			       "hda_intel: probe_mask set to 0x%x "
 			       "for device %04x:%04x\n",
 			       q->value, q->subvendor, q->subdevice);
-			probe_mask = q->value;
+			probe_mask[dev] = q->value;
 		}
 	}
 }
@@ -1704,7 +1704,7 @@ static void __devinit check_probe_mask(s
  * constructor
  */
 static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
-				int driver_type,
+				int dev, int driver_type,
 				struct azx **rchip)
 {
 	struct azx *chip;
@@ -1734,8 +1734,8 @@ static int __devinit azx_create(struct s
 	chip->driver_type = driver_type;
 	chip->msi = enable_msi;
 
-	chip->position_fix = check_position_fix(chip, position_fix);
-	check_probe_mask(chip);
+	chip->position_fix = check_position_fix(chip, position_fix[dev]);
+	check_probe_mask(chip, dev);
 
 	chip->single_cmd = single_cmd;
 
@@ -1876,17 +1876,25 @@ static int __devinit azx_probe(struct pc
 static int __devinit azx_probe(struct pci_dev *pci,
 			       const struct pci_device_id *pci_id)
 {
+	static int dev;
 	struct snd_card *card;
 	struct azx *chip;
 	int err;
 
-	card = snd_card_new(index, id, THIS_MODULE, 0);
+	if (dev >= SNDRV_CARDS)
+		return -ENODEV;
+	if (!enable[dev]) {
+		dev++;
+		return -ENOENT;
+	}
+
+	card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
 	if (!card) {
 		snd_printk(KERN_ERR SFX "Error creating card!\n");
 		return -ENOMEM;
 	}
 
-	err = azx_create(card, pci, pci_id->driver_data, &chip);
+	err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
 	if (err < 0) {
 		snd_card_free(card);
 		return err;
@@ -1894,7 +1902,7 @@ static int __devinit azx_probe(struct pc
 	card->private_data = chip;
 
 	/* create codec instances */
-	err = azx_codec_create(chip, model);
+	err = azx_codec_create(chip, model[dev], probe_mask[dev]);
 	if (err < 0) {
 		snd_card_free(card);
 		return err;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Realtek ALC883 support on Albatron KI690-AM2 motherboard
  2007-12-18 12:34       ` Takashi Iwai
@ 2008-01-13  4:51         ` Andrew Paprocki
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Paprocki @ 2008-01-13  4:51 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Takashi,

I finally got the hardware set up again to test the patch. I noticed
that it was already applied to hg, so I just used the latest hg code
to test. With the new code the 2nd device was always failing with an
-EBUSY error. I poked around adding some printk's and noticed that the
device count wasn't being incremented for subsequent cards. I fixed it
and submitted the patch. With that modification it appears to be
working now:

$ modprobe snd_hda_intel
ACPI: PCI Interrupt 0000:00:14.2[A] -> GSI 16 (level, low) -> IRQ 16
hda_codec: Unknown model for ALC883, trying auto-probe from BIOS...
ACPI: PCI Interrupt 0000:01:05.2[B] -> GSI 19 (level, low) -> IRQ 18

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC883 Analog [ALC883 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC883 Digital [ALC883 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 0: ATI HDMI [ATI HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

$ cat /proc/asound/card1/codec#0
Codec: Generic 1002 ATI RS690/780 HDMI
Address: 0
Vendor Id: 0x1002791a
Subsystem Id: 0x791a00
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
    rates [0x70]: 32000 44100 48000
    bits [0x2]: 16
    formats [0x1]: PCM
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
Node 0x02 [Audio Output] wcaps 0x201: Stereo Digital
Node 0x03 [Pin Complex] wcaps 0x400381: Stereo Digital
  Pincap 0x0814: OUT Detect
  Pin Default 0x18560010: [Jack] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
  Pin-ctls: 0x40: OUT
  Connection: 1
     0x02

Thanks,
-Andrew

On Dec 18, 2007 7:34 AM, Takashi Iwai <tiwai@suse.de> wrote:
> > Right now, snd-hda-intel driver is designed for a single device.
> > I wrote it so because I thought the device is only for on-board.
> > But now, ATI ships the graphic card with the extra sound
> > controller, and this conflicts.
> >
> > So, we need a major change in the driver code to allow multiple
> > devices.  OK, I'll hack it so that it can go to 2.6.25 kernel...
>
> The below is a quick hack to support multiple cards.
>
> Could you give it a try?
>
>
> Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-13  4:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-02 21:08 Realtek ALC883 support on Albatron KI690-AM2 motherboard Andrew Paprocki
2007-12-03 15:31 ` Takashi Iwai
2007-12-03 19:13   ` Andrew Paprocki
2007-12-14 22:32   ` Andrew Paprocki
2007-12-18 12:11     ` Takashi Iwai
2007-12-18 12:34       ` Takashi Iwai
2008-01-13  4:51         ` Andrew Paprocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.