All of lore.kernel.org
 help / color / mirror / Atom feed
* Error: firmware not found
@ 2005-01-22 10:37 Giuliano Pochini
  2005-01-23  2:37 ` Fernando Lopez-Lezcano
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-22 10:37 UTC (permalink / raw)
  To: Alsa-devel



Since my echoaudio driver is the first driver which is using the new
"standard" firmware loader, I can anticipate what you have to expect when
other drivers will be converted to that interface: people will not be able
to make them work.

I don't know what distributions are doing, but it is causing users (and, in
turn, to me) a lot of trouble. I located these main problems in the latest
hotplug scripts (hotplug-2004_09_23):


- /etc/hotplug/firmware.agent sets FIRMWARE_DIR=/lib/firmware, but
alsa-firmware install the files in /usr/lib/hotplug/firmware .

- Some distros that originally shipped with linux 2.4 (like my YDL3.0) do
not set /proc/sys/kernel/hotplug and .../modprobe because rc.sysinit looks
for /proc/ksyms that doesn't exists with linux 2.6.

- In /etc/hotplug/pci.agent:pci_map_modules() at line 123 I had to remove
the break, otherwise the loop stops as soon as it finds the first matching
PCI ID. This is not good because some cards (in my case the Layla3G and the
Gina3G) have the same PCI card, but different external module.

I prepared two RPMs with the latest hotplug scripts with the changes above
(except the one in rc.sysinit). They require the chkconfig utility by
RedHat. I hope they're useful:

http://xoomer.virgilio.it/g_pochini/hotplug-base-2004_09_23-1.noarch.rpm
http://xoomer.virgilio.it/g_pochini/hotplug-2004_09_23-1.noarch.rpm



--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-22 10:37 Error: firmware not found Giuliano Pochini
@ 2005-01-23  2:37 ` Fernando Lopez-Lezcano
  2005-01-24  8:41   ` Giuliano Pochini
  2005-01-24 10:06   ` Takashi Iwai
  2005-01-24 11:43 ` Thierry Vignaud
  2005-01-24 11:52 ` Thierry Vignaud
  2 siblings, 2 replies; 22+ messages in thread
From: Fernando Lopez-Lezcano @ 2005-01-23  2:37 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

On Sat, 2005-01-22 at 02:37, Giuliano Pochini wrote:
> Since my echoaudio driver is the first driver which is using the new
> "standard" firmware loader, I can anticipate what you have to expect when
> other drivers will be converted to that interface: people will not be able
> to make them work.
> 
> I don't know what distributions are doing, but it is causing users (and, in
> turn, to me) a lot of trouble. I located these main problems in the latest
> hotplug scripts (hotplug-2004_09_23):
> 
> - /etc/hotplug/firmware.agent sets FIRMWARE_DIR=/lib/firmware, but
> alsa-firmware install the files in /usr/lib/hotplug/firmware .

Yes, I noticed this and I'm packaging for fc3 / Planet CCRMA (which uses
/lib/firmware) by setting that directory explicitly in the alsa-firmware
configure step. I have at least two users that have successfully used
echoaudio cards. 

> - Some distros that originally shipped with linux 2.4 (like my YDL3.0) do
> not set /proc/sys/kernel/hotplug and .../modprobe because rc.sysinit looks
> for /proc/ksyms that doesn't exists with linux 2.6.
> 
> - In /etc/hotplug/pci.agent:pci_map_modules() at line 123 I had to remove
> the break, otherwise the loop stops as soon as it finds the first matching
> PCI ID. This is not good because some cards (in my case the Layla3G and the
> Gina3G) have the same PCI card, but different external module.

Could you expand on this? What is the result of using an unmodified
hotplug? Wrong firmware loaded? (fc3 ships with hotplug-2004_04_01-8.1
which I presume would have the problem)

-- Fernando




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-23  2:37 ` Fernando Lopez-Lezcano
@ 2005-01-24  8:41   ` Giuliano Pochini
  2005-01-24 10:06   ` Takashi Iwai
  1 sibling, 0 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-24  8:41 UTC (permalink / raw)
  To: Fernando Lopez-Lezcano; +Cc: Alsa-devel


On 23-Jan-2005 Fernando Lopez-Lezcano wrote:

>> - In /etc/hotplug/pci.agent:pci_map_modules() at line 123 I had to remove
>> the break, otherwise the loop stops as soon as it finds the first matching
>> PCI ID. This is not good because some cards (in my case the Layla3G and the
>> Gina3G) have the same PCI card, but different external module.
>
> Could you expand on this? What is the result of using an unmodified
> hotplug? Wrong firmware loaded? (fc3 ships with hotplug-2004_04_01-8.1
> which I presume would have the problem)

I don't know if there are other devices that have the same PCI card
and different "box" (not necessarily an audio device). The Gina3G
and Layla3G have different driver, but same PCI card. For example I
have a Gina3G. If in /lib/modules/x.x.x/modules.pcimap the Layla3G
module is listed before the Gina3G the original hotplug script loads
snd-layla3g *only* which, obviously, fails.
With that change pci_map_modules() return all matching modules, so
it fixes the problem. BUT, there is a comment before that function
that says it returns "ONE" (all uppercase) module only. It means
it was done on purpose, but I can't see why.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-23  2:37 ` Fernando Lopez-Lezcano
  2005-01-24  8:41   ` Giuliano Pochini
@ 2005-01-24 10:06   ` Takashi Iwai
  2005-01-24 21:55     ` Fernando Lopez-Lezcano
  1 sibling, 1 reply; 22+ messages in thread
From: Takashi Iwai @ 2005-01-24 10:06 UTC (permalink / raw)
  To: Fernando Lopez-Lezcano; +Cc: Giuliano Pochini, Alsa-devel

At 22 Jan 2005 18:37:36 -0800,
Fernando Lopez-Lezcano wrote:
> 
> On Sat, 2005-01-22 at 02:37, Giuliano Pochini wrote:
> > Since my echoaudio driver is the first driver which is using the new
> > "standard" firmware loader, I can anticipate what you have to expect when
> > other drivers will be converted to that interface: people will not be able
> > to make them work.
> > 
> > I don't know what distributions are doing, but it is causing users (and, in
> > turn, to me) a lot of trouble. I located these main problems in the latest
> > hotplug scripts (hotplug-2004_09_23):
> > 
> > - /etc/hotplug/firmware.agent sets FIRMWARE_DIR=/lib/firmware, but
> > alsa-firmware install the files in /usr/lib/hotplug/firmware .
> 
> Yes, I noticed this and I'm packaging for fc3 / Planet CCRMA (which uses
> /lib/firmware) by setting that directory explicitly in the alsa-firmware
> configure step. I have at least two users that have successfully used
> echoaudio cards. 

IMO, it's a bug of hotplug if it doesn't look at the old path,
/usr/lib/hotplug/firmware.  Of course, passing the proper path to
configure script would be the best solution, though.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-22 10:37 Error: firmware not found Giuliano Pochini
  2005-01-23  2:37 ` Fernando Lopez-Lezcano
