Error: firmware not found
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
Quoted 11 lines · Giuliano Pochini
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.agentsets 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.
Quoted 8 lines
- Some distros that originally shipped with linux 2.4 (like my YDL3.0) do not set
/proc/sys/kernel/hotplugand .../modprobe because rc.sysinit looks for/proc/ksymsthat 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
Quoted 8 lines · On 23-Jan-2005 Fernando Lopez-Lezcano wrote:
Quoted 4 lines
- 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
At 22 Jan 2005 18:37:36 -0800,
Quoted 11 lines · Fernando Lopez-Lezcano
Quoted 9 lines · Giuliano Pochini
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):
Quoted 7 lines
Quoted 2 lines
-
/etc/hotplug/firmware.agentsets 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
Quoted 16 lines · Takashi Iwai
At 22 Jan 2005 18:37:36 -0800,
Quoted 14 lines · Fernando Lopez-Lezcano
Quoted 11 lines · Giuliano Pochini
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.agentsets FIRMWARE_DIR=/lib/firmware, but alsa-firmware install the files in/usr/lib/hotplug/firmware.
Quoted 8 lines
Quoted 4 lines
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
Quoted 8 lines · Giuliano Pochini
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):
(...)
Quoted 2 lines
-
/etc/hotplug/firmware.agentsets 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
Quoted 3 lines
- Some distros that originally shipped with linux 2.4 (like my YDL3.0) do not set
/proc/sys/kernel/hotplugand .../modprobe because rc.sysinit looks for/proc/ksymsthat doesn't exists with linux 2.6.
distro bug, please reports to them
Quoted 5 lines
- 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
Quoted 7 lines · Thierry Vignaud
Quoted 5 lines
- 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 2005-01-24 12:41:19.903578455 +0100 renamed from etc/hotplug/pci.agent.tv3 2005-01-24 12:41:00.610030503 +0100 +0 -1
@@ -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
Quoted 7 lines · On 24-Jan-2005 Thierry Vignaud wrote:
Quoted 1 line
is this the only change you had to do?
eg:
etc/hotplug/pci.agent 2005-01-24 12:41:19.903578455 +0100 line 122
Quoted 7 lines
etc/hotplug/pci.agent 2005-01-24 12:41:19.903578455 +0100 renamed from etc/hotplug/pci.agent.tv3 2005-01-24 12:41:00.610030503 +0100 +0
-1@@ -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
Quoted 5 lines · On 24-Jan-2005 Thierry Vignaud wrote:
Quoted 3 lines
- Some distros that originally shipped with linux 2.4 (like my YDL3.0) do not set
/proc/sys/kernel/hotplugand .../modprobe because rc.sysinit looks for/proc/ksymsthat 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.
Quoted 7 lines
Quoted 5 lines
- 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
Quoted 2 lines · Giuliano Pochini
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
Quoted 7 lines · On 24-Jan-2005 Thierry Vignaud wrote:
Quoted 2 lines · Giuliano Pochini
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.
Quoted 1 line
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
Quoted 7 lines · Giuliano Pochini
Quoted 6 lines
Quoted 3 lines
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 ?
Quoted 8 lines
Yes.
Quoted 1 line
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
Quoted 8 lines · On 25-Jan-2005 Thierry Vignaud wrote:
Quoted 4 lines
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.
Quoted 2 lines
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.
Quoted 3 lines
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
At Tue, 25 Jan 2005 09:32:27 +0100 (CET),
Quoted 14 lines · Giuliano Pochini
Quoted 7 lines · On 24-Jan-2005 Thierry Vignaud wrote:
Quoted 2 lines · Giuliano Pochini
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.
Quoted 6 lines
Quoted 1 line
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
Quoted 8 lines · Takashi Iwai
Quoted 4 lines
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
At Tue, 25 Jan 2005 16:35:46 +0100 (CET),
Quoted 22 lines · Giuliano Pochini
Quoted 8 lines · Takashi Iwai
Quoted 4 lines
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
Quoted 8 lines
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
Quoted 7 lines · On 25-Jan-2005 Takashi Iwai wrote:
Quoted 6 lines
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.
Quoted 5 lines
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
At Wed, 26 Jan 2005 18:29:42 +0100 (CET),
Quoted 14 lines · Giuliano Pochini
Quoted 10 lines · On 25-Jan-2005 Takashi Iwai wrote:
Quoted 6 lines
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.
Quoted 7 lines
Quoted 2 lines
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.
Quoted 3 lines
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
Quoted 10 lines · Takashi Iwai
Quoted 4 lines
*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.
Quoted 2 lines
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.
Quoted 6 lines
Quoted 2 lines
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
Quoted 5 lines · Giuliano Pochini
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
Quoted 7 lines · Thierry Vignaud
Quoted 5 lines
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
Quoted 9 lines · On Fri, 28 Jan 2005 17:41:55 +0100 Thierry Vignaud <[email protected]>…
Quoted 5 lines · Giuliano Pochini
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:
pci/echoaudio/echoaudio.c +14 -3
@@ -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 ) {
pci/echoaudio/echoaudio.h +3 -0
@@ -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 */
pci/echoaudio/echoaudio_3g.c +8 -4
@@ -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;
pci/echoaudio/echoaudio_dsp.c +3 -2
@@ -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);
pci/echoaudio/echoaudio_dsp.h +2 -2
@@ -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
pci/echoaudio/gina3g.c +14 -13
@@ -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 3static const struct firmware card_fw[] = { {0 ,"loader_dsp.fw" }, {0 ,"gina3g_dsp.fw" }, + {0 ,"echo3g_dsp.fw" }, {0 ,"3g_asic.fw" } };
pci/echoaudio/gina3g_dsp.c +36 -4
@@ -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