Manual pages: aoa(4) and snapper(4)
The Apple PowerBook5,4 has an internal microphone, speakers, and upon the left side, a microphone miniplug port and a headphone miniplug port. Of the PowerBook5,4 audio hardware, Mac OS X calls it "Texas Instruments TAS3004" while the Advanced Linux Sound Architecture calls it "snapper". OpenBSD 3.7 does not detect it. OpenBSD 3.8 detects it and attaches the snapper(4) driver. OpenBSD 3.9 and later versions detect it and attach the aoa(4) driver. These drivers can play sound, but do not record sound.
Though the snapper(4) and aoa(4) drivers sound well (with no ALSA noise), the snapper(4) driver has a volume control but the aoa(4) driver does not. It seems that both snapper(4) and aoa(4) use the "i2s" bus to deliver sound. However, the snapper(4) uses the TAS3004 to control the volume, while aoa(4) is for machines without a TAS3004. The issue here is that the PowerBook5,4 (unlike the PowerBook5,3 or PowerBook5,5) has Open Firmware incorrectly identifying the snapper(4) hardware as aoa(4) hardware.
An examination of CVSweb and manual pages suggested that:
- The snapper(4) driver started at NetBSD/macppc with the snapper.c source file.
- The snapper.c file became the snapper(4) of OpenBSD 3.5.
- A strcmp(compat, "AOAKeylargo") appeared in the snapper_match function between OpenBSD 3.7 and 3.8. It matches the PowerBook5,4 audio.
- Between 3.8 and 3.9, the OpenBSD developers added more macppc audio drivers. They split snapper.c into i2s.c for the audio bus and snapper.c for the volume knob, so that the new drivers could also use i2s. The new drivers were aoa(4), daca(4), onyx(4), tumbler(4).
- The strcmp(compat, "AOAKeylargo") moved to aoa(4), a "WORK-IN-PROGRESS AOAKeylargo audio driver" being a small driver with no volume knob.
- If one uses config -e to disable aoa then no driver, not aoa(4), not snapper(4), will attach to the PowerBook5,4 audio hardware.
- By modifying the aoa_match and snapper_match source code, one can use snapper(4) with the PowerBook5,4 over OpenBSD 4.0, as had happened over OpenBSD 3.8.
- Recently, NetBSD-current implemented a software volume knob in their snapper(4) driver for machines without a TAS3004.
diff
The following source code changes allow one to build a custom OpenBSD kernel for the PowerBook5,4, that replaces the aoa(4) driver with the snapper(4) driver.
First, cd /usr/src/sys/arch/macppc/dev, then make the changes shown here:
$ diff -u aoa.c{.orig,}
--- aoa.c.orig Wed Jun 27 11:40:20 2007
+++ aoa.c Wed Jun 27 11:40:20 2007
@@ -118,8 +118,10 @@
bzero(compat, sizeof compat);
OF_getprop(soundchip, "compatible", compat, sizeof compat);
+#ifndef POWERBOOK_5_4
if (strcmp(compat, "AOAKeylargo") == 0)
return (1);
+#endif
if (strcmp(compat, "AOAK2") == 0)
return (1);
$ diff -u snapper.c{.orig,}
--- snapper.c.orig Wed Jun 27 11:41:53 2007
+++ snapper.c Wed Jun 27 11:41:53 2007
@@ -297,6 +297,10 @@
if (strcmp(compat, "snapper") == 0)
return (1);
+#ifdef POWERBOOK_5_4
+ if (strcmp(compat, "AOAKeylargo") == 0)
+ return (1);
+#endif
if (OF_getprop(soundchip, "platform-tas-codec-ref",
&soundcodec, sizeof soundcodec) == sizeof soundcodec)
Then, cd /usr/src/sys/arch/macppc/conf and create a POWERBOOK_5_4 file containing the following:
include "arch/macppc/conf/GENERIC"
option POWERBOOK_5_4
Now run /usr/sbin/config POWERBOOK_5_4 and use the /usr/src/sys/arch/macppc/compile/POWERBOOK_5_4 directory to build and install a new kernel.
You may edit this wiki page. The text is in the PublicDomain except for the copyrighted BSD code!
Comments (0)
You don't have permission to comment on this page.