All of lore.kernel.org
 help / color / mirror / Atom feed
* Burgundy Auto-Mute problem
@ 2003-07-17  9:08 ` Ernst Persson
  0 siblings, 0 replies; 6+ messages in thread
From: Ernst Persson @ 2003-07-17  9:08 UTC (permalink / raw)
  To: alsa-devel, linuxppc-dev

Hi all!

Now that the 2.6.0 kernel is out I'm trying to get ALSA working on my iMac 
266, since it's the default sound system now (and dmasound doesn't compile).

The first problem was that everything locked up when the ALSA drivers loaded.
No error message, no kernel panic, just dead. And compiling ALSA with debug
didn't help either.

After some debugging I found out that the driver crashed here, in
sound/ppc/burgundy.c    in   int __init snd_pmac_burgundy_init(pmac_t *chip)

#ifdef PMAC_SUPPORT_AUTOMUTE

	printk(KERN_INFO "Automute Enabled.\n");

	if ((err = snd_pmac_add_automute(chip)) < 0)
		return err;

	chip->detect_headphone = snd_pmac_burgundy_detect_headphone;
	chip->update_automute = snd_pmac_burgundy_update_automute;
	snd_pmac_burgundy_update_automute(chip, 0); /* update the status only */
#endif
So I commented out //#define PMAC_SUPPORT_AUTOMUTE in pmac.h and after that
the driver loaded without problems.

But as soon as I touch any mixer (both the oss-emulated or with alsamixer)
everything locks up again, in exactly the same way.

Any clues?

regards
//ernie



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

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

* Burgundy Auto-Mute problem
@ 2003-07-17  9:08 ` Ernst Persson
  0 siblings, 0 replies; 6+ messages in thread
From: Ernst Persson @ 2003-07-17  9:08 UTC (permalink / raw)
  To: alsa-devel, linuxppc-dev


Hi all!

Now that the 2.6.0 kernel is out I'm trying to get ALSA working on my iMac
266, since it's the default sound system now (and dmasound doesn't compile).

The first problem was that everything locked up when the ALSA drivers loaded.
No error message, no kernel panic, just dead. And compiling ALSA with debug
didn't help either.

After some debugging I found out that the driver crashed here, in
sound/ppc/burgundy.c    in   int __init snd_pmac_burgundy_init(pmac_t *chip)

#ifdef PMAC_SUPPORT_AUTOMUTE

	printk(KERN_INFO "Automute Enabled.\n");

	if ((err = snd_pmac_add_automute(chip)) < 0)
		return err;

	chip->detect_headphone = snd_pmac_burgundy_detect_headphone;
	chip->update_automute = snd_pmac_burgundy_update_automute;
	snd_pmac_burgundy_update_automute(chip, 0); /* update the status only */
#endif
So I commented out //#define PMAC_SUPPORT_AUTOMUTE in pmac.h and after that
the driver loaded without problems.

But as soon as I touch any mixer (both the oss-emulated or with alsamixer)
everything locks up again, in exactly the same way.

Any clues?

regards
//ernie


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: Burgundy Auto-Mute problem
  2003-07-17  9:08 ` Ernst Persson
@ 2003-07-17 10:11   ` Takashi Iwai
  -1 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2003-07-17 10:11 UTC (permalink / raw)
  To: Ernst Persson; +Cc: alsa-devel, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

