linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Removing speaker hiss on PB G3
@ 1999-03-04 18:08 Alvin Brattli
  0 siblings, 0 replies; only message in thread
From: Alvin Brattli @ 1999-03-04 18:08 UTC (permalink / raw)
  To: linuxppc-dev



With the current 2.2.1 kernel, there is a lot of hiss in the speakers
and headphones on the PowerBook G3.  The hiss starts immediately when
booting, and does not disappear until a beep has been sounding.  When I
was implementing my patch for the volume and mute buttons for the PB G3,
I added some code in the function dmasound_init() in
drivers/sound/dmasound.c to stop the beep immediately after the sound
chips have been initialized.  I first tried using PMacSilence() and
sound_silence(), but these do not do the trick.  Not knowing enough
about the underlying hardware (and not having any documentation on it,
beside the kernel code), I conjured up this code.
What it does, is simply to issue a short beep of length one tick
and with zero volume immediately after initializing the sound hardware,
and then restoring the volume, effectively stopping the hiss.

This patch is ugly, but it works (at least for my PowerBook).  What
really should be done, I think, is to change PMacSilence() so it does a
better job of making sure the sound hardware is making no sound.
However, without understanding the inner workings of the sound hardware,
I cannot do this.  Can anyone give me any hints on what I need to do?


--- drivers/sound/dmasound.c.orig	Mon Mar  1 19:21:46 1999
+++ drivers/sound/dmasound.c	Thu Mar  4 18:51:27 1999
@@ -4840,6 +4840,7 @@
 	int has_sound = 0;
 #ifdef CONFIG_PPC
 	struct device_node *np;
+	int beep_volume_tmp;
 #endif
 
 #if defined(__mc68000__) || defined(CONFIG_APUS)
@@ -4974,6 +4975,14 @@
 #ifdef MODULE
 	irq_installed = 1;
 #endif
+
+#ifdef CONFIG_PPC
+	/* Remove hiss from PowerBook speakers */
+	beep_volume_tmp = beep_volume;
+	beep_volume = 0;
+	awacs_mksound(750, 1);
+	beep_volume = beep_volume_tmp;
+#endif /* CONFIG_PPC */
 
 	printk(KERN_INFO "DMA sound driver installed, using %d buffers of %dk.\n",
 	       numBufs, bufSize);





aLViN
-- 
:r .signature

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-03-04 18:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-04 18:08 Removing speaker hiss on PB G3 Alvin Brattli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).