* au88x0 Init before create components
@ 2006-04-26 13:14 Alan Horstmann
2006-04-26 15:05 ` Takashi Iwai
2006-04-26 18:24 ` Manuel Jander
0 siblings, 2 replies; 9+ messages in thread
From: Alan Horstmann @ 2006-04-26 13:14 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, mjander
[-- Attachment #1: Type: text/plain, Size: 523 bytes --]
Patch as suggested by Raymond in one of his copious bug-track notes.
Change the order in vortex_probe to init the card details before creating the
components, meaning for example that card->shortname is available when
registering the midi port.
I have also added extra to card->shortname, and a line to overwrite the midi
name following snd_mpu401_uart_new, for consideration.
Do I have the correct address to cc mjander?
au88x0-init-before-comps-et-al.patch
Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
[-- Attachment #2: au88x0-init-before-comps-et-al.patch --]
[-- Type: text/x-diff, Size: 2488 bytes --]
diff -ru alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c
--- alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c 2006-01-13 17:16:29.000000000 +0000
+++ alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c 2006-04-24 08:12:16.000000000 +0100
@@ -261,7 +261,28 @@
return err;
}
snd_vortex_workaround(pci, pcifix[dev]);
- // (4) Alloc components.
+ // (4)
+ strcpy(card->driver, CARD_NAME_SHORT);
+ sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
+ sprintf(card->longname, "%s at 0x%lx irq %i",
+ card->shortname, chip->io, chip->irq);
+
+ if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
+ &(chip->device))) < 0) {
+ snd_card_free(card);
+ return err;
+ }
+ if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
+ &(chip->vendor))) < 0) {
+ snd_card_free(card);
+ return err;
+ }
+ if ((err = pci_read_config_byte(pci, PCI_REVISION_ID,
+ &(chip->rev))) < 0) {
+ snd_card_free(card);
+ return err;
+ }
+ // (5) Alloc components.
// ADB pcm.
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
snd_card_free(card);
@@ -322,27 +343,6 @@
}
#endif
- // (5)
- strcpy(card->driver, CARD_NAME_SHORT);
- strcpy(card->shortname, CARD_NAME_SHORT);
- sprintf(card->longname, "%s at 0x%lx irq %i",
- card->shortname, chip->io, chip->irq);
-
- if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
- &(chip->device))) < 0) {
- snd_card_free(card);
- return err;
- }
- if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
- &(chip->vendor))) < 0) {
- snd_card_free(card);
- return err;
- }
- if ((err = pci_read_config_byte(pci, PCI_REVISION_ID,
- &(chip->rev))) < 0) {
- snd_card_free(card);
- return err;
- }
#ifdef CHIP_AU8830
if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) {
printk(KERN_ALERT
diff -ru alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c
--- alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c 2006-01-13 17:16:29.000000000 +0000
+++ alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c 2006-04-24 07:57:51.000000000 +0100
@@ -107,6 +107,9 @@
mpu = rmidi->private_data;
mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD);
#endif
+ /* Overwrite MIDI name */
+ snprintf(rmidi->name, sizeof(rmidi->name), "MIDI %s %d", CARD_NAME_SHORT , vortex->card->number);
+
vortex->rmidi = rmidi;
return 0;
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: au88x0 Init before create components
2006-04-26 13:14 au88x0 Init before create components Alan Horstmann
@ 2006-04-26 15:05 ` Takashi Iwai
2006-04-26 20:00 ` Alan Horstmann
2006-05-01 21:17 ` Alan Horstmann
2006-04-26 18:24 ` Manuel Jander
1 sibling, 2 replies; 9+ messages in thread
From: Takashi Iwai @ 2006-04-26 15:05 UTC (permalink / raw)
To: Alan Horstmann; +Cc: alsa-devel, mjander
At Wed, 26 Apr 2006 14:14:52 +0100,
Alan Horstmann wrote:
>
> Patch as suggested by Raymond in one of his copious bug-track notes.
>
> Change the order in vortex_probe to init the card details before creating the
> components, meaning for example that card->shortname is available when
> registering the midi port.
The detection of vendor, device and rev is irrelevant with the
definition of driver, shortname and longname.
Looking at the code a bit carefully, we can find that chip->vendor and
chip->device are not really used in the code. The only referring part
is IS_BAD_CHIP() macro in au88x0.h, and it's used nowhere. Moreover,
the values are identical with pci->device and pci->vendor.
So, basically we can remove these fields. But it's another story.
Anyway, I'd suggest to move the definition of driver, shortname and
longname there with a short comment that it's needed for mpu401
instance, and keep the rest as it is.
Also, I feel "Aureal au8810 MIDI 0" is more intuitive than
"MIDI Aureal au8810 0". It's a matter of taste, though...
Thanks,
Takashi
>
> I have also added extra to card->shortname, and a line to overwrite the midi
> name following snd_mpu401_uart_new, for consideration.
>
> Do I have the correct address to cc mjander?
>
> au88x0-init-before-comps-et-al.patch
>
> Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
> [2 au88x0-init-before-comps-et-al.patch <text/x-diff; us-ascii (7bit)>]
> diff -ru alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c
> --- alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c 2006-01-13 17:16:29.000000000 +0000
> +++ alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c 2006-04-24 08:12:16.000000000 +0100
> @@ -261,7 +261,28 @@
> return err;
> }
> snd_vortex_workaround(pci, pcifix[dev]);
> - // (4) Alloc components.
> + // (4)
> + strcpy(card->driver, CARD_NAME_SHORT);
> + sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
> + sprintf(card->longname, "%s at 0x%lx irq %i",
> + card->shortname, chip->io, chip->irq);
> +
> + if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
> + &(chip->device))) < 0) {
> + snd_card_free(card);
> + return err;
> + }
> + if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
> + &(chip->vendor))) < 0) {
> + snd_card_free(card);
> + return err;
> + }
> + if ((err = pci_read_config_byte(pci, PCI_REVISION_ID,
> + &(chip->rev))) < 0) {
> + snd_card_free(card);
> + return err;
> + }
> + // (5) Alloc components.
> // ADB pcm.
> if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
> snd_card_free(card);
> @@ -322,27 +343,6 @@
> }
> #endif
>
> - // (5)
> - strcpy(card->driver, CARD_NAME_SHORT);
> - strcpy(card->shortname, CARD_NAME_SHORT);
> - sprintf(card->longname, "%s at 0x%lx irq %i",
> - card->shortname, chip->io, chip->irq);
> -
> - if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
> - &(chip->device))) < 0) {
> - snd_card_free(card);
> - return err;
> - }
> - if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
> - &(chip->vendor))) < 0) {
> - snd_card_free(card);
> - return err;
> - }
> - if ((err = pci_read_config_byte(pci, PCI_REVISION_ID,
> - &(chip->rev))) < 0) {
> - snd_card_free(card);
> - return err;
> - }
> #ifdef CHIP_AU8830
> if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) {
> printk(KERN_ALERT
> diff -ru alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c
> --- alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c 2006-01-13 17:16:29.000000000 +0000
> +++ alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c 2006-04-24 07:57:51.000000000 +0100
> @@ -107,6 +107,9 @@
> mpu = rmidi->private_data;
> mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD);
> #endif
> + /* Overwrite MIDI name */
> + snprintf(rmidi->name, sizeof(rmidi->name), "MIDI %s %d", CARD_NAME_SHORT , vortex->card->number);
> +
> vortex->rmidi = rmidi;
> return 0;
> }
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: au88x0 Init before create components
2006-04-26 13:14 au88x0 Init before create components Alan Horstmann
2006-04-26 15:05 ` Takashi Iwai
@ 2006-04-26 18:24 ` Manuel Jander
1 sibling, 0 replies; 9+ messages in thread
From: Manuel Jander @ 2006-04-26 18:24 UTC (permalink / raw)
To: Alan Horstmann; +Cc: Takashi Iwai, alsa-devel
Hi,
This is my current and hopefuly "for ever" email address.
(hmm, hopefuly no spammer gets this one: _manuel_._jander_|@_gmail|.|
com) (remove _ and | characters).
My address at embedded.cl no longer exists. A am very pleased about that
someone is posting patches to the au88x0 drivers :)
By the way I'm living in Erlangen now, far close to the ALSA guys in
Nürnberg.
Best Regards,
Manuel Jander
On Wed, 2006-04-26 at 14:14 +0100, Alan Horstmann wrote:
> Patch as suggested by Raymond in one of his copious bug-track notes.
>
> Change the order in vortex_probe to init the card details before creating the
> components, meaning for example that card->shortname is available when
> registering the midi port.
>
> I have also added extra to card->shortname, and a line to overwrite the midi
> name following snd_mpu401_uart_new, for consideration.
>
> Do I have the correct address to cc mjander?
>
> au88x0-init-before-comps-et-al.patch
>
> Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: au88x0 Init before create components
2006-04-26 15:05 ` Takashi Iwai
@ 2006-04-26 20:00 ` Alan Horstmann
2006-04-27 9:52 ` Takashi Iwai
2006-05-01 21:17 ` Alan Horstmann
1 sibling, 1 reply; 9+ messages in thread
From: Alan Horstmann @ 2006-04-26 20:00 UTC (permalink / raw)
To: alsa-devel
> At Wed, 26 Apr 2006 14:14:52 +0100,
>
> Alan Horstmann wrote:
> > I have also added extra to card->shortname, and a line to overwrite the
> > midi name following snd_mpu401_uart_new, for consideration.
Raymond wrote:
> Refer to au88x0-init-before-comps-et-al.patch,
> You should not change the card->shortname
> THis shortname is used to access the /usr/share/alsa/conf/AU88X0.conf
Or is it card->driver that accesses .conf files? Other cards operate with
shortnames different from .conf file name. (And of course it works fine in
my tests)
Alan
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: au88x0 Init before create components
2006-04-26 20:00 ` Alan Horstmann
@ 2006-04-27 9:52 ` Takashi Iwai
0 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2006-04-27 9:52 UTC (permalink / raw)
To: Alan Horstmann; +Cc: alsa-devel
At Wed, 26 Apr 2006 21:00:58 +0100,
Alan Horstmann wrote:
>
> > At Wed, 26 Apr 2006 14:14:52 +0100,
> >
> > Alan Horstmann wrote:
> > > I have also added extra to card->shortname, and a line to overwrite the
> > > midi name following snd_mpu401_uart_new, for consideration.
>
> Raymond wrote:
>
> > Refer to au88x0-init-before-comps-et-al.patch,
> > You should not change the card->shortname
> > THis shortname is used to access the /usr/share/alsa/conf/AU88X0.conf
>
> Or is it card->driver that accesses .conf files? Other cards operate with
> shortnames different from .conf file name. (And of course it works fine in
> my tests)
Yes, it is card->driver. shortname isn't referred from the config
file. The change of shortname is safe (so far).
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: au88x0 Init before create components
2006-04-26 15:05 ` Takashi Iwai
2006-04-26 20:00 ` Alan Horstmann
@ 2006-05-01 21:17 ` Alan Horstmann
2006-05-03 12:11 ` Takashi Iwai
1 sibling, 1 reply; 9+ messages in thread
From: Alan Horstmann @ 2006-05-01 21:17 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, manuel.jander
[-- Attachment #1: Type: text/plain, Size: 776 bytes --]
On Wednesday 26 April 2006 16:05, you wrote:
>
> Anyway, I'd suggest to move the definition of driver, shortname and
> longname there with a short comment that it's needed for mpu401
> instance, and keep the rest as it is.
>
> Also, I feel "Aureal au8810 MIDI 0" is more intuitive than
> "MIDI Aureal au8810 0". It's a matter of taste, though...
Reduced patch is attached
Regards Alan
Change the order in vortex_probe to set the card details before creating the
components, meaning for example that card->shortname is available when
registering the midi port.
I have also added extra to card->shortname, and a line to overwrite the midi
name following snd_mpu401_uart_new.
au88x0-card-details-midi-name.patch
Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
[-- Attachment #2: au88x0-card-details-midi-name.patch --]
[-- Type: text/x-diff, Size: 1708 bytes --]
diff -ru alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c
--- alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c 2006-01-13 17:16:29.000000000 +0000
+++ alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0.c 2006-04-24 08:12:16.000000000 +0100
@@ -261,6 +261,13 @@
return err;
}
snd_vortex_workaround(pci, pcifix[dev]);
+
+ // Card details needed in snd_vortex_midi
+ strcpy(card->driver, CARD_NAME_SHORT);
+ sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
+ sprintf(card->longname, "%s at 0x%lx irq %i",
+ card->shortname, chip->io, chip->irq);
+
// (4) Alloc components.
// ADB pcm.
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
@@ -323,11 +330,6 @@
#endif
// (5)
- strcpy(card->driver, CARD_NAME_SHORT);
- strcpy(card->shortname, CARD_NAME_SHORT);
- sprintf(card->longname, "%s at 0x%lx irq %i",
- card->shortname, chip->io, chip->irq);
-
if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
&(chip->device))) < 0) {
snd_card_free(card);
diff -ru alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c
--- alsa-driver-orig-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c 2006-01-13 17:16:29.000000000 +0000
+++ alsa-driver-1.0.11rc3/alsa-kernel/pci/au88x0/au88x0_mpu401.c 2006-04-24 07:57:51.000000000 +0100
@@ -107,6 +107,9 @@
mpu = rmidi->private_data;
mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD);
#endif
+ /* Overwrite MIDI name */
+ snprintf(rmidi->name, sizeof(rmidi->name), "%s MIDI %d", CARD_NAME_SHORT , vortex->card->number);
+
vortex->rmidi = rmidi;
return 0;
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: au88x0 Init before create components
2006-05-01 21:17 ` Alan Horstmann
@ 2006-05-03 12:11 ` Takashi Iwai
2006-05-03 14:55 ` Alan Horstmann
0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2006-05-03 12:11 UTC (permalink / raw)
To: Alan Horstmann; +Cc: alsa-devel, manuel.jander
At Mon, 1 May 2006 22:17:48 +0100,
Alan Horstmann wrote:
>
> [1 <text/plain; iso-8859-1 (7bit)>]
> On Wednesday 26 April 2006 16:05, you wrote:
> >
> > Anyway, I'd suggest to move the definition of driver, shortname and
> > longname there with a short comment that it's needed for mpu401
> > instance, and keep the rest as it is.
> >
> > Also, I feel "Aureal au8810 MIDI 0" is more intuitive than
> > "MIDI Aureal au8810 0". It's a matter of taste, though...
>
> Reduced patch is attached
Thanks.
I think it's better to remove the card number from the shortname
field. You can add it at copying to rmidi->name, instead.
If you have no objection, I'll change and commit it.
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: au88x0 Init before create components
2006-05-03 12:11 ` Takashi Iwai
@ 2006-05-03 14:55 ` Alan Horstmann
2006-05-03 15:03 ` Takashi Iwai
0 siblings, 1 reply; 9+ messages in thread
From: Alan Horstmann @ 2006-05-03 14:55 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, manuel.jander
On Wednesday 03 May 2006 13:11, you wrote:
> At Mon, 1 May 2006 22:17:48 +0100,
>
> Alan Horstmann wrote:
> >
> > Reduced patch is attached
>
> I think it's better to remove the card number from the shortname
> field. You can add it at copying to rmidi->name, instead.
That is what the patch does -card number isn't added to shortname, but just
rmidi->name.
Alan
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Re: au88x0 Init before create components
2006-05-03 14:55 ` Alan Horstmann
@ 2006-05-03 15:03 ` Takashi Iwai
0 siblings, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2006-05-03 15:03 UTC (permalink / raw)
To: Alan Horstmann; +Cc: alsa-devel, manuel.jander
At Wed, 3 May 2006 15:55:57 +0100,
Alan Horstmann wrote:
>
> On Wednesday 03 May 2006 13:11, you wrote:
> > At Mon, 1 May 2006 22:17:48 +0100,
> >
> > Alan Horstmann wrote:
> > >
> > > Reduced patch is attached
> >
> > I think it's better to remove the card number from the shortname
> > field. You can add it at copying to rmidi->name, instead.
>
> That is what the patch does -card number isn't added to shortname, but just
> rmidi->name.
Ah OK, then it's fine.
thanks,
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-05-03 15:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 13:14 au88x0 Init before create components Alan Horstmann
2006-04-26 15:05 ` Takashi Iwai
2006-04-26 20:00 ` Alan Horstmann
2006-04-27 9:52 ` Takashi Iwai
2006-05-01 21:17 ` Alan Horstmann
2006-05-03 12:11 ` Takashi Iwai
2006-05-03 14:55 ` Alan Horstmann
2006-05-03 15:03 ` Takashi Iwai
2006-04-26 18:24 ` Manuel Jander
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.