@ 2005-01-24 11:43 ` Thierry Vignaud
  2005-01-24 11:44   ` Thierry Vignaud
  2005-01-25  8:22   ` Giuliano Pochini
  2005-01-24 11:52 ` Thierry Vignaud
  2 siblings, 2 replies; 22+ messages in thread
From: Thierry Vignaud @ 2005-01-24 11:43 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

Giuliano Pochini <pochini@shiny.it> writes:

> Since my echoaudio driver is the first driver which is using the new
> "standard" firmware loader, I can anticipate what you have to expect
> when other drivers will be converted to that interface: people will
> not be able to make them work.
> 
> I don't know what distributions are doing, but it is causing users
> (and, in turn, to me) a lot of trouble. I located these main
> problems in the latest hotplug scripts (hotplug-2004_09_23):

(...)

> - /etc/hotplug/firmware.agent sets FIRMWARE_DIR=/lib/firmware, but
> alsa-firmware install the files in /usr/lib/hotplug/firmware .

properly packaged distro (eg: mandrakelinux) have /usr/lib/hotplug
linked on /lib/hotplug
 
> - Some distros that originally shipped with linux 2.4 (like my
> YDL3.0) do not set /proc/sys/kernel/hotplug and .../modprobe because
> rc.sysinit looks for /proc/ksyms that doesn't exists with linux 2.6.

distro bug, please reports to them

> - In /etc/hotplug/pci.agent:pci_map_modules() at line 123 I had to
> remove the break, otherwise the loop stops as soon as it finds the
> first matching PCI ID. This is not good because some cards (in my
> case the Layla3G and the Gina3G) have the same PCI card, but
> different external module.

is this the only change you had to do?



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-24 11:43 ` Thierry Vignaud
@ 2005-01-24 11:44   ` Thierry Vignaud
  2005-01-25  8:15     ` Giuliano Pochini
  2005-01-25  8:22   ` Giuliano Pochini
  1 sibling, 1 reply; 22+ messages in thread
From: Thierry Vignaud @ 2005-01-24 11:44 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

Thierry Vignaud <tvignaud@mandrakesoft.com> writes:

> > - In /etc/hotplug/pci.agent:pci_map_modules() at line 123 I had to
> > remove the break, otherwise the loop stops as soon as it finds the
> > first matching PCI ID. This is not good because some cards (in my
> > case the Layla3G and the Gina3G) have the same PCI card, but
> > different external module.
> 
> is this the only change you had to do?

eg:

--- ./etc/hotplug/pci.agent.tv3 2005-01-24 12:41:00.610030503 +0100
+++ ./etc/hotplug/pci.agent     2005-01-24 12:41:19.903578455 +0100
@@ -117,7 +117,6 @@
        if [ $class_temp -eq $class ]; then
            DRIVERS="$module $DRIVERS"
            : drivers $DRIVERS
-           break
        fi
     done
 }



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-22 10:37 Error: firmware not found Giuliano Pochini
  2005-01-23  2:37 ` Fernando Lopez-Lezcano
  2005-01-24 11:43 ` Thierry Vignaud
@ 2005-01-24 11:52 ` Thierry Vignaud
  2005-01-25  8:32   ` Giuliano Pochini
  2 siblings, 1 reply; 22+ messages in thread
From: Thierry Vignaud @ 2005-01-24 11:52 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

Giuliano Pochini <pochini@shiny.it> writes:

> This is not good because some cards (in my case the Layla3G and the
> Gina3G) have the same PCI card, but different external module.

you mean that you've one of this card and that hotplug loads the wrong
module ?
if yes, this is a driver bug indeed.

if several drivers request devices with the same ids whereas they
thrully are different devices, these drivers should export a list of
ids with subids then.



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-24 10:06   ` Takashi Iwai
@ 2005-01-24 21:55     ` Fernando Lopez-Lezcano
  0 siblings, 0 replies; 22+ messages in thread