At Thu, 17 Jul 2003 11:08:03 +0200,
Ernst Persson wrote:
> 
> Hi all!
> 
> Now that the 2.6.0 kernel is out I'm trying to get ALSA working on my iMac 
> 266, since it's the default sound system now (and dmasound doesn't compile).
> 
> The first problem was that everything locked up when the ALSA drivers loaded.
> No error message, no kernel panic, just dead. And compiling ALSA with debug
> didn't help either.
> 
> After some debugging I found out that the driver crashed here, in
> sound/ppc/burgundy.c    in   int __init snd_pmac_burgundy_init(pmac_t *chip)
> 
> #ifdef PMAC_SUPPORT_AUTOMUTE
> 
> 	printk(KERN_INFO "Automute Enabled.\n");
> 
> 	if ((err = snd_pmac_add_automute(chip)) < 0)
> 		return err;
> 
> 	chip->detect_headphone = snd_pmac_burgundy_detect_headphone;
> 	chip->update_automute = snd_pmac_burgundy_update_automute;
> 	snd_pmac_burgundy_update_automute(chip, 0); /* update the status only */
> #endif
> So I commented out //#define PMAC_SUPPORT_AUTOMUTE in pmac.h and after that
> the driver loaded without problems.
> 
> But as soon as I touch any mixer (both the oss-emulated or with alsamixer)
> everything locks up again, in exactly the same way.

it seems that extend extend_wait() function waits for an infinite
loop.  could you try the attached patch?


Takashi

[-- Attachment #2: burgundy-fix.dif --]
[-- Type: application/octet-stream, Size: 1657 bytes --]

Index: alsa-kernel/ppc/burgundy.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/ppc/burgundy.c,v
retrieving revision 1.9
diff -u -r1.9 burgundy.c
--- alsa-kernel/ppc/burgundy.c	16 Aug 2002 15:05:05 -0000	1.9
+++ alsa-kernel/ppc/burgundy.c	17 Jul 2003 10:11:07 -0000
@@ -34,17 +34,27 @@
 inline static void
 snd_pmac_burgundy_busy_wait(pmac_t *chip)
 {
-	while (in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD)
-		;
+	int timeout = 50;
+	while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--)
+		udelay(1);
+	if (! timeout)
+		printk(KERN_DEBUG "burgundy_busy_wait: timeout\n");
 }
 
 inline static void
 snd_pmac_burgundy_extend_wait(pmac_t *chip)
 {
-	while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND))
-		;
-	while (in_le32(&chip->awacs->codec_stat) & MASK_EXTEND)
-		;
+	int timeout;
+	timeout = 50;
+	while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
+		udelay(1);
+	if (! timeout)
+		printk(KERN_DEBUG "burgundy_extend_wait: timeout #1\n");
+	timeout = 50;
+	while ((in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
+		udelay(1);
+	if (! timeout)
+		printk(KERN_DEBUG "burgundy_extend_wait: timeout #2\n");
 }
 
 static void
@@ -66,7 +76,6 @@
 	unsigned val = 0;
 	unsigned long flags;
 
-	/* should have timeouts here */
 	spin_lock_irqsave(&chip->reg_lock, flags);
 
 	out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);
@@ -107,7 +116,6 @@
 	unsigned val = 0;
 	unsigned long flags;
 
-	/* should have timeouts here */
 	spin_lock_irqsave(&chip->reg_lock, flags);
 
 	out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);

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

* Re: [Alsa-devel] Burgundy Auto-Mute problem
@ 2003-07-17 10:11   ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2003-07-17 10:11 UTC (permalink / raw)
  To: Ernst Persson; +Cc: alsa-devel, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

At Thu, 17 Jul 2003 11:08:03 +0200,
Ernst Persson wrote:
>
> Hi all!
>
> Now that the 2.6.0 kernel is out I'm trying to get ALSA working on my iMac
> 266, since it's the default sound system now (and dmasound doesn't compile).
>
> The first problem was that everything locked up when the ALSA drivers loaded.
> No error message, no kernel panic, just dead. And compiling ALSA with debug
> didn't help either.
>
> After some debugging I found out that the driver crashed here, in
> sound/ppc/burgundy.c    in   int __init snd_pmac_burgundy_init(pmac_t *chip)
>
> #ifdef PMAC_SUPPORT_AUTOMUTE
>
> 	printk(KERN_INFO "Automute Enabled.\n");
>
> 	if ((err = snd_pmac_add_automute(chip)) < 0)
> 		return err;
>
> 	chip->detect_headphone = snd_pmac_burgundy_detect_headphone;
> 	chip->update_automute = snd_pmac_burgundy_update_automute;
> 	snd_pmac_burgundy_update_automute(chip, 0); /* update the status only */
> #endif
> So I commented out //#define PMAC_SUPPORT_AUTOMUTE in pmac.h and after that
> the driver loaded without problems.
>
> But as soon as I touch any mixer (both the oss-emulated or with alsamixer)
> everything locks up again, in exactly the same way.

