microphone does not work on intel macbook with edgy

Bug #82028 reported by martinbures
22
Affects Status Importance Assigned to Milestone
linux-source-2.6.20 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

I am using Ubuntu Edgy on an intel macbook core duo. I found the following on the gentoo wiki for how to make the built-in microphone work.

Hope this helps.

cheers.
martin.

I was able to get the built-in mic working on the macbook thanks to Jason Parekh's howto (http://www.jasonparekh.com/linux-on-macbook#microphone).

I used the alsa-driver ebuild (version 1.0.13). If you have sound built into your kernel you can also get it working this way too, you just need to edit the files /usr/src/linux/patch_sigmatel.c and /usr/src/linux/sound/pci/hda/patch_sigmatel.c instead of the ones I mention below (and skip the ebuild commands).

Basically we just need to edit the patch_sigmatel.c file to re-map the pins to better suit the macbook. Here's how I did it with the alsa-driver ebuild and portage:

ebuild /usr/portage/media-sound/alsa-driver/alsa-driver-1.0.13.ebuild unpack
vim /var/tmp/portage/media-sound/alsa-driver-1.0.13/work/alsa-driver-1.0.13/pci/hda/patch_sigmatel.c

search for "d945gtp5_pin_configs" (line 354 for me), you should see something like this:

static unsigned int d945gtp5_pin_configs[10] = {
        0x0221401f, 0x01011012, 0x01813024, 0x01014010,
        0x01a19021, 0x01016011, 0x01452130, 0x40000100,
        0x02a19320, 0x40000100,
};

Make a new line under this section and paste the following:

static unsigned int macbook_pin_configs[10] = {
        0x0321E230, 0x03A1E020, 0x400000FD, 0x9017E110,
        0x400000FE, 0x400000F0, 0x1345E240, 0x13C5E22E,
        0x400000FC, 0x400000FB,
};

Now we need to tell alsa to use our new macbook pin configuration, so just a few lines down you should see:

[STAC_MACMINI] = d945gtp5_pin_configs,

Change this to:

[STAC_MACMINI] = macbook_pin_configs,

Note that the above DISABLES your line in. If you need to use your line in AND your mic, then in the new code block replace the "0x400000F0" value with "0x0381E021" so that it reads:

static unsigned int macbook_pin_configs[10] = {
        0x0321E230, 0x03A1E020, 0x400000FD, 0x9017E110,
        0x400000FE, 0x0381E021, 0x1345E240, 0x13C5E22E,
        0x400000FC, 0x400000FB,
};

The disadvantage is that you will need to toggle the recording device to linein and back to mic to get it to work. Of course this could be done easily with /etc/conf.d/local.start, something like

amixer sset 'Input Source' 'Line'
amixer sset 'Input Source' 'Mic'

Save and exit patch_sigmatel.c. Now check to make sure the other file says the same thing. This is found under:

/var/tmp/portage/media-sound/alsa-driver-1.0.13/work/alsa-driver-1.0.13/alsa-kernel/pci/hda/patch_sigmatel.c

When you are sure they are both as mentioned above you're ready to build the driver. Run:

ebuild /usr/portage/media-sound/alsa-driver/alsa-driver-1.0.13.ebuild compile
ebuild /usr/portage/media-sound/alsa-driver/alsa-driver-1.0.13.ebuild install
ebuild /usr/portage/media-sound/alsa-driver/alsa-driver-1.0.13.ebuild qmerge

If you are using sound in your kernel, then re-build your kernel now. If you have sound built statically into your kernel you'll need to rebuild your kernel, copy it to /boot and reboot to it. If you're using sound as modules, then you should be able to just run:

cd /usr/src/linux/
make modules modules_install

Once you have emerged the package or rebuilt your kernel update the module deps

modules-update

I think it's a good idea to reboot at this stage, or reload your alsa modules. You could just re-run alsaconf if you like which should do this for you.

When you reboot you should now be able to use your microphone. Remember to toggle the recording device to linein and back to mic if you need to. You can toggle the mic for recording from the command line with:

amixer sset Capture '100%' toggle

Make sure it says "on" like so:

chris@localhost ~ $ amixer sset Capture '100%' toggle

Simple mixer control 'Capture',0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 14
Front Left: Capture 14 [100%] [21.00dB] [on]
Front Right: Capture 14 [100%] [21.00dB] [on]

Simply make sure that it is selected to record and give it a test!

Revision history for this message
Daniel T Chen (crimsun) wrote :

Already fixed upstream.

Revision history for this message
Timothy Smith (tas50) wrote :

Can someone test this under Feisty?

Revision history for this message
Diego Cortassa (diego-cortassa) wrote :

Just tried on freshly released Feisty Fawn Herd 4, still not working ...

Revision history for this message
Cristian Aravena Romero (caravena) wrote :

Thanks for taking the time to report this bug. Unfortunately we can't fix it, because your description didn't include enough information.

Please include the information requested from https://help.ubuntu.com/community/DebuggingSoundProblems as separate attachments.

Revision history for this message
Mike Basinger (mike.basinger) wrote :

Not fixed in Feisty Herd 4
Included Information for https://help.ubuntu.com/community/DebuggingSoundProblems

Revision history for this message
Kyle McMartin (kyle) wrote :

Mike, is this still broken in Herd 5?

Changed in linux-source-2.6.20:
status: Fix Committed → Fix Released
Revision history for this message
Andrea Giardina (andrea-giardina) wrote :

It's broken in feisty beta. I attached log.

Revision history for this message
Mike Basinger (mike.basinger) wrote :

Still not working for me.

Revision history for this message
Mike Basinger (mike.basinger) wrote :

Correction, the internal microphone works now but I can not get an external microphone to work.

Revision history for this message
Christer Edwards (christer.edwards) wrote :

internal still not functioning for me in current Feisty (10 May 07)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.