From: Fernando Lopez-Lezcano @ 2005-01-24 21:55 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Giuliano Pochini, Alsa-devel

On Mon, 2005-01-24 at 02:06, Takashi Iwai wrote:
> At 22 Jan 2005 18:37:36 -0800,
> Fernando Lopez-Lezcano wrote:
> > 
> > On Sat, 2005-01-22 at 02:37, Giuliano Pochini wrote:
> > > Since my echoaudio driver is the first driver which is using the new
> > > "standard" firmware loader, I can anticipate what you have to expect when
> > > other drivers will be converted to that interface: people will not be able
> > > to make them work.
> > > 
> > > I don't know what distributions are doing, but it is causing users (and, in
> > > turn, to me) a lot of trouble. I located these main problems in the latest
> > > hotplug scripts (hotplug-2004_09_23):
> > > 
> > > - /etc/hotplug/firmware.agent sets FIRMWARE_DIR=/lib/firmware, but
> > > alsa-firmware install the files in /usr/lib/hotplug/firmware .
> > 
> > Yes, I noticed this and I'm packaging for fc3 / Planet CCRMA (which uses
> > /lib/firmware) by setting that directory explicitly in the alsa-firmware
> > configure step. I have at least two users that have successfully used
> > echoaudio cards. 
> 
> IMO, it's a bug of hotplug if it doesn't look at the old path,
> /usr/lib/hotplug/firmware.  Of course, passing the proper path to
> configure script would be the best solution, though.

Hmmm, it did not occur to me to try :-) I just played it safe and passed
the proper path to the configure script...

-- Fernando




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-24 11:44   ` Thierry Vignaud
@ 2005-01-25  8:15     ` Giuliano Pochini
  0 siblings, 0 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-25  8:15 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: Alsa-devel


On 24-Jan-2005 Thierry Vignaud wrote:

>> is this the only change you had to do?
> 
> eg:
> 
> --- ./etc/hotplug/pci.agent.tv3 2005-01-24 12:41:00.610030503 +0100
> +++ ./etc/hotplug/pci.agent     2005-01-24 12:41:19.903578455 +0100
> @@ -117,7 +117,6 @@
>         if [ $class_temp -eq $class ]; then
>             DRIVERS="$module $DRIVERS"
>             : drivers $DRIVERS
> -           break
>         fi
>      done
>  }


Yes, this and the path to the fw directory. It works fine
for my setup. Users did not try it yet.



--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-24 11:43 ` Thierry Vignaud
  2005-01-24 11:44   ` Thierry Vignaud
@ 2005-01-25  8:22   ` Giuliano Pochini
  1 sibling, 0 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-25  8:22 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: Alsa-devel


On 24-Jan-2005 Thierry Vignaud wrote:

>> - Some distros that originally shipped with linux 2.4 (like my
>> YDL3.0) do not set /proc/sys/kernel/hotplug and .../modprobe because
>> rc.sysinit looks for /proc/ksyms that doesn't exists with linux 2.6.
>
> distro bug, please reports to them

It's an old pre-2.6 distro, there's nothing to report.
It may cause troubles to users, though, so I let you know.


>> - In /etc/hotplug/pci.agent:pci_map_modules() at line 123 I had to
>> remove the break, otherwise the loop stops as soon as it finds the
>> first matching PCI ID. This is not good because some cards (in my
>> case the Layla3G and the Gina3G) have the same PCI card, but
>> different external module.
>
> is this the only change you had to do?

Basically, yes.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-24 11:52 ` Thierry Vignaud
@ 2005-01-25  8:32   ` Giuliano Pochini
  2005-01-25 13:19     ` Thierry Vignaud
  2005-01-25 15:06     ` Takashi Iwai
  0 siblings, 2 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-25  8:32 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: Alsa-devel


On 24-Jan-2005 Thierry Vignaud wrote:
> Giuliano Pochini <pochini@shiny.it> writes:
> 
>> This is not good because some cards (in my case the Layla3G and the
>> Gina3G) have the same PCI card, but different external module.
> 
> you mean that you've one of this card and that hotplug loads the wrong
> module ?

Yes.


> if yes, this is a driver bug indeed.

No, it isn't, because those devices use the same PCI card, that is
the kernel reports the same PCI ID/subID's. The driver has to load
the firmware and then it asks the DSP what (if any) external box is
attached. If it is the wrong driver it exits with -ENODEV.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-25  8:32   ` Giuliano Pochini
@ 2005-01-25 13:19     ` Thierry Vignaud
  2005-01-25 13:57       ` Giuliano Pochini
  2005-01-25 15:06     ` Takashi Iwai
  1 sibling, 1 reply; 22+ messages in thread
From: Thierry Vignaud @ 2005-01-25 13:19 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

Giuliano Pochini <pochini@shiny.it> writes:

> > > This is not good because some cards (in my case the Layla3G and
> > > the Gina3G) have the same PCI card, but different external
> > > module.
> > 
> > you mean that you've one of this card and that hotplug loads the
> > wrong module ?
> 
> Yes.
> 
> > if yes, this is a driver bug indeed.
> 
> No, it isn't, because those devices use the same PCI card, that is
> the kernel reports the same PCI ID/subID's. The driver has to load
> the firmware and then it asks the DSP what (if any) external box is
> attached. If it is the wrong driver it exits with -ENODEV.

:-(

are these cards rare or not?

b/c this is a big issue for hw auto configuring (eg as we do in
mandrakelinux).

would it be possible to create a snd-echoaudio frontend driver that
would try sub-drivers (gina*, layla*, ...) which would load the
firmware & ask DSP ?

this what they do for some dvb cards.

this would save distro :-)



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-25 13:19     ` Thierry Vignaud
@ 2005-01-25 13:57       ` Giuliano Pochini
  0 siblings, 0 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-25 13:57 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: Alsa-devel


On 25-Jan-2005 Thierry Vignaud wrote:

>> No, it isn't, because those devices use the same PCI card, that is
>> the kernel reports the same PCI ID/subID's. The driver has to load
>> the firmware and then it asks the DSP what (if any) external box is
>> attached. If it is the wrong driver it exits with -ENODEV.
>
>:-(
>
> are these cards rare or not?

Just about other high-end cards I guess. Only the Layla3G and
the Gina3G share the same PCI card. All other Echo cards don't.


> b/c this is a big issue for hw auto configuring (eg as we do in
> mandrakelinux).

I don't know how mkd autoconfig works, but IMHO you just have
to load both *3g modules if their PCI ID is detected. That
change to pci.agent does exactly this.


> would it be possible to create a snd-echoaudio frontend driver that
> would try sub-drivers (gina*, layla*, ...) which would load the
> firmware & ask DSP ?

Probably yes, but I don't know how to do it right now.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-25  8:32   ` Giuliano Pochini
  2005-01-25 13:19     ` Thierry Vignaud
@ 2005-01-25 15:06     ` Takashi Iwai
  2005-01-25 15:35       ` Giuliano Pochini
  1 sibling, 1 reply; 22+ messages in thread
From: Takashi Iwai @ 2005-01-25 15:06 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Thierry Vignaud, Alsa-devel

At Tue, 25 Jan 2005 09:32:27 +0100 (CET),
Giuliano Pochini wrote:
> 
> 
> On 24-Jan-2005 Thierry Vignaud wrote:
> > Giuliano Pochini <pochini@shiny.it> writes:
> > 
> >> This is not good because some cards (in my case the Layla3G and the
> >> Gina3G) have the same PCI card, but different external module.
> > 
> > you mean that you've one of this card and that hotplug loads the wrong
> > module ?
> 
> Yes.
> 
> 
> > if yes, this is a driver bug indeed.
> 
> No, it isn't, because those devices use the same PCI card, that is
> the kernel reports the same PCI ID/subID's. The driver has to load
> the firmware and then it asks the DSP what (if any) external box is
> attached. If it is the wrong driver it exits with -ENODEV.

Hmm, but having two drivers for the identical PCI ID/subID isn't
good.  Isn't it possible to determine in the driver level which model
it is?


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-25 15:06     ` Takashi Iwai
@ 2005-01-25 15:35       ` Giuliano Pochini
  2005-01-25 15:39         ` Takashi Iwai
  0 siblings, 1 reply; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-25 15:35 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Thierry Vignaud, Alsa-devel



