Skip to contentSkip to conversation

Kernel sound problems (and misc)

DISCUSSION Bastien Nocera 3 participants 3 messages May 13, 2001 Library code

lore
Share & tools
lore
#0 lore raw

Hi gang,

I updated my kernel today, trying out BenH's tree and Paulus' off PenguinPPC's rsync services.

Ben's tree seems to already include Iain's dmasound patches, and showed the same problem as when I applied the patches on an older kernel: when booting (ie. when the sound is activated), the speakers are "hissing" until I play something and stop it. Then it behaves correctly (ie. there's no sound when I'm not playing any :P)

OK, there goes the main problem: mixer problems. There are 3 ways to output sound on this iMac DV summer 2000 (OF tree still available from tidbit.org).
- the front speakers: the preferred way obviously. Main volume is of no use (doesn't do anything), the speakers volume goes from mute, or loud to very loud.
- the front audio sockets: there aren't independant of the front speakers, doesn't really matter, but that means it's not possible to shut the sound of the speakers and listen to the music with a headphone. It might be a hardware problem.
- the audio socket for external speakers on the left handside of the
machine: there's no volume control for them. Bringing down all the volume controls shut off the front speakers (good), but there's no way to raise or lower the sound on this output either.

So, to sum it up, the main volume control does absolutely nothing on this machine, and the speaker volume control is either mute, loud, or very loud. I'd be glad to help on finding out the problem.

The misc problem is, while trying to compile paulus' kernel, the vmlinux target fails to link with rwsem_down_write_failed and rwsem_wake undefined references.

I hope somebody can help me tackle these.

Cheers

--
/Bastien Nocera
http://hadess.net

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

#1 lore raw
Quoted 8 lines

OK, there goes the main problem: mixer problems. There are 3 ways to output sound on this iMac DV summer 2000 (OF tree still available from tidbit.org).
- the front speakers: the preferred way obviously. Main volume is of no use (doesn't do anything), the speakers volume goes from mute, or loud to very loud.

I think on those models, we must set the sound chip volume to a fixed value and control the "SRS" amplifier using I2C. I don't have all the details in mind yet however.

Quoted 4 lines

- the front audio sockets: there aren't independant of the front speakers, doesn't really matter, but that means it's not possible to shut the sound of the speakers and listen to the music with a headphone. It might be a hardware problem.

Probably related to the above problem.

Quoted 4 lines

- the audio socket for external speakers on the left handside of the
machine: there's no volume control for them. Bringing down all the volume controls shut off the front speakers (good), but there's no way to raise or lower the sound on this output either.

Well, if it's a "line" output, it can be considered normal. (the line output of a portable CD player has no volume control for example). You should look at what happens with MacOS.

Quoted 7 lines

So, to sum it up, the main volume control does absolutely nothing on this machine, and the speaker volume control is either mute, loud, or very loud. I'd be glad to help on finding out the problem.

The misc problem is, while trying to compile paulus' kernel, the vmlinux target fails to link with rwsem_down_write_failed and rwsem_wake undefined references.

Use my tree for pmac.

Quoted 1 line

I hope somebody can help me tackle these.

The main issue is that almost each Apple motherboard has a different wiring of the sound chips. Some of them (the newer ones) seem to describe things in the OF tree, older ones need us to hard code the layout. Our current driver doesn't cope with that very well yet. Also, some boards have external hardware (like amplifiers, SRS module, ...) that need to be controlled with the I2C bus, for which we don't have drivers for all machines.

Ben.

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

#2 lore raw
In reply to Bastien Nocera
Quoted 6 lines · Bastien Nocera

The misc problem is, while trying to compile paulus' kernel, the vmlinux target fails to link with rwsem_down_write_failed and rwsem_wake undefined references.

I hope somebody can help me tackle these.

i ran into a similar problem last week trying to build an ia32 kernel.
seems it was due to some fundamental changes to semaphore stuff and a some compiler instructions i don't wuite understand. someone sent me a patch, i've added it below. (part of it is alpha-specific and irrelevant, but the last part seems interesting.) might give you an idea, but might also be that you have a different problem.
search the lkml archive for rwsem_, there were quite a few posts.

good luck,

jörn

This patch fixes the __builtin_expect compile problem in 2.4.4-pre6 by
moving the definition of __builtin_expect from include/asm-alpha/compiler.h to include/linux/compiler.h and including
this file where needed. I haven't touched the ia64 files that uses __builtin_expect. Does any pre-2.96 compilers have support for ia64?

--
Niels Kristian Bech Jensen -- [email protected] --
http://www.image.dk/~nkbj/

----------->> Stop software piracy --- use free software! <<-----------

diff -u --recursive --new-file v2.4.4-pre6/linux/include/asm-alpha/compiler.h linux/include/asm-alpha/compiler.h
--- v2.4.4-pre6/linux/include/asm-alpha/compiler.h Mon Nov 13
04:27:11 2000
+++ linux/include/asm-alpha/compiler.h Sun Apr 22 08:28:07 2001 @@ -72,13 +72,4 @@
__asm__("stw %1,%0" : "=m"(mem) : "r"(val))
#endif

-/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
- a mechanism by which the user can annotate likely branch
directions and
- expect the blocks to be reordered appropriately. Define
__builtin_expect
- to nothing for earlier compilers. */
-
-#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
-#define __builtin_expect(x, expected_value) (x) -#endif
-
#endif /* __ALPHA_COMPILER_H */
diff -u --recursive --new-file v2.4.4-pre6/linux/include/asm-alpha/semaphore.h linux/include/asm-alpha/semaphore.h
--- v2.4.4-pre6/linux/include/asm-alpha/semaphore.h Sun Apr 22
08:18:53 2001
+++ linux/include/asm-alpha/semaphore.h Sun Apr 22 08:28:29 2001 @@ -11,7 +11,7 @@
#include <asm/current.h>
#include <asm/system.h>
#include <asm/atomic.h>
-#include <asm/compiler.h> /* __builtin_expect */
+#include <linux/compiler.h>
#include <linux/wait.h>
#include <linux/rwsem.h>

diff -u --recursive --new-file v2.4.4-pre6/linux/include/linux/compiler.h linux/include/linux/compiler.h
--- v2.4.4-pre6/linux/include/linux/compiler.h Thu Jan 1 01:00:00 1970
+++ linux/include/linux/compiler.h Sun Apr 22 08:29:12 2001
@@ -0,0 +1,13 @@
+#ifndef __LINUX_COMPILER_H
+#define __LINUX_COMPILER_H
+
+/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
+ a mechanism by which the user can annotate likely branch
directions and
+ expect the blocks to be reordered appropriately. Define
__builtin_expect
+ to nothing for earlier compilers. */
+
+#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
+#define __builtin_expect(x, expected_value) (x)
+#endif
+
+#endif /* __LINUX_COMPILER_H */
diff -u --recursive --new-file v2.4.4-pre6/linux/lib/rwsem.c linux/lib/rwsem.c

lib/rwsem.c Sun Apr 22 08:29:37 2001 renamed from linux/lib/rwsem.c Sun Apr 22 08:19:11 2001 +1 -0
@@ -6,6 +6,7 @@
 #include <linux/rwsem.h>
 #include <linux/sched.h>
 #include <linux/module.h>
+#include <linux/compiler.h>
 
 struct rwsem_waiter {
        struct rwsem_waiter     *next;

--
Jörn Nettingsmeier
home://Kurfürstenstr.49.45138.Essen.Germany
phone://+49.201.491621
http://icem-www.folkwang-hochschule.de/~nettings/
http://www.linuxdj.com/audio/lad/

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