it seems that extend extend_wait() function waits for an infinite
loop.  could you try the attached patch?


Takashi

[-- Attachment #2: burgundy-fix.dif --]
[-- Type: application/octet-stream, Size: 1651 bytes --]

Index: alsa-kernel/ppc/burgundy.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/ppc/burgundy.c,v
retrieving revision 1.9
diff -u -r1.9 burgundy.c
--- alsa-kernel/ppc/burgundy.c	16 Aug 2002 15:05:05 -0000	1.9
+++ alsa-kernel/ppc/burgundy.c	17 Jul 2003 10:11:07 -0000
@@ -34,17 +34,27 @@
 inline static void
 snd_pmac_burgundy_busy_wait(pmac_t *chip)
 {
-	while (in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD)
-		;
+	int timeout = 50;
+	while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--)
+		udelay(1);
+	if (! timeout)
+		printk(KERN_DEBUG "burgundy_busy_wait: timeout\n");
 }

 inline static void
 snd_pmac_burgundy_extend_wait(pmac_t *chip)
 {
-	while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND))
-		;
-	while (in_le32(&chip->awacs->codec_stat) & MASK_EXTEND)
-		;
+	int timeout;
+	timeout = 50;
+	while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
+		udelay(1);
+	if (! timeout)
+		printk(KERN_DEBUG "burgundy_extend_wait: timeout #1\n");
+	timeout = 50;
+	while ((in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
+		udelay(1);
+	if (! timeout)
+		printk(KERN_DEBUG "burgundy_extend_wait: timeout #2\n");
 }

 static void
@@ -66,7 +76,6 @@
 	unsigned val = 0;
 	unsigned long flags;

-	/* should have timeouts here */
 	spin_lock_irqsave(&chip->reg_lock, flags);

 	out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);
@@ -107,7 +116,6 @@
 	unsigned val = 0;
 	unsigned long flags;

-	/* should have timeouts here */
 	spin_lock_irqsave(&chip->reg_lock, flags);

 	out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);

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

* Re: Burgundy Auto-Mute problem
  2003-07-17 10:11   ` [Alsa-devel] " Takashi Iwai
@ 2003-07-17 15:16     ` Ernst Persson
  -1 siblings, 0 replies; 6+ messages in thread
From: Ernst Persson @ 2003-07-17 15:16 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, linuxppc-dev

If you add an #include <linux/delay.h> the patch works and everything runs 
fine, even with 
PMAC_SUPPORT_AUTOMUTE enabled.

But now that I can run the drivers, I discover that I can't change any of the 
mixer controls. (as root:)
	amixer sset Master 100
Simple mixer control 'Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 100
  Front Left: Playback 100 [100%]
  Front Right: Playback 100 [100%]
	amixer sget Master
Simple mixer control 'Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 100
  Front Left: Playback 0 [0%]
  Front Right: Playback 0 [0%]

What's wrong now?

//ernie

