24″ iMac ALSA configuration June 23, 2008
Posted by idebian in Debian, GNU/Linux, Hardware.Tags: ALSA
trackback

Now that the nVIDIA video driver has been set-up let’s give our iMAC a voice (the stereo speakers) and a pair of ears (the stereo mic) ![]()
We will go briefly in the Linux’s ALSA configuration of the integrated iMac sound card.
The hardware
The iMAC’s sound card is built on top of the Realtek ALC885 chipset driven by the Intel ICH8 HD Audio controller.
The Realtek chipset is capable of 7.1 channel even if we just have a stereo speakers system. The headphone plug can be also used as AC3 pass-through in case you have an external AC3 decoder.
ALSA support
The sound card is well supported in ALSA (1.0.16) once you set a proper option to define the specific 24″ iMac implementation for the snd-hda-intel module, which is the ALSA module that manage the Intel audio controller.
For my 24″ iMac – early 2008 – I found that the most appropriate model is mbp3 (which stands for MacBook Pro rev3); this gives me total access to the internal microphone also, while the imac24 model didn’t allow me this.
I usually define all my custom kernel modules options within a file named local in the /etc/modprobe.d directory. So let’s type:
$ echo "options snd-hda-intel model=mbp3" >> /etc/modprobe.d/local
and that’s it! reboot to make the changes effective.
First tests
alsamixer
Once system has rebooted you should be able to listen audio from your iMAC.
First of all launch alsamixer at the terminal prompt and adjust Master, PCM and Front outputs volume as represented in the post’s top picture:
$ alsamixer
- move between the input with the ‘<-’ and ‘->’ keys
- change the volume with the ‘UP’ and ‘DOWN’ arrow keys
- unmute with ‘M’ key
speakertest
To test the speaker we use of the ALSA’s speakertest utility. Open a terminal and type:
$ speakertest -c 2
speaker-test 1.0.16
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 8192
Period size range from 1024 to 1024
Using max buffer size 8192
Periods = 4
was set period_size = 1024
was set buffer_size = 8192
0 - Front Left
1 - Front Right
where -c 2 specify a two channels output.
Interrupt with CTRL-C.
If everything is properly set you should have listened white noise coming alternatively from the two speakers
GNOME’s Volume Control
Now that the raw audio functionality has been verified let’s pass to the fine tuning.
To properly set-up the sound card in GNOME double click on the speaker icon in the GNOME notification area; the graphical mixer should came up.
Go to Edit -> Preferences and enable all the items.
This is mine Playback Tab:

Gnome Volume Control - Playback Tab
and the Recording Tab:

Gnome Volume Control - Recording Tab
In the Switches Tab just set the Speaker check-box.
In the Options Tab settings set the Channel Mode to ’2 ch’ and ‘Mic’ as the Input Source.
We can now close the Volume Control and jump to the final step to set-up the Master control for the toolbar icon: right click on the speaker icon, select ‘Preferences’ and then choose ‘Master’ as the device to control.
MIC test
Once you set-up the GNOME’s mixer you should be able to record from the integrated MIC using the Sound Recorder application in the Sound menu.

Gnome Sound Recorder
For those of you who do everything within a terminal (as I do) we can also use arecord/aplay:
$ arecord test.wav
$ aplay test.wav
AC3 pass-through
From the Apple manual it seems that the 3.5mm output jack can be used either as Sound output or digital audio output. When no device is connected to the output jack, the internal speakers are selected, otherwise audio output port selection is automatic:
The S/PDIF (Sony/Philips Digital Interface Format) optical digital output is automatically selected when an S/PDIF optical digital output device is detected on the external combination audio port.
From [1] it seems that:
The name of the connector is “Mini-TOSlink”, usually you can find optical cables which have a Mini-TOSlink plug on one end and a TOSlink plug on the other end, or you can use a plain TOSlink cable in combination with a TOSlink to Mini-TOSlink converter (the L71BA one, TOS [F] – 3.5mm [M]), or similar.
Very nice!!
Works Great. Thanks!
I recently setup my iMac just like this. One thing I noticed though is it gives the internal speakers the volume output of a MacBook Pro (i.e. way too quite). The internal iMac speakers can really crank and aren’t half bad. Its a shame the imac24 driver isn’t correct.
Muy buena ayuda,
Es lo unico que me faltaba para tener configurado Ubuntu Intrepid en mi iMac.
Gracias.
Saludos desde Tepic, Mexico
hi,
I followed your steps, but I only get mono sound through the speakers.
1 channel (0) only. I can’t get the front right working. Any ideas?
In Ubuntu 9.10 ,
sudo gedit /etc/modprobe.d/options
Adding the line “options snd-hda-intel model=mbp3″
On an Imac aluminium 20” the Headphone and the internal Microphone now works!
Thank you for your Configuration Tips.
This works on Fedora 11 too. I tried so many alsa modprobe options that I gave up until I found your blog.
Thank you so much!
-Adam
After days of googling, hours of trial and error, and even changing distributions, your solution ‘mbp3′ instead of ‘imac24′ has at last got my microphone to work and I can skype again. Many, many thanks!
I have a triple boot -Leopard,XP and Mint 8 on my late 2008 24″Mac.
Hi,
Just tried this and didn’t work on a fedora 14 Imac.
No way to make it sound properly.
Sorry…