On Tue, 25 Jan 2005, Takashi Iwai wrote:

> > No, it isn't, because those devices use the same PCI card, that is
> > the kernel reports the same PCI ID/subID's. The driver has to load
> > the firmware and then it asks the DSP what (if any) external box is
> > attached. If it is the wrong driver it exits with -ENODEV.
>
> Hmm, but having two drivers for the identical PCI ID/subID isn't
> good.  Isn't it possible to determine in the driver level which model
> it is?

Nope. They *are* the same card. Only the DSP knows what box is attached.

The generic driver by Echoaudio does:

Load the DSP loader
Load the DSP code of the Layla3G
Is the attached box a Layla3G ?
	no:
	reset DSP
	Load the DSP code of the Gina3G
Load the ASIC code

The ALSA driver exits if the box is wrong. The obvious solution is to do
that same procedure in the ALSA driver, but it implies I have to replace
all references to card capabilites (# of channels, etc...) with variables.
Those vars never change their values after init. Furthermore a few
functions are different. I worked a lot to do as much choices as possible
at compile time. Currently they're all constants.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-25 15:35       ` Giuliano Pochini
@ 2005-01-25 15:39         ` Takashi Iwai
  2005-01-26 17:29           ` Giuliano Pochini
  0 siblings, 1 reply; 22+ messages in thread
From: Takashi Iwai @ 2005-01-25 15:39 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Thierry Vignaud, Alsa-devel

At Tue, 25 Jan 2005 16:35:46 +0100 (CET),
Giuliano Pochini wrote:
> 
> On Tue, 25 Jan 2005, Takashi Iwai wrote:
> 
> > > No, it isn't, because those devices use the same PCI card, that is
> > > the kernel reports the same PCI ID/subID's. The driver has to load
> > > the firmware and then it asks the DSP what (if any) external box is
> > > attached. If it is the wrong driver it exits with -ENODEV.
> >
> > Hmm, but having two drivers for the identical PCI ID/subID isn't
> > good.  Isn't it possible to determine in the driver level which model
> > it is?
> 
> Nope. They *are* the same card. Only the DSP knows what box is attached.
> 
> The generic driver by Echoaudio does:
> 
> Load the DSP loader
> Load the DSP code of the Layla3G
> Is the attached box a Layla3G ?
> 	no:
> 	reset DSP
> 	Load the DSP code of the Gina3G
> Load the ASIC code
> 
> The ALSA driver exits if the box is wrong. The obvious solution is to do
> that same procedure in the ALSA driver, but it implies I have to replace
> all references to card capabilites (# of channels, etc...) with variables.
> Those vars never change their values after init. Furthermore a few
> functions are different. I worked a lot to do as much choices as possible
> at compile time. Currently they're all constants.

Well, but if it's the only method to initialize the stuff
automatically, the procedure above seems to be the only to go.

This is no urgent issue, but should be fixed before submitting to
linux kernel.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-25 15:39         ` Takashi Iwai
@ 2005-01-26 17:29           ` Giuliano Pochini
  2005-01-27 10:10             ` Takashi Iwai
  0 siblings, 1 reply; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-26 17:29 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Alsa-devel


On 25-Jan-2005 Takashi Iwai wrote:

>> The ALSA driver exits if the box is wrong. The obvious solution is to do
>> that same procedure in the ALSA driver, but it implies I have to replace
>> all references to card capabilites (# of channels, etc...) with variables.
>> Those vars never change their values after init. Furthermore a few
>> functions are different. I worked a lot to do as much choices as possible
>> at compile time. Currently they're all constants.
>
> Well, but if it's the only method to initialize the stuff
> automatically, the procedure above seems to be the only to go.
>
> This is no urgent issue, but should be fixed before submitting to
> linux kernel.

*sigh* I'll do some tests in the weekend to see how much
is the impact of making all that stuff variable in terms
of binary size and mess in the sources. Maybe I can fix
it with some not very nice #define...

Btw, I don't see what is the problem of having two drivers
for the same ID. Does it break some rule ?  Actually, the
problem is there are two different (though similar) devices
with the same IDs :-/


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-26 17:29           ` Giuliano Pochini
@ 2005-01-27 10:10             ` Takashi Iwai
  2005-01-28 16:34               ` Giuliano Pochini
  0 siblings, 1 reply; 22+ messages in thread
From: Takashi Iwai @ 2005-01-27 10:10 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel, Thierry Vignaud

At Wed, 26 Jan 2005 18:29:42 +0100 (CET),
Giuliano Pochini wrote:
> 
> 
> On 25-Jan-2005 Takashi Iwai wrote:
> 
> >> The ALSA driver exits if the box is wrong. The obvious solution is to do
> >> that same procedure in the ALSA driver, but it implies I have to replace
> >> all references to card capabilites (# of channels, etc...) with variables.
> >> Those vars never change their values after init. Furthermore a few
> >> functions are different. I worked a lot to do as much choices as possible
> >> at compile time. Currently they're all constants.
> >
> > Well, but if it's the only method to initialize the stuff
> > automatically, the procedure above seems to be the only to go.
> >
> > This is no urgent issue, but should be fixed before submitting to
> > linux kernel.
> 
> *sigh* I'll do some tests in the weekend to see how much
> is the impact of making all that stuff variable in terms
> of binary size and mess in the sources. Maybe I can fix
> it with some not very nice #define...

[Looks like my last post didn't come out due to system problems, so I
 rewriting again the same thing]

You don't have to use variables (although it's better for a long
term).  The problem is that you have two modules.  Combining them to a
single module wouldn't be too hard.

For example, compile layla and gina separately, but without
module_init and module_exit.  Create a skeleton PCI entry which calls
layla's and gina's driver callback functions.
The reference to module options should be fixed, too.

> 
> Btw, I don't see what is the problem of having two drivers
> for the same ID. Does it break some rule ?

We may have, but we can't load them at the same time.
It's a tacit understanding that the drivers with the same id
conflict.


Takashi


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-27 10:10             ` Takashi Iwai
@ 2005-01-28 16:34               ` Giuliano Pochini
  2005-01-28 16:41                 ` Thierry Vignaud
  0 siblings, 1 reply; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-28 16:34 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Alsa-devel, Thierry Vignaud



On Thu, 27 Jan 2005, Takashi Iwai wrote:

> > *sigh* I'll do some tests in the weekend to see how much
> > is the impact of making all that stuff variable in terms
> > of binary size and mess in the sources. Maybe I can fix
> > it with some not very nice #define...
>
> [Looks like my last post didn't come out due to system problems, so I
>  rewriting again the same thing]
>
> You don't have to use variables (although it's better for a long
> term).

Ahem - it DID use variables some versions ago. I replaced them with
constants because it's quite pointless using variables for values that
never change. Shortly after Echoaudio released the 3G cards... Btw it's
not only a matter of variables, some functions are different, too.


> The problem is that you have two modules.  Combining them to a
> single module wouldn't be too hard.

Ok, but I don't want to keep all that duplicated code loaded when only
half of it is needed. I would prefer a tiny "loader" module that does the
same work of "modprobe snd-layla3g snd-gina3g". I'll also search for other
similar cases to see if someone has a better idea.


> > Btw, I don't see what is the problem of having two drivers
> > for the same ID. Does it break some rule ?
>
> We may have, but we can't load them at the same time.
> It's a tacit understanding that the drivers with the same id
> conflict.

..and I didn't check if it works at all if the drivers are not compiled
as modules.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-28 16:34               ` Giuliano Pochini
@ 2005-01-28 16:41                 ` Thierry Vignaud
  2005-01-28 16:43                   ` Giuliano Pochini
  2005-01-29 15:46                   ` Giuliano Pochini
  0 siblings, 2 replies; 22+ messages in thread
From: Thierry Vignaud @ 2005-01-28 16:41 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Takashi Iwai, Alsa-devel

Giuliano Pochini <pochini@denise.shiny.it> writes:

> Ok, but I don't want to keep all that duplicated code loaded when
> only half of it is needed. I would prefer a tiny "loader" module
> that does the same work of "modprobe snd-layla3g snd-gina3g". I'll
> also search for other similar cases to see if someone has a better
> idea.

look at the DVB sub-system



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-28 16:41                 ` Thierry Vignaud
@ 2005-01-28 16:43                   ` Giuliano Pochini
  2005-01-29 15:46                   ` Giuliano Pochini
  1 sibling, 0 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-28 16:43 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: Takashi Iwai, Alsa-devel



On Fri, 28 Jan 2005, Thierry Vignaud wrote:

> > Ok, but I don't want to keep all that duplicated code loaded when
> > only half of it is needed. I would prefer a tiny "loader" module
> > that does the same work of "modprobe snd-layla3g snd-gina3g". I'll
> > also search for other similar cases to see if someone has a better
> > idea.
>
> look at the DVB sub-system


I'll do.


--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

* Re: Error: firmware not found
  2005-01-28 16:41                 ` Thierry Vignaud
  2005-01-28 16:43                   ` Giuliano Pochini
@ 2005-01-29 15:46                   ` Giuliano Pochini
  1 sibling, 0 replies; 22+ messages in thread
From: Giuliano Pochini @ 2005-01-29 15:46 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: tiwai, alsa-devel

On Fri, 28 Jan 2005 17:41:55 +0100
Thierry Vignaud <tvignaud@mandrakesoft.com> wrote:

> Giuliano Pochini <pochini@denise.shiny.it> writes:
> 
> > Ok, but I don't want to keep all that duplicated code loaded when
> > only half of it is needed. I would prefer a tiny "loader" module
> > that does the same work of "modprobe snd-layla3g snd-gina3g". I'll
> > also search for other similar cases to see if someone has a better
> > idea.
> 
> look at the DVB sub-system

Well, I didn't find anything really useful there. They use the module
interface like is was a plugin loader. It does not neither save me work nor
make the driver look very good. I just finished the first attempt to solve
the problem and it works fine here, although I don't have a Layla3G to test.

It changes the Gina3G driver so it works with the Layla3G, too. I'm not very
proud of those #define hacks in gina3g.c and some details are missing, but
it's overall a simple patch. For testing only:



diff -du alsa-driver_orig/pci/echoaudio/echoaudio.c alsa-driver/pci/echoaudio/echoaudio.c
--- alsa-driver_orig/pci/echoaudio/echoaudio.c	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/echoaudio.c	Sat Jan 29 16:19:29 2005
@@ -522,6 +522,9 @@
 
 static int pcm_analog_in_hw_params(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *hw_params)
 {
+	echoaudio_t *chip;
+
+	chip = snd_pcm_substream_chip(substream);
 	return init_engine(substream, hw_params, PX_ANALOG_IN + substream->number, params_channels(hw_params));
 }
 
@@ -539,6 +542,9 @@
 
 static int pcm_digital_in_hw_params(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *hw_params)
 {
+	echoaudio_t *chip;
+
+	chip = snd_pcm_substream_chip(substream);
 	return init_engine(substream, hw_params, PX_DIGITAL_IN + substream->number, params_channels(hw_params));
 }
 
@@ -547,6 +553,9 @@
 #ifndef ECHOCARD_HAS_VMIXER	/* See the note in snd_echo_new_pcm() */
 static int pcm_digital_out_hw_params(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *hw_params)
 {
+	echoaudio_t *chip;
+
+	chip = snd_pcm_substream_chip(substream);
 	return init_engine(substream, hw_params, PX_DIGITAL_OUT + substream->number, params_channels(hw_params));
 }
 #endif /* !ECHOCARD_HAS_VMIXER */
@@ -1167,7 +1176,7 @@
 static snd_kcontrol_new_t snd_echo_monitor_mixer __devinitdata = {
 	.name = "Monitor Mixer Volume",
 	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
-	.count = NUM_BUSSES_IN * NUM_BUSSES_OUT,
+//	.count = NUM_BUSSES_IN * NUM_BUSSES_OUT,
 	.info = snd_echo_mixer_info,
 	.get = snd_echo_mixer_get,
 	.put = snd_echo_mixer_put,
@@ -1879,6 +1888,7 @@
 		goto ctl_error;
 
 #ifdef ECHOCARD_HAS_MONITOR
+	snd_echo_monitor_mixer.count = NUM_BUSSES_IN * NUM_BUSSES_OUT;
 	if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_echo_monitor_mixer, chip))) < 0)
 		goto ctl_error;
 #endif
@@ -1921,8 +1931,9 @@
 #endif
 
 #ifdef ECHOCARD_HAS_PHANTOM_POWER
-	if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_echo_phantom_power_switch, chip))) < 0)
-		goto ctl_error;
+	if (chip->has_phantom_power)
+		if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_echo_phantom_power_switch, chip))) < 0)
+			goto ctl_error;
 #endif
 
 	if ((err = snd_card_register(card)) < 0) {
diff -du alsa-driver_orig/pci/echoaudio/echoaudio.h alsa-driver/pci/echoaudio/echoaudio.h
--- alsa-driver_orig/pci/echoaudio/echoaudio.h	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/echoaudio.h	Sat Jan 29 16:14:33 2005
@@ -356,6 +356,7 @@
 	struct resource *iores;
 	struct snd_dma_buffer commpage_dma_buf;
 	int irq;
+	u8 px_digital_out, px_analog_in, px_digital_in, px_num;
 #ifdef ECHOCARD_HAS_MIDI
 	snd_rawmidi_t *rmidi;
 	snd_rawmidi_substream_t *midi_in, *midi_out;
@@ -376,6 +377,7 @@
 	u8 clock_state;				/* Gina20, Darla20, Darla24 - only */
 	u8 input_clock;				/* Currently selected sample clock source */
 	u8 output_clock;			/* Layla20 only */
+	u8 e3g_box_type;			/* The loaded fw supports this box type */
 
 	unsigned int meters_enabled : 1;	/* VU-meters status */
 	unsigned int asic_loaded : 1;		/* Set TRUE when ASIC loaded */
@@ -386,6 +388,7 @@
 	unsigned int phantom_power : 1;		/* Gina3G - only */
 	unsigned int has_midi : 1;
 	unsigned int midi_input_enabled : 1;
+	unsigned int has_phantom_power : 1;
 
 	char nominal_level[ECHO_MAXAUDIOPIPES];	/* True == -10dBV  False == +4dBu */
 	s8 input_gain[ECHO_MAXAUDIOINPUTS];	/* Input level -50..+50 unit is 0.5dB */
diff -du alsa-driver_orig/pci/echoaudio/echoaudio_3g.c alsa-driver/pci/echoaudio/echoaudio_3g.c
--- alsa-driver_orig/pci/echoaudio/echoaudio_3g.c	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/echoaudio_3g.c	Sat Jan 29 16:21:05 2005
@@ -31,7 +31,11 @@
 
 /* These functions are common for all "3G" cards */
 
-
+/* Check if the card is alive. Returns
+-Esomething	if it's not
+0		if it is working fine
+box_type+1	if it's ok, but we must replace the firmware
+*/
 static int check_asic_status(echoaudio_t *chip)
 {
 	u32 box_status;
@@ -58,10 +62,10 @@
 		return -ENODEV;
 	}
 
-	box_type = box_status & E3G_BOX_TYPE_MASK;
-	if (box_type != ECHOCARD_BOX) {
+	box_type = (box_status & E3G_BOX_TYPE_MASK) + 1;
+	if (box_type != chip->e3g_box_type) {
 		DE_INIT(("check_asic_status: wrong box type: %x\n", box_type));
-		return -ENODEV;
+		return box_type;
 	}
 
 	chip->asic_loaded = TRUE;
diff -du alsa-driver_orig/pci/echoaudio/echoaudio_dsp.c alsa-driver/pci/echoaudio/echoaudio_dsp.c
--- alsa-driver_orig/pci/echoaudio/echoaudio_dsp.c	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/echoaudio_dsp.c	Sat Jan 29 15:37:38 2005
@@ -545,8 +545,9 @@
 	if (err < 0)
 		return err;
 
-	/* Load the ASIC if the DSP load succeeded */
-	if ((err = load_asic(chip)) < 0)
+	/* Load the ASIC if the DSP load succeeded. >0 means it did not fail
+	but we cannot continue (eg. we loaded the wrong firmware) */
+	if ((err = load_asic(chip)) != 0)
 		return err;
 
 	return restore_dsp_rettings(chip);
diff -du alsa-driver_orig/pci/echoaudio/echoaudio_dsp.h alsa-driver/pci/echoaudio/echoaudio_dsp.h
--- alsa-driver_orig/pci/echoaudio/echoaudio_dsp.h	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/echoaudio_dsp.h	Sat Jan 29 15:37:38 2005
@@ -560,8 +560,8 @@
 #define E3G_FREQ_REG_MAX		0xffff
 
 // 3G external box types
-#define E3G_GINA3G			0x00
-#define E3G_LAYLA3G			0x10
+#define E3G_GINA3G_BOX_TYPE		0x00
+#define E3G_LAYLA3G_BOX_TYPE		0x10
 #define E3G_ASIC_NOT_LOADED		0xffff
 #define E3G_BOX_TYPE_MASK		0xf0
 
diff -du alsa-driver_orig/pci/echoaudio/gina3g.c alsa-driver/pci/echoaudio/gina3g.c
--- alsa-driver_orig/pci/echoaudio/gina3g.c	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/gina3g.c	Sat Jan 29 16:14:34 2005
@@ -18,7 +18,7 @@
 
 #define ECHO3G_FAMILY
 #define ECHOCARD_GINA3G
-#define ECHOCARD_NAME "Gina3G"
+#define ECHOCARD_NAME "Echo3G"
 #define ECHOCARD_HAS_MONITOR
 #define ECHOCARD_HAS_ASIC
 #define ECHOCARD_HAS_INPUT_NOMINAL_LEVEL
@@ -34,19 +34,18 @@
 #define ECHOCARD_BOX	E3G_GINA3G
 
 /* Pipe indexes */
-#define PX_ANALOG_OUT	0	/* 6 */
-#define PX_DIGITAL_OUT	6	/* 8 */
-#define PX_ANALOG_IN	14	/* 2 */
-#define PX_DIGITAL_IN	16	/* 8 */
-#define PX_NUM		24
+#define PX_ANALOG_OUT	0
+#define PX_DIGITAL_OUT	(chip->px_digital_out)
+#define PX_ANALOG_IN	(chip->px_analog_in)
+#define PX_DIGITAL_IN	(chip->px_digital_in)
+#define PX_NUM		(chip->px_num)
 
 /* Bus indexes */
-#define BX_ANALOG_OUT	0	/* 6 */
-#define BX_DIGITAL_OUT	6	/* 8 */
-#define BX_ANALOG_IN	14	/* 2 */
-#define BX_DIGITAL_IN	16	/* 8 */
-#define BX_NUM		24
-
+#define BX_ANALOG_OUT	PX_ANALOG_OUT
+#define BX_DIGITAL_OUT	PX_DIGITAL_OUT
+#define BX_ANALOG_IN	PX_ANALOG_IN
+#define BX_DIGITAL_IN	PX_DIGITAL_IN
+#define BX_NUM		PX_NUM
 
 /* Number of channels */
 #define NUM_PIPES		PX_NUM
@@ -82,11 +81,13 @@
 
 #define FW_361_LOADER	0
 #define FW_GINA3G_DSP	1
-#define FW_3G_ASIC	2
+#define FW_ECHO3G_DSP	2
+#define FW_3G_ASIC	3
 
 static const struct firmware card_fw[] = {
 	{0, "loader_dsp.fw"},
 	{0, "gina3g_dsp.fw"},
+	{0, "echo3g_dsp.fw"},
 	{0, "3g_asic.fw"}
 };
 
diff -du alsa-driver_orig/pci/echoaudio/gina3g_dsp.c alsa-driver/pci/echoaudio/gina3g_dsp.c
--- alsa-driver_orig/pci/echoaudio/gina3g_dsp.c	Sat Jan 29 16:31:53 2005
+++ alsa-driver/pci/echoaudio/gina3g_dsp.c	Sat Jan 29 16:23:01 2005
@@ -57,20 +57,52 @@
 	chip->subdevice_id = subdevice_id;
 	chip->bad_board = TRUE;
 	chip->has_midi = TRUE;
-	chip->dsp_code_to_load = &card_fw[FW_GINA3G_DSP];
+	chip->dsp_code_to_load = &card_fw[FW_ECHO3G_DSP];
 	chip->input_clock_types =	ECHO_CLOCK_BIT_INTERNAL |
 					ECHO_CLOCK_BIT_SPDIF |
-					ECHO_CLOCK_BIT_ADAT;
+					ECHO_CLOCK_BIT_ADAT |
+					ECHO_CLOCK_BIT_WORD;
 	chip->digital_modes =	ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA |
 				ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL |
 				ECHOCAPS_HAS_DIGITAL_MODE_ADAT;
+	chip->e3g_box_type = E3G_LAYLA3G_BOX_TYPE + 1;
+	chip->px_digital_out = 8;
+	chip->px_analog_in = 16;
+	chip->px_digital_in = 24;
+	chip->px_num = 32;
+	chip->has_phantom_power = 1;
 	chip->digital_mode = DIGITAL_MODE_SPDIF_RCA;
 	chip->professional_spdif = FALSE;
 	chip->non_audio_spdif = FALSE;
 
 	/* Load the DSP and the ASIC on the PCI card */
-	if ((err = load_firmware(chip)) < 0)
-		return err;
+	err = load_firmware(chip);
+
+	if (err < 0) {
+		return err;		/* Something went wrong */
+	} else if (err == E3G_GINA3G_BOX_TYPE + 1) {
+		/* The card was initialized successfully, but we loaded the
+		wrong firmware because this is not a Layla3G. Let's load
+		the right one. */
+
+		chip->dsp_code_to_load = &card_fw[FW_GINA3G_DSP];
+		chip->input_clock_types =	ECHO_CLOCK_BIT_INTERNAL |
+						ECHO_CLOCK_BIT_SPDIF |
+						ECHO_CLOCK_BIT_ADAT;
+		chip->e3g_box_type = E3G_GINA3G_BOX_TYPE + 1;
+		chip->px_digital_out = 6;
+		chip->px_analog_in = 14;
+		chip->px_digital_in = 16;
+		chip->px_num = 24;
+		chip->has_phantom_power = 0;
+
+		/* Re-load the DSP and the ASIC codes */
+		chip->dsp_code = 0;
+		if ((err = load_firmware(chip))
+			return err;		/* Something went wrong */
+	} else if (err > 0) {
+		return -ENODEV;			/* Unknown external box */
+	}
 
 	chip->bad_board = FALSE;
 



--
Giuliano.


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

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

end of thread, other threads:[~2005-01-29 15:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-22 10:37 Error: firmware not found Giuliano Pochini
2005-01-23  2:37 ` Fernando Lopez-Lezcano
2005-01-24  8:41   ` Giuliano Pochini
2005-01-24 10:06   ` Takashi Iwai
2005-01-24 21:55     ` Fernando Lopez-Lezcano
2005-01-24 11:43 ` Thierry Vignaud
2005-01-24 11:44   ` Thierry Vignaud
2005-01-25  8:15     ` Giuliano Pochini
2005-01-25  8:22   ` Giuliano Pochini
2005-01-24 11:52 ` Thierry Vignaud
2005-01-25  8:32   ` Giuliano Pochini
2005-01-25 13:19     ` Thierry Vignaud
2005-01-25 13:57       ` Giuliano Pochini
2005-01-25 15:06     ` Takashi Iwai
2005-01-25 15:35       ` Giuliano Pochini
2005-01-25 15:39         ` Takashi Iwai
2005-01-26 17:29           ` Giuliano Pochini
2005-01-27 10:10             ` Takashi Iwai
2005-01-28 16:34               ` Giuliano Pochini
2005-01-28 16:41                 ` Thierry Vignaud
2005-01-28 16:43                   ` Giuliano Pochini
2005-01-29 15:46                   ` Giuliano Pochini

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.