[alsa-devel] snd-powermac
I'm about to send the following to alsa-user mailing list:
I've been trying to fix ALSA support for older PowerMacs. Anyone experiencing problems - like missing or inoperative or wrongly directed controls in alsamixer - could you, please, test my patch and write the results into this list or directly to me?
If you are still with me, check first with lsmod that you are using snd-powermac: $ lsmod | grep ^snd.powermac snd_powermac 56576 0 $
Then you will need to install make, C-compiler and kernel headers corresponding to your running kernel, f.ex (Ubuntu Dapper 6.06.1): $ sudo aptitude install make gcc linux-headers-2.6.15-26-powerpc
and fetch the ALSA driver source code and my patch: $ wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.16.tar.bz2 $ wget http://ristosu.wippiespace.com/pub/alsa-driver-1.0.16-p4.diff
Unpack the source and apply the patch: $ tar xjf alsa-driver-1.0.16.tar.bz2 $ cd alsa-driver-1.0.16 $ patch -p0 < ../alsa-driver-1.0.16-p4.diff
Finally configure: $ ./configure --disable-verbose-printk --with-kernel=/usr/src/linux-headers-2.6.15-26-powerpc --with-build=/usr/src/linux-headers-2.6.15-26-powerpc --with-moddir=/lib/modules/2.6.15-26-powerpc/updates/sound --with-isapnp=no --with-oss=yes --with-pcm-oss-plugins=yes --with-cards=powermac
make and install: $ make $ sudo make install-modules
To load the new modules without rebooting: $ sudo modprobe -r snd-powermac $ sudo modprobe -r snd-pcm-oss $ sudo modprobe snd-powermac
Risto
I'm experiencing an unpleasant situation when trying to test my patches (for ALSA 1.0.16) with kernel 2.6.15. The snd-powermac module cannot be unloaded. Or can, but after that the computer stops responding before it can be shut down. A visible symptom of the problem is two kernel messages:
Trying to free free IRQ17 Trying to free free IRQ9
The oddest is that the third, IRQ8, that is freed between the other two, is ok. They are allocated and freed in the same order and manner in alsa-kernel/ppc/pmac.c.
I had to do following patches to compile and load the module, maybe the first one causes this, the second one is just to disable the TOONIE case as the chip is moved out of the driver:
--- alsa-kernel/ppc/pmac.h.orig 2008-02-05 11:23:24.000000000 +0200 +++ alsa-kernel/ppc/pmac.h 2008-03-31 23:45:36.000000000 +0300 @@ -207,4 +207,11 @@
int snd_pmac_add_automute(struct snd_pmac *chip);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) +#define of_device_is_compatible(dev, s) device_is_compatible(dev, s) +#define input_get_drvdata(dev) (dev->private) +#define i2c_smbus_write_i2c_block_data(client, cmd, len, vals) \ + i2c_smbus_write_block_data(client, cmd, len, vals) +#endif + #endif /* __PMAC_H */ --- ppc/pmac_old.c.orig 2008-02-05 11:23:23.000000000 +0200 +++ ppc/pmac_old.c 2008-03-31 19:35:58.000000000 +0300 @@ -997,12 +1003,14 @@ chip->can_byte_swap = 0; /* FIXME: check this */ chip->control_mask = MASK_IEPC | 0x11;/* disable IEE */ break; +#ifdef SND_POWERMAC_SUPPORT_TOONIE case 0x3a: chip->num_freqs = ARRAY_SIZE(tumbler_freqs); chip->model = PMAC_TOONIE; chip->can_byte_swap = 0; /* FIXME: check this */ chip->control_mask = MASK_IEPC | 0x11;/* disable IEE */ break; +#endif } } prop = (unsigned int *)get_property(sound, "device-id", NULL);
2008/4/1, Risto Suominen risto.suominen@gmail.com:
They are allocated and freed in the same order and manner in alsa-kernel/ppc/pmac.c.
Actually, in this case, the file in question is ppc/pmac_old.c, and they are allocated in function snd_pmac_new and freed in snd_pmac_free.
Risto
Found a solution for the interrupt problem with kernel 2.6.15: manually edited in include/config.h from:
/* #undef CONFIG_SND_NEW_IRQ_HANDLER */
to:
#define CONFIG_SND_NEW_IRQ_HANDLER 1
Maybe I should submit a bug report in ALSA 1.0.16...
participants (1)
-
Risto Suominen