torsdagen den 17 juli 2003 12.11 skrev Takashi Iwai:
> At Thu, 17 Jul 2003 11:08:03 +0200,
>
> Ernst Persson wrote:
> > Hi all!
> >
> > Now that the 2.6.0 kernel is out I'm trying to get ALSA working on my
> > iMac 266, since it's the default sound system now (and dmasound doesn't
> > compile).
> >
> > The first problem was that everything locked up when the ALSA drivers
> > loaded. No error message, no kernel panic, just dead. And compiling ALSA
> > with debug didn't help either.
> >
> > After some debugging I found out that the driver crashed here, in
> > sound/ppc/burgundy.c    in   int __init snd_pmac_burgundy_init(pmac_t
> > *chip)
> >
> > #ifdef PMAC_SUPPORT_AUTOMUTE
> >
> > 	printk(KERN_INFO "Automute Enabled.\n");
> >
> > 	if ((err = snd_pmac_add_automute(chip)) < 0)
> > 		return err;
> >
> > 	chip->detect_headphone = snd_pmac_burgundy_detect_headphone;
> > 	chip->update_automute = snd_pmac_burgundy_update_automute;
> > 	snd_pmac_burgundy_update_automute(chip, 0); /* update the status only */
> > #endif
> > So I commented out //#define PMAC_SUPPORT_AUTOMUTE in pmac.h and after
> > that the driver loaded without problems.
> >
> > But as soon as I touch any mixer (both the oss-emulated or with
> > alsamixer) everything locks up again, in exactly the same way.
>
> it seems that extend extend_wait() function waits for an infinite
> loop.  could you try the attached patch?
>
>
> Takashi



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

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

* Re: [Alsa-devel] Burgundy Auto-Mute problem
@ 2003-07-17 15:16     ` Ernst Persson
  0 siblings, 0 replies; 6+ messages in thread
From: Ernst Persson @ 2003-07-17 15:16 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, linuxppc-dev


If you add an #include <linux/delay.h> the patch works and everything runs
fine, even with
PMAC_SUPPORT_AUTOMUTE enabled.

But now that I can run the drivers, I discover that I can't change any of the
mixer controls. (as root:)
	amixer sset Master 100
Simple mixer control 'Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 100
  Front Left: Playback 100 [100%]
  Front Right: Playback 100 [100%]
	amixer sget Master
Simple mixer control 'Master',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 100
  Front Left: Playback 0 [0%]
  Front Right: Playback 0 [0%]

What's wrong now?

//ernie

torsdagen den 17 juli 2003 12.11 skrev Takashi Iwai:
> At Thu, 17 Jul 2003 11:08:03 +0200,
>
> Ernst Persson wrote:
> > Hi all!
> >
> > Now that the 2.6.0 kernel is out I'm trying to get ALSA working on my
> > iMac 266, since it's the default sound system now (and dmasound doesn't
> > compile).
> >
> > The first problem was that everything locked up when the ALSA drivers
> > loaded. No error message, no kernel panic, just dead. And compiling ALSA
> > with debug didn't help either.
> >
> > After some debugging I found out that the driver crashed here, in
> > sound/ppc/burgundy.c    in   int __init snd_pmac_burgundy_init(pmac_t
> > *chip)
> >
> > #ifdef PMAC_SUPPORT_AUTOMUTE
> >
> > 	printk(KERN_INFO "Automute Enabled.\n");
> >
> > 	if ((err = snd_pmac_add_automute(chip)) < 0)
> > 		return err;
> >
> > 	chip->detect_headphone = snd_pmac_burgundy_detect_headphone;
> > 	chip->update_automute = snd_pmac_burgundy_update_automute;
> > 	snd_pmac_burgundy_update_automute(chip, 0); /* update the status only */
> > #endif
> > So I commented out //#define PMAC_SUPPORT_AUTOMUTE in pmac.h and after
> > that the driver loaded without problems.
> >
> > But as soon as I touch any mixer (both the oss-emulated or with
> > alsamixer) everything locks up again, in exactly the same way.
>
> it seems that extend extend_wait() function waits for an infinite
> loop.  could you try the attached patch?
>
>
> Takashi


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2003-07-17 15:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-17  9:08 Burgundy Auto-Mute problem Ernst Persson
2003-07-17  9:08 ` Ernst Persson
2003-07-17 10:11 ` Takashi Iwai
2003-07-17 10:11   ` [Alsa-devel] " Takashi Iwai
2003-07-17 15:16   ` Ernst Persson
2003-07-17 15:16     ` [Alsa-devel] " Ernst Persson

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.