Ubuntu

Left speaker doesn't work, controls mixed up on Apple MacBook[Pro] (5,1)

Reported by Ricky Campbell on 2009-03-03
68
This bug affects 9 people
Affects Status Importance Assigned to Milestone
ALSA driver
New
Unknown
Mactel Support
Medium
Unassigned
alsa-driver (Ubuntu)
Undecided
Unassigned

Bug Description

Reporting this bug for another user...

In MacBook and MacBookPro 5,1 (aluminium, late 2008) the soundcard works out of the box only with headphones, and to turn speakers on it is necessary to manually set the 6 channels. In that case, sound is heard both on headphones and right and center speaker; the left speaker doesn't work yet.

This bug is confirmed by several users, see the additional information attached.

della@raker:~$ lspci | grep -i audio
00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)
della@raker:~$ grep Codec /proc/asound/card0/codec#*
Codec: Realtek ALC889A

To solve this bug requires knowledge of how the hda chip in these notebooks is connected. From what I've been told, it is possible to find out this information by looking at the .inf files for the audio drivers for Windows. Are you able to possibly obtain this file and put it up somewhere? This bug may not be the best place, but if you have nowhere else, you can always zip it I suppose.

If you are not sure where to find the .inf file, you could have alook on your OS X CD, for bootcamp related executable files. I think these files can be extracted, and the necessary files obtained that way.

Hope this helps

Luke

Alex Karpenko (alexkarpenko) wrote :

I believe the relevant information may also be found in Apple's fdi file for the HDA chip. It's located for me on my OSX drive at:
/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAPlatformDriver.kext/Contents/Info.plist

Alex Karpenko (alexkarpenko) wrote :

Err, meant to say Info.plist file not fdi file :)

buntuLo (buntulo) wrote :

I report the same problem with (K)ubuntu 8.10 on MacBookPro 5.1. The only difference is that here just the right channel works, while both left and central do not. Moreover the volume mixer has some more oddities, basically channels switched between them.
I attach my MacOS Info.plist file for the HDA chip, hope it helps. Thanks! Lo.

Unfortunately the plist file is no use to me until I have some information given from ALSA. Can you all please run http://www.alsa-project.org/alsa-info.sh and post the URL you receive for your hardware?

Thanks

Alex Murray (alexmurray) wrote :

Output from alsa-info.sh script run on my MacBook Pro 5,1 running Ubuntu 8.10 Intrepid:

http://www.alsa-project.org/db/?f=247450a1667370684d30c31008d124f15c8f3a19

Note: Under Intrepid ONLY the headphones work, I cannot get any sound output from the speakers at all.

At some point my eye catched a thread warning about possible security issues when it is about to provide information collected by scripts. Could you please ensure us that the information collected by this script is ok to be published? Then I'll post right-away the relevant info.

Kind regards, Nikos

Daniel T Chen (crimsun) wrote :

Nikos, the source of the script is available for inspection and modification at http://www.alsa-project.org/alsa-info.sh

The script simply collects system information such as one's Linux distribution, versions of necessary debugging information (alsa-lib, alsa-utils, alsa-kernel/linux), mixer volume settings, ownership and modes of /dev/snd/*, and contents of AC'97/HDA codec spew.

If you feel hesitant in any fashion regarding providing the above debugging information to help developers resolve driver bugs, please don't download, and don't run the script. Your bug reports, of course, will receive little attention due to the lack of necessary debugging information.

With respect to the revision history of the script itself, several insecure temporary file uses have been corrected. The above URL always redirects to the most current (git HEAD) version of the script. Of course, run the script as an unprivileged user.

Daniel,

thanks for the feedback. I know I can study the code on my own. But
(1) it takes time,
(2) asking about security issues is nothing bad, in fact I recommend it all the time to: better be on the green-zone :-),
(3) it wouldn't hurt anybody to inform within 2-3 lines of text, withing the script or as a separate README text file, that this script is not dangerous.

So, I'll post my alsa-info output in a while.

Cheers, Nikos

buntuLo (buntulo) wrote :

and here's my output for alsa-info.sh on MBP5.1. Lo.

http://www.alsa-project.org/db/?f=d126369b6ec632c9cab572e2aa616fc3dc8a0ab7

Matteo Dell'Amico (della) wrote :

This is mine (MPB 5.1). I got the speakers working by compiling alsa 1.0.18 from the jaunty sources.

http://www.alsa-project.org/db/?f=419d89d4ec9c0ab8a636c3cf56b094afb6e28213

Matteo Dell'Amico (della) wrote :

To avoid misunderstandings: the speakers I got working were center and right, as usual.

Changed in mactel-support:
importance: Undecided → Medium
status: New → Confirmed
Walter Cheuk (wwycheuk) wrote :

Hi, don't know if this is the right place to post:

I got a MacBook (late 2006, C2D) and have no sound when running Xubuntu 9.04 beta. I ran the script mentioned above the report sent to http://www.alsa-project.org/db/?f=19ad60fa195ed8bc8e08c903cc6d9490b426d20c

Thank you.

Alex Murray (alexmurray) wrote :

@Luke (themuso) - is the provided output's from alsa-info.sh enough or do you need more info? I am relatively comfortable hacking on kernel stuff (although have never really played with audio drivers) so if there is anything you want me to try, let me know as it would be great to try and get this fixed. Also any ideas you have as to how to go about fixing this would be great as I can try and implement any possible solution that you might think of, but I don't have any real experience with the linux sound system (let alone the hda driver) to even know where to begin looking to try and solve this so any pointers / hints you could give would be greatly appreciated.

Walter Cheuk (wwycheuk) wrote :

This is a regression since sounds work out of the box in 8.04 on my Macbook. In 8.04.2 I have to open the mixer, move the levels to 'trigger start' the sound.

Hi Walter!

Which Macbook do you have? Do you hear sound from all speakers after "trigger start the sound"?

This bug report refers to:

1. Macbook[Pro] 5,1, that is, the new Unibody or Aluminum or you name it... but it's the 5,1.

2. the left speaker being "muted"

Kind regards, Nikos

Ricky Campbell (cyberdork33) wrote :

I believe this also affects the 5,2 models.

Alex Murray (alexmurray) wrote :

Since I have upgraded to Jaunty I thought I should post the output of running alsa-info.sh here (since previously I had only run it under Intrepid) on my MacBook Pro 5,1.

http://www.alsa-project.org/db/?f=7676cad3f19446207d351db82e5ef324fcb615e8

Walter Cheuk (wwycheuk) wrote :

Hi, my macbook is the late 2006 (core 2 duo) model. just check the docs and found that I should go elsewhere for support. Thank you.

P. Dunbar (vigilcode) wrote :

I'm on a 5,2 but I do get sound from both speakers. I played this:
http://www.youtube.com/watch?v=JG3VhmKfWf8&NR=1

I get sound from both right and left when the video plays sound from right and left front speakers. Whent the video plays sound from the rear speakers I hear it from the left only. I get no sound when the video is playing from the subwoofer. I've tried this with various similar videos with the same results.

Alex Murray (alexmurray) wrote :

I just noticed the following patch on the Ubuntu wiki for MBP5,1/5,2 (https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty)

http://qwe.pl/~kacper/alsa-driver-1.0.19-mb51.patch

which adds a new model mbp5,1 to the intel hda audio driver in alsa 1.0.19 - will try and test it tonight and see how it goes...if anyone else has tried it can you provide any feedback whether it works or not?

Robynhub (robynhub) wrote :

For Alex.

I report that this patch not work with my mbp5,1 and jaunty 9.04.

Just no sound at all.

Hi all.

There seems to be a typo in the patch, line 120:

+ case 0x106b3f00: /* Macvook 5,1 */

Kindest regards, Nikos

(
I don't know whether this typo (look previous comment) is of minor importance.
)

Anyhow, there is no "mbp" string in the patch (only "mb5").

Nikos

(
I don't know whether this typo (look previous comment) is of minor importance.
)

Anyhow, there is no "mbp5,1" string in the patch (only "mb5").

Nikos

Kacper (kacper3-14) wrote :

Hi, I'm the author of this patch. 'Macvook' was just a typo in a _comment_ so it doesn't affect anything. It was developed on MacBook 5.1 and it works without any module options on MacBook 5.1 (not pro).

I suppose it should also work on Pro but you may need to add module option:
model=mb5 (not mbp5!).
It would be useful if someone paste output of 'cat /proc/asound/card0/codec#*' from MacBookPro.

kacper

Here you go...

# cat-ing
cat /proc/asound/card0/codec#* > mbp5,1.codec
# file attached

Nikos

Kacper (kacper3-14) wrote :

Node configuration seems to be identical but subsystem id is different. So for sure you need to add
model=mb5 parameter. Again, if set up correctly it _should_ work also on Pro model. I'll try to find one to test it.

kacper

Alex Murray (alexmurray) wrote :

I'm currently rebuilding alsa-driver-1.0.18 in jaunty with this patch - applied relatively cleanly - to test on my mbp51 so will let you know how it goes shortly...

Jim Rorie (jfrorie) wrote :

Verified working on MBP5,1 The community documentation has been updated,.

https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty

Alex Murray (alexmurray) wrote :

I can also confirm that it pretty much works - in that I now get sound from the left speaker finally but overall the sound seems more tinny - ie. has a lot less bass and is more treble-y - is there some difference between what the new mb5 model uses and the old mbp3 model which may have affected this? Does anyone else also think this is the case or is it just me?

Just booted after compiling alsa-source + patch and confirming:
+ left-speaker speaking
- less bass

Nikos

Robynhub (robynhub) wrote :

Good work guys! Thanks so much for this patch!

Good luck for the bass problem...

Also, under the "Option" tab [in Volume Control: HDA NVidia (Alsa mixer)] there is no "Channel Mode" anymore.

P. Dunbar (vigilcode) wrote :

I used this as a test: http://www.youtube.com/watch?v=6H6a-qN9fYk
 I had surround sound before on the stock version from jaunty with model=mpb3

after upgrading to this following the jauntymbp5_1-5_2 wiki I still have the sound but think it is a bit more "tinny". Just to test I can still set the model to mbp3 and test it out.

I use a MacBookPro5,2 just for an fyi.

Ricky Campbell (cyberdork33) wrote :

We have had the discussion before about some of these machines having "subwoofers" . Might need to look at the difference between the mbp and the new mb5 options.

FWIW,

I can hear the subwoofer and all channels playing correctly via Headphone plug on an external Stereo (2 spekaers + Woofer) System.

Nikos

Kacper (kacper3-14) wrote :

Activating woofer should be very easy now. My MacBook (not pro) seems not to have a woofer because sound is ok. I'll try to find someone with a Pro to improve the patch.

btw it is now in alsa git tree

kacper

Many thanks for your efforts Kacper :-)
Cheers, Nikos

Matteo Dell'Amico (della) wrote :

I confirm that with the patch the left speaker works.

However, when I pass to headphones, the speakers don't automatically mute: I have to manually mute Front from volume control. Do other users have the same problems or do I need to change some controls?

thanks!
matteo

On Thu, May 7, 2009 at 5:39 PM, Matteo Dell'Amico <email address hidden> wrote:
> I confirm that with the patch the left speaker works.
>
> However, when I pass to headphones, the speakers don't automatically
> mute: I have to manually mute Front from volume control. Do other users
> have the same problems or do I need to change some controls?

From hardware point of view this is independent output. Unfortunately
HP connection
event is not passed to the declared handle. This can be solved only
inside the driver.

kacper

For some reason I have no more sound at all. Today, before compiling alsa from source along with the patch, I've upgraded to Linux vertical 2.6.28-12-generic. Suddenly, after some time surfing the web, I had no more sound.

Nikos

Alex Murray (alexmurray) wrote :

Nikos - you'll need to rebuild alsa-driver from source again since the kernel version has now changed when you upgraded it and the modules which you built previously are for the old version (2.6.28-11-generic)

Hi Alex!

I compiled the alsa-driver after the linux-image upgrade. Anyhow, it was my curiosity that caused my system to have no sound (e.g. I was playing around with the Sound preferences). All is fine again after setting "Autodetect" (under System > Preferences > sound) for all devices.

The only problem that remains, it seems, is the "missing" bass.

Cheers, Nikos

Jim Rorie (jfrorie) wrote :

ifixit.com shows the Macbook pro unibody as having a subwoofer and right channel combination repair part. It also shows this part as having 4 wires, so the Sub is probably individually controllable. It is very likely the candidate.

Alex Murray (alexmurray) wrote :

After a bunch of messing around and with some good advice from Kacper, plus Jim Rorie's comment above, I've been able to get the subwoofer enabled on the MBP5,1 - again this was mainly Kacper's work I really just helped test it.

So Kacper has updated his patch against alsa-driver-1.0.19 to enables the subwoofer now and adds the id for the MBP5,1 so you shouldn't have to manually add model=mb5, it should now automatically be detected! I've attached the latest patch to this bug report as well.

He is also going to forward the patch upstream to Alsa so it should be included in a future release - lets hope it make it into Karmic!

This should hopefully resolve all the issues in this bug now. I have to say, its pretty awesome to have sound working completely now!

That's really good news :-) Great work folks! As an end-user I can only test and verify. Thank you very much!!

Kindest regards, Nikos

P. Dunbar (vigilcode) wrote :

Any way to get it automatically working with MBP5,2?? I could probably manually type in mbp5,1 for the model and get it to work but would be good to have it auto if there are otherwise no differences.

If it helps I've attached cat /proc/asound/card0/codec#* > mbp5,2.codec

and also ran the alsa-info.sh script whose output is here:

http://www.alsa-project.org/db/?f=ece166e49151b07ce1615fd7a5ca197e5fe73251

Let me know, and thanks!

P. Dunbar (vigilcode) wrote :

also can i apply this over the other patch? I get this:
Reversed (or previously applied) patch detected! Assume -R?

or should i just start with a clean alsa and apply this?

I did (on MBP5,1) a clean compilation/installation using, of course, the latest patch. All works smooth now (without manual model option).
Cheers, Nikos

Alex Murray (alexmurray) wrote :

Yeah you'll need to do a clean patch P. Dunbar.

Ricky Campbell (cyberdork33) wrote :

Good news everyone! I think the changes made for the 5.1 should work for the 5,2 as well.

Also could someone take a crack at updating:
https://help.ubuntu.com/community/MacBookPro5-1_5-2/Jaunty

P. Dunbar (vigilcode) wrote :

On my 5,2 i get no sound if I don't specify the option. Once I specify the model=mbp5,1 I get sound again but still on a sound test like here: http://www.youtube.com/watch?v=JG3VhmKfWf8&NR=1 there is nothing that comes out when they get to the subwoofer. I don't know how else to verify subwoofer is working...

Hmmm... P. Dunbar, I agree with you. Listening more carefully [1] it seems like the center speaker is mapped to the right speaker (is there a center-speaker anyway?) and the sub-woofer isn't producing any sound. However, via headphones-plug the external sub-woofer plays the "bass" sound which is in the "sound test" video (link below).

Nikos

[1] http://www.youtube.com/watch?v=6H6a-qN9fYk&feature=related

P. Dunbar (vigilcode) wrote :

Center is both speakers same time and that is what it is doing on mine.

Yes and it would be nice to hear the "bass" sound even if there was no subwoofer. Let me try this in macOS and see if I hear the bass.

P. Dunbar (vigilcode) wrote :

I get no output from the subwoofer portion of the test within macOSx too.

Sorry, P. Dunbar, I can't verify you this time :-(.

I booted in OSX (after so long, I forgot how it looks like ;-p ) and played the demo: I barely hear something... but there is something contrary to Jaunty where I don't hear anything.

Nikos

Alex Murray (alexmurray) wrote :

P. Dunbar - The reason you need to manually specify the model=mb5 is that Kacper hasn't added the model number for MBP5,2 to the driver - only MBP5,1 - if you could provide the output of 'cat /proc/asound/card0/codec#0' then we can add it to the patch.

If the behaviour with the YouTube Dolby Test is the same under Linux now as Mac OSX then I would say this bug is fixed by this patch.

Alex Murray (alexmurray) wrote :

Whoops just noticed you already posted it - I've attached an updated form the of the patch with the MBP5,2 model in it too now, so no-one should need to manually specify the model as mb5.

P. Dunbar (vigilcode) wrote :

Thanks Alex, I tried that patch in a clean extract of alsa and get this:
patching file pci/hda/patch_realtek.c
Hunk #1 FAILED at 200.
Hunk #2 FAILED at 5939.
Hunk #3 FAILED at 6080.
Hunk #4 FAILED at 6323.
Hunk #5 FAILED at 6703.
Hunk #6 FAILED at 6784.
Hunk #7 FAILED at 7094.
7 out of 7 hunks FAILED -- saving rejects to file pci/hda/patch_realtek.c.rej

Do i need the other patch first then this one? Or am i missing something else?

Matteo Dell'Amico (della) wrote :

P. Dunbar: you probably used "patch -p2" to patch your data. Try using "patch -p1".

P. Dunbar (vigilcode) wrote :

thanks that was it. sound working without anything in options now on the mbp5,2.

Jim Rorie (jfrorie) wrote :

Is anyone else having problems with the volume control being set to 0 and mute after every reboot...er shutdown? I didn't see this before the patch. I can set everything to max, shut down and it still comes back up at 0 and muted.

Various issues:

1. I think I have to prove myself wrong about hearing the bass (sub-woofer)[*]. I tried to cross-check by observing the volume meter (in pavucontrol) and no change of the volume-meter appears when the bass is played.

2. I can confirm Jim Rorie's observation. But only for the past days and _not_ today !?

3. When I play a video in youtube sometimes sound get's muted. Then I need to play some sound via VLC _and_ play with the Master, PCM, Front volume adjustments to re-activate the sound. All other players (like Totem) fail. It's a weird issue...

Question:
Is there any difference in the sound-system if pulse is installed (e.g. pavucontrol, pavumeter)?

Cheers, Nikos

[*] http://www.youtube.com/watch?v=6H6a-qN9fYk&feature=related

P. Dunbar (vigilcode) wrote :

1. I don't really hear sub from macosx either so not sure about this one still. I do think we *should* hear it but if it isn't in macosx not sure what needs fixing.

2. I don't have this issue, yet. I turn on and shutdown twice a day and sound is at levels I set everytime. Could be an affect of something other package you installed?

3. I don't have this issue either. As #2 maybe you installed something that is effecting it?

Kacper (kacper3-14) wrote :

I was playing http://www.youtube.com/watch?v=6H6a-qN9fYk over and over on Ubuntu and Mac OS.
The problem was that basses came only from the right side. To get proper sound we need to separate Front and Center/LFE
DACs. I've updated the patch to support 6ch + HP.

Unfortunately PulseAudio and FlashPlayer use ony 2 channels by default. Instructions are on the wiki.

kacper

Jim Rorie (jfrorie) wrote :

Unfortunately, I haven't had a 6 channel option since the alsa update patch. Preference doesn't show me a channels checkbox to enable it.

P. Dunbar (vigilcode) wrote :

Weird I have the 6 channel option. Have had it whole time even with the patches...

Kacper, you mentioned you updated the patch, but the wiki link didn't change for the patch. Is it the same one?

Count me to the "missing the 6th channel" group ;-p
I' ll try, hopefully today, the new patch and report back.

I' ve just recompiled and followed the wiki step-by-step. After (re-)booting I got an informative message saying that I had to execute "asoundconf set-default-card" [1]. Further, bad news are:

* No 6th channel available

* No sound from any speaker but external sound system via Headphone plug

* pavucontrol (Pulse Audio Volume Control) responds with: "Connection failed: Connection refused". So there is no way to play with it

Can anybody confirm that the latest patch its working under MBP5,1?
Nikos

---
[1] http://www.imageshack.gr/view.php?file=v8e8v7jtcbamey1cq9c1.png

Kacper (kacper3-14) wrote :

To make things clear. The patch is updated what simply means that new
code is added
so you need to repeat Alsa patch steps. (link didn't change)

reboot. run alsamixer and check if you have surround and LFE. If not
you are still
using wrong modules (mbp3 or old patch). Otherwise you will also have
Channel Mode, select 6.

try speaker-test -Dsurround51 -c6

you should be able to hear front-left, front-right and LFE. If so you
can follow the
instructions and update alsa and pulse config.

double checked, works perfect.

Download full text (11.4 KiB)

Kacper ,

thank you for your time. I have sound but sometimes after playing a youtube video music stops playing from totem, etc. Below is what I am doing and what the "problems" are.

Nikos
###

# get alsa source code
wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.19.tar.bz2

[...]
2009-05-15 13:33:30 (860 KB/s) - `alsa-driver-1.0.19.tar.bz2' saved [2896328]

# get patch (written by Kacper Szczesniak)
wget http://launchpadlibrarian.net/26521394/alsa-driver-1.0.19-mb51.patch

[...]
2009-05-15 13:33:36 (147 KB/s) - `alsa-driver-1.0.19-mb51.patch' saved [4486/4486]

# unpack alsa source code
tar jxf ./alsa-driver-1.0.19.tar.bz2

# move patch in alsa source code directory
mv ./alsa-driver-1.0.19-mb51.patch ./alsa-driver-1.0.19

# apply the patch
patch -p1 < ./alsa-driver-1.0.19-mb51.patch

patching file alsa-kernel/pci/hda/patch_realtek.c

# compile source code
  ## configure
./configure

[...]
config.status: creating version
config.status: creating Makefile.conf
config.status: WARNING: Makefile.conf.in seems to ignore the --datarootdir setting
config.status: creating snddevices
config.status: creating utils/alsa-driver.spec
config.status: creating utils/buildrpm
config.status: creating toplevel.config
config.status: creating utils/alsasound
config.status: creating utils/alsasound.posix
config.status: creating include/pci_ids_compat.h
config.status: creating include/i2c-id_compat.h
config.status: creating include/config.h
config.status: creating include/config1.h
config.status: creating include/version.h
config.status: include/version.h is unchanged
config.status: creating include/autoconf-extra.h
Hacking autoconf.h...

  ## compile
make

[...]
ALSA modules were successfully compiled.

  ## install
sudo make install

[...]
WARNING!!! The mixer channels for the ALSA driver are muted by default!!!
**************************************************************************
You would use some ALSA or OSS mixer to set the appropriate volume.

# check /etc/modprobe.d/options
cat /etc/modprobe.d/options

options hid_apple fnmode=2

# rebooting...

###########
# After booting...
###########

# running alsamixer from the Terminal
alsamixer

alsamixer: function snd_ctl_open failed for default: No such device

# checking gui volume control [a]
# screenshot attached ## more (ir)relevant screenshots [b][c]
# note: all "tracks" under Preferences are selected

###
[a] http://www.imageshack.gr/view.php?file=aphdfom34nm9mtjy5jsy.png
[b] http://www.imageshack.gr/view.php?file=ls63elst28433vmbvl15.png
[c] http://www.imageshack.gr/view.php?file=ef9glyvvp80ajr2693at.png
###

# speaker-test
speaker-test -Dsurround51 -c6

speaker-test 1.0.18

Playback device is surround51
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
I: caps.c: Dropping root privileges.
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
ALSA lib confmisc.c:768:(parse_card) cannot find card 'Nvidia'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA li...

Kacper (kacper3-14) wrote :

> thank you for your time. I have sound but sometimes after playing a
> youtube video music stops playing from totem, etc.
this is because flashplayer uses alsa directly (not pulse audio).

It can be solved by redirecting default alsa device to pulse. It's included
in my asound.conf (see wiki). But remember that this will not work on AMD64
unless you manually upgrade flashplayer to true 64bit version (see wiki).

> # get patch (written by Kacper Szczesniak)
> wget http://launchpadlibrarian.net/26521394/alsa-driver-1.0.19-mb51.patch
someone changed address on the wiki :/ it should be:
http://qwe.pl/~kacper/alsa-driver-1.0.19-mb51.patch

kacper

OK, getting the patch from the _valid_ link gives following:

# attempting to patch
patch -p1 < ./alsa-driver-1.0.19-mb51.patch

can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Nrup ./alsa-driver-1.0.19/alsa-kernel/pci/hda/patch_realtek.c ./alsa-driver-1.0.19-mb51/alsa-kernel/pci/hda/patch_realtek.c
|--- ./alsa-driver-1.0.19/alsa-kernel/pci/hda/patch_realtek.c 2009-01-19 12:08:58.000000000 +0100
|+++ ./alsa-driver-1.0.19-mb51/alsa-kernel/pci/hda/patch_realtek.c 2009-05-15 00:26:42.000000000 +0200
--------------------------
File to patch:

Kacper (kacper3-14) wrote :

2009/5/15 Νίκος Αλεξανδρής <email address hidden>:
> OK, getting the patch from the _valid_ link gives following:
>
> # attempting to patch
> patch -p1 < ./alsa-driver-1.0.19-mb51.patch
-p2

kacper

Kacper,

great _and_ thank you for your patience.

* 6th channel option is available
* LFE and HP tracks are available (the HP replaced the Line-Out I suppose)

One note though: if I put the Front Volume track to zero (not muted) I still hear sound from center, right and right surround. Only the "lefties" are left-out :-) Is this expected?

Nikos

What I can't understand is why now Totem doesn't play music while Audacious and VLC do play fine. Anyway, sound system still is complex to get it working properly in other machines as well (as far as I read in various posts in ubuntu-forums).

Kacper (kacper3-14) wrote :

> * 6th channel option is available
> * LFE and HP tracks are available (the HP replaced the Line-Out I suppose)
yes

> One note though: if I put the Front Volume track to zero (not muted) I
> still hear sound from center, right and right surround. Only the
> "lefties" are left-out :-) Is this expected?
This means that application that produces sound opened Alsa with
2 channels, so Front-Right was cloned to LFE.

I have 64bit flash plugin and configuration described on wiki. After
muting/setting 0
Front I hear both left and right low freqs from LFE.

kacper

Kacper (kacper3-14) wrote :

2009/5/15 Νίκος Αλεξανδρής <email address hidden>:
> What I can't understand is why now Totem doesn't play music while
> Audacious and VLC do play fine. Anyway, sound system still is complex to
> get it working properly in other machines as well (as far as I read in
> various posts in ubuntu-forums).
you can check which app "blocks" alsa with
sudo lsof | grep snd/
normally only pulseaudio and mixer_app should be listed

# I removed pulseaudio (pavucontrol, etc.)
sudo lsof | grep snd/

lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/nik/.gvfs
      Output information may be incomplete.
mixer_app 4486 nik 23u CHR 116,0 5068 /dev/snd/controlC0

Kacper (kacper3-14) wrote :

009/5/15 Νίκος Αλεξανδρής <email address hidden>:
> # I removed pulseaudio (pavucontrol, etc.)
> sudo lsof | grep snd/
>
> lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/nik/.gvfs
>      Output information may be incomplete.
> mixer_app 4486        nik   23u      CHR              116,0                5068 /dev/snd/controlC0
this was taken when totem was unable to play audio? seems fine

kacper

@Kacper

Yep, still Totem doesn't give any sound (note: the file-song seems to be played, e.g. time-bar and visualisation effects work).

Matteo Dell'Amico (della) wrote :

I have a similar situation as Nikos has, with no sound for Flash (YouTube videos) and Rhythmbox working properly instead. When running Firefox from the terminal, I get

ALSA lib pulse.c:272:(pulse_connect) PulseAudio: Unable to connect: Connessione rifiutata (i.e., "Connection refused")

Doesn't seem deterministic, in the sense that it starts working, but at some time it stops.

Alper KANAT (tunix-raptiye) wrote :

I'm using Arch Linux and have a Macbook Pro 5.1.. I was trying to get your patch working for the whole day... (since alsa-driver comes with kernel26 package in Arch Linux) any way, i was told to compile the modules instead of compiling the whole kernel which saved me loads of trouble..

Your patch seems to work fine for me.. But there seems to be some stuff that need to be polished:

1) i don't notice the difference btw. 2 and 6 channels

2) adjusting master, pcm levels are acting weirdly. if i lower master i can't hear anything when it's near some value of %50.. same for pcm..

3) sound splutters when too high which i don't remember in OS X..

but your work made my day (today is my birthday btw) as a great present.. i've deleted OS X completely from my computer and am trying to configure non-working stuff.. thank you guys!

Is there really a difference between the alsa-driver 1.0.19 patch and using the 1.0.18 alsa-base that's in the repositories with the mbp3 set as model in /etc/modprobe.d/

I'm using the mbp3 option with a MBP5,2 and the sound works fine. However it is still quiet on the speaker, much quieter than in Mac OS X. I've used also the patched 1.0.19 version and there didn't seem to be any difference, just that no option needed to be set in /etc/modprobe.d/

Furthermore, kacper, you patch isn't in the alsa tree, it seems to me, also wouldn't it make more sense to patch the current 1.0.20 tree?

Alper KANAT (tunix-raptiye) wrote :

I've applied it to 1.0.20 tree btw.. It works fine on Arch Linux with a few exceptions I've mentioned 2 comments earlier..

In the meantime, I've patched the 1.0.20 tree as well. Works in Ubuntu Jaunty.

The only snag (minor) I have, is that after some other changes, not associated with Alsa, which I can't retrace, the sound is muted now always upon reboot and I have to manually increase the volume.

Anyone also experience the remuting of sound?

Matteo Dell'Amico (della) wrote :

Another small issue: with the headphones plugged, the main volume control does not have effect on headphones. To raise/lower volume for headphones, the only things that seems to be working is 'HP'.

Chris Lasher (chris.lasher) wrote :

I get a noticeable amount of oscillating noise from the headphones now, using the patch against ALSA 1.0.19, and following the instructions on the wiki for using PulseAudio with 6 channel sound. The oscillating noise goes away when I mute the HP channel. However, when I mute it, I can hear a steady tone. If I slide the volume sliders up and down for the HP channel, the pitch will change (randomly, not directly or inversely).

Additionally, the internal mic does not seem to work for me. Whenever I open Volume Control and go to the recording tab, the channel is always shown with a muted mic button. I unmute it and try to record with GNOME Sound Recorder, but it doesn't record anything.

Chris Lasher (chris.lasher) wrote :

On further exploration, it seems that each level of the channel has its own peculiar noise. The oscillation is at level 0, but the following levels are extremely noisy: 8, 17, 27, 36, 45, 55, 64, 73, 83, 92. It's reproducible to get the noise on each of these levels.

I did not experience this noise before the patch, using the default ALSA that shipped with Jaunty, and the option of snd_hda_intel model=mbp3.

Kacper (kacper3-14) wrote :

hi!

strange, no one else have reported this kind of problem. Is it Pro?
Please send me output of: cat /proc/asound/card0/codec#0

kacper

Chris Lasher (chris.lasher) wrote :

Sorry, I should have specified, this is a MacBook 5.1 (aluminum unibody).

Matteo:
"...
To raise/lower volume for headphones, the only things that seems to be working is 'HP'.
"

Matteo, IIUC, this was Kacper's intention. But I still did not decode the acronym HP (=?) :-)

The "issue" that I see with respect to the headphones plugin, is that the laptop's speakers _don't_ get automatically muted when plugging-in external speakers/headphones. This desirable I suppose when ones wants to use... well, headphones.

Kindest regards, Nikos

...maybe HP = HeadPhones ;-)

Matteo Dell'Amico (della) wrote :

Nikos: the main volume control should have effect also on headphones. It turns out it doesn't.

"Matteo:
the main volume control should have effect also on headphones. It turns out it doesn't."

Right! I thought by _adding_ ( in the selected channels) the HP channel under Sound Preferences > Devices in the "Default Mixer Tracks" section, would fix it but not really.

Thanks, Nikos

Chris Lasher (chris.lasher) wrote :

Is anyone else experiencing the noise issue on the headphones?

Well... I hear some noise but only at _some_ levels. Didn't take the time to identify them but playing around with the volume there is noise coming and going at certain levels. All this when I turn the external speakers at 100% and adjusting from 0 to 100 the HP track.

Nikos

Matteo Dell'Amico (della) wrote :

I confirm the noise issue with headphones. I can hear the noise on all levels, stronger on some of them. It seems to me it stops as long as some sound is playing though.

Chris Lasher (chris.lasher) wrote :

@Matteo I noticed this, too, but I think it's really just getting masked by loud-volumed music.

Also, does anybody have the internal mic working?

Does anyone know if the chipset has a software controllable noise gate?

> Also, does anybody have the internal mic working?
I do

kacper

Chris Lasher (chris.lasher) wrote :

>>> Also, does anybody have the internal mic working?
> I do

http://ubuntuforums.org/showthread.php?t=1158304
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/337314/comments/91

So, Kacper, you can confirm that you can record audio from the internal mic using GNOME Sound Recorder? And this is for a MacBook 5.1, correct? Is there some way we can compare settings to determine what's different between your configuration and mine such that I am unable to use the internal mic?

I am using 64-bit Ubuntu--is this a difference? I'm using the setup as per the wiki. There is a notable difference: I do not see "Front Mic" as an option for Input Source. My options are "Mic", "Line", and "CD".

My channel mode is set to 6, if that makes any difference.

Do I need to split this out to a separate bug?

Kacper (kacper3-14) wrote :

> So, Kacper, you can confirm that you can record audio from the internal
> mic using GNOME Sound Recorder? And this is for a MacBook 5.1, correct?
Yes I can. Yes this is MacBook 5.1

> Is there some way we can compare settings to determine what's different
> between your configuration and mine such that I am unable to use the
> internal mic?
/etc/asound.state attached

> I am using 64-bit Ubuntu--is this a difference? I'm using the setup as
so do I
> per the wiki. There is a notable difference: I do not see "Front Mic" as
> an option for Input Source. My options are "Mic", "Line", and "CD".
> My channel mode is set to 6, if that makes any difference.
it's ok

kacper

Chris Lasher (chris.lasher) wrote :

Thanks Kacper. I'm not sure how to load that file. I found I have an asound.state file under /var/lib/alsa/asound.state so I'm attaching that file. diff shows a number of (possibly important?) differences at the end, but I don't understand what they mean.

Kacper (kacper3-14) wrote :

On Wed, Jun 3, 2009 at 10:50 PM, Chris Lasher <email address hidden> wrote:
> Thanks Kacper. I'm not sure how to load that file.
alsactl -f /path/to/my/asound.state restore

I loaded your config and PCM had 0 volume. After setting it correctly
I could record
and hear myself.

kacper

Chris Lasher (chris.lasher) wrote :

Still no luck, restoring from your settings Kacper:

$ alsactl -f asound.state restore
Unknown hardware: "HDA-Intel" "Realtek ALC889A" "HDA:10ec0885,106b3f00,00100103" "" ""
Hardware is initialized using a guess method
alsactl: set_control:1266: failed to obtain info for control #32 (No such file or directory)
alsactl: set_control:1266: failed to obtain info for control #33 (No such file or directory)

I get nothing when recording, sliding the sliders up and down, clicking the little mic icon to supposedly mute/unmute the mic, just nothing. When I close and re-open Volume Control, all the mic channels are shown with the muted mic icon, too, just as I mentioned in the forum thread linked to above. Something's inconsistent between our setups. Is there any more information I can give to help pick out what's going wrong? Are there any files I can delete to restore to defaults?

Chris Lasher (chris.lasher) wrote :

Here is the output of `cat /proc/asound/card0/codec#0` after running `alsactl -f asound.state restore`.

Kacper (kacper3-14) wrote :

On Thu, Jun 4, 2009 at 3:43 AM, Chris Lasher <email address hidden> wrote:
> Here is the output of `cat /proc/asound/card0/codec#0` after running
> `alsactl -f asound.state restore`.
>
> ** Attachment added: "Updated output of cat /proc/asound/card0/codec#0"
>   http://launchpadlibrarian.net/27477499/asound_codec.txt
It's pretty clear why it's not working... It's totally different PIN
assignment :/ It seems that you have
2 Mics at other PIN's than I and other folks have (we have one). Are
you sure that this is MacBook 5.1?
When was it purchased?

kacper

Ricky Campbell (cyberdork33) wrote :

Go here to get and verifiy your ID string:
https://wiki.ubuntu.com/MactelSupportTeam/CommunityHelpPages

Also, let's make sure that we are all talking about the MacBook and not the MacBook Pro...

Chris Lasher (chris.lasher) wrote :

$ sudo dmidecode -s system-product-name
MacBook5,1

See also my numerous bug reports against MacBook 5.1:
https://bugs.launchpad.net/~chris.lasher?field.searchtext=macbook

It is a refurbished MacBook 5.1 2.4GHz Intel Core 2 Duo purchased February this year.

Chris Lasher (chris.lasher) wrote :

Sorry, that last comment came off snappy. Thanks for looking into this Kacper. I would have never figured that out on my own. I guess the questions are: is it different because it's a refurb, or is it different because it's a model from a different manufacturing age than everyone else who's reported?

Perhaps the better question is, can a workaround be written, in the event the chipset is of this design, rather than the design of yours? I would presume Apple didn't single me out, and that there must be other MacBooks (5.1) out there with the same hardware as mine.

Ricky Campbell (cyberdork33) wrote :

Yes, I was pretty sure about yours Chris... I have a feeling that Kacper might have a 5,2... and if not, it wouldn't be the first time we have found different hardware operation within a specific model version.

Alper KANAT (tunix-raptiye) wrote :

Hey There,

I'm using Arch Linux but following this thread for any upcoming patches/solutions.

$ sudo dmidecode -s system-product-name
MacBookPro5,1

My microphone works fine. I'm currently developing a software that uses Flash to communicate and I can use my internal mic with it without any problems.

I have some low noise when I plugin earphones. But as others have said, it's masked when I higher the music volume.

I currently have the following problems:

* Mixer controls acts strange. GNOME lowers/raises the Master and PCM levels despite I selected only one.

* When I plugin my earphones, I've to lower the volume to something around 10-15% because the volume is too high.

I only use ALSA.. I don't have OSS or PulseAudio..

Kacper (kacper3-14) wrote :

> Perhaps the better question is, can a workaround be written, in the
> event the chipset is of this design, rather than the design of yours? I
> would presume Apple didn't single me out, and that there must be other
> MacBooks (5.1) out there with the same hardware as mine.
Mine is non-pro 5.1 too... it's strange because even P.Dunbar's Pro
5.2 has similar layout to mine.
We need to create another model to cover your configuration. The
problem is that you've got the
same Subsystem Id as we do. So it can't be auto-detected. I can try to
blindly code it during the
weekend but it'll be hard to debug... Do you have sound output? Is mic
your only problem?

kacper

Chris Lasher (chris.lasher) wrote :

> Do you have sound output? Is mic your only problem?

I do have sound output, although sometimes it gets "stuck" off until I twiddle with the volume controls (usually needing to crank the volume up until it crackles on). The two more important issues are no mic and noise in the headphone channel (confirmed by Nikos and Matteo above).

Chris:
> I do have sound output, although sometimes it gets "stuck" off until I twiddle with the volume controls (usually needing to crank the volume up until it crackles on).

Yep, I have experienced that two but not anymore. I did use "skype" and "Cheese" successfully (sound is transmitted/recorded). But no way to use at the same time "skype" with "Totem Movie Player". I guess this is a job for Pulse Audio which I can't get it working.

(
sorry for the, perhaps, misleading typo: "...that too..." I wanted to write
)

Chris Lasher (chris.lasher) wrote :

So typically on most laptops, when the headphone plug is inserted into the headphone jack, sound to the internal speakers is cut off and plays through only the headphones. (This is the behavior in OS X, for example, and I believe it was also the 8.10 behavior.) I thought this was implemented in hardware, but apparently it's implemented by the sound driver, as Kacper's patch demonstrates. I think someone else already requested this above, but would it be possible to have a patch that mutes the internal speakers when headphones are inserted?

Also, and I believe this was also mentioned above, could we have a patch where Master controls the volume of the headphone output, too? Of course, this would only be useful if the above muting of speakers was implemented, as well.

Kacper, are you the only developer working on this? Is anyone else involved with the ALSA project looking into this?

Gagi (dragoljub) wrote :

Hi Everyone!

I'm running a MacBook Pro 17" 5.2

I have used the latest patch with both the -p1 and -p2 options and in both cases no sound comes out of the computer speakers. I do however have full 5.1 sound as played by this video http://www.youtube.com/watch?v=6H6a-qN9fYk coming from the headphone jack.

Any idea why my speakers are not working at all?

Thanks!

Gagi (dragoljub) wrote :

Just thought I would respond with my status.

Currently I have both speakers working on my MacBook Pro 17" 5.2!

The problem for me was that LINE OUT volume had to be maximized!

I ended up running alsamixer, tabbing through until I was viewing all options and maximized line out.

After checking with 5.1 surround sound tests My speakers are displaying correctly, however the alsa speaker test has them only producing output on rear left and rear right.

The sound is also quite low, requiring almost full volume and allowing very little useful adjustment range.

But bottom line 5.2 MBP 17" speakers work, although not perfectly!

P. Dunbar (vigilcode) wrote :

Someone had asked if there was a difference between the alsa-driver 1.0.19 patch and using the 1.0.18 alsa-base that's in the repositories with the mbp3 set as model in /etc/modprobe.d/?
I'm not sure if sound quality or anything improved. Was it supposed to?

Also I've had my sound muted for the past 2 weeks or so and now when I unmute it I still have zero sound. I was going to re-follow the wiki to patch alsa 1.0.19 and see if just re doing it got sound working again but does anyone see any benefit in just trying the already patched 1.0.20?

Alper KANAT wrote on 2009-05-17: (permalink)

I've applied it to 1.0.20 tree btw.. It works fine on Arch Linux with a few exceptions I've mentioned 2 comments earlier..

So if I can/should try 1.0.20 where is the already patched download for it?

Also if this new version is in Karmic will it make its way to Jaunty backports? I wonder if my sound broke because of some repo update while I had the patched version of alsa.

Jim Rorie (jfrorie) wrote :

>Also I've had my sound muted for the past 2 weeks or so and now when I unmute it I still have zero sound. I was going >to re-follow the wiki to patch alsa 1.0.19 and see if just re doing it got sound working again but does anyone see any >benefit in just trying the already patched 1.0.20?

I thought I was the only one. I'm completely broken too. The headphones don't even work. I didn't change anything, I just installed updates. I'm thinking something came down the pipe that knocked us out.

Chris Lasher (chris.lasher) wrote :

If you updated your kernel in Jaunty, you will have to re-install the ALSA modules with another round of `sudo make install`. Also, see my note above that I have to move the "Master" channel up until sound finally crackles on for the rest of the system, including the headphones.

Note that this patch still doesn't work perfectly for me, since apparently my soundcard has "a different PIN assignment"; e.g., I'm getting noise in the headphones and my internal mic doesn't work.

Jim Rorie (jfrorie) wrote :

Got it working again. I don't think the kernel got updated. Were any alsa patches pushed out?

FYI, I needed to:

make clean
./configure
make
sudo make install

The "sudo make install" by itself didn't work. Apparently, I was all boogered up. =0

P. Dunbar (vigilcode) wrote :

yea redid and its working again.
I have every vol. slider at max. The master then adjusts the vol but from about half way down the vol is too low to hear. it really is just from halfway up that is adjustable.

Also where could I try 1.0.20 with what patch?

any chance of this getting into a package so other updates like to the kernel don't keep making us have to re build this and install it.

Chris Lasher (chris.lasher) wrote :

Would someone who has a patched version of this driver installed and working (e.g., the internal mic works) please post the output of

cat /proc/asound/card0/codec#0

for me? I need to see how my sound card model differs in terms of pins, as Kacper suggested.

Alper KANAT (tunix-raptiye) wrote :
Download full text (11.2 KiB)

Hey There Chris,

I'm on Arch Linux with the patched driver, here is my output of that command:

Codec: Realtek ALC889A
Address: 0
Function Id: 0x1
Vendor Id: 0x10ec0885
Subsystem Id: 0x106b4000
Revision Id: 0x100103
No Modem Function Group found
Default PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
GPIO: io=2, o=0, i=0, unsolicited=1, wake=0
  IO[0]: enable=1, dir=1, wake=0, sticky=0, data=1, unsol=0
  IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Node 0x02 [Audio Output] wcaps 0x11: Stereo
  Converter: stream=5, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x03 [Audio Output] wcaps 0x11: Stereo
  Converter: stream=5, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x04 [Audio Output] wcaps 0x11: Stereo
  Converter: stream=5, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x05 [Audio Output] wcaps 0x11: Stereo
  Converter: stream=5, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Node 0x06 [Audio Output] wcaps 0x211: Stereo Digital
  Converter: stream=0, channel=0
  Digital:
  Digital category: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0x1e]: 16 20 24 32
    formats [0x1]: PCM
Node 0x07 [Audio Input] wcaps 0x10011b: Stereo Amp-In
  Amp-In caps: ofs=0x10, nsteps=0x2e, stepsize=0x03, mute=1
  Amp-In vals: [0x2e 0x2e]
  Converter: stream=0, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Connection: 1
     0x24
Node 0x08 [Audio Input] wcaps 0x10011b: Stereo Amp-In
  Amp-In caps: ofs=0x10, nsteps=0x2e, stepsize=0x03, mute=1
  Amp-In vals: [0xae 0xae]
  Converter: stream=0, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Connection: 1
     0x23
Node 0x09 [Audio Input] wcaps 0x10011b: Stereo Amp-In
  Amp-In caps: ofs=0x10, nsteps=0x2e, stepsize=0x03, mute=1
  Amp-In vals: [0xae 0xae]
  Converter: stream=0, channel=0
  SDI-Select: 0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Connection: 1
     0x22
Node 0x0a [Audio Input] wcaps 0x100391: Stereo Digital
  Converter: stream=0, channel=0
  SDI-Select: 0
  Digital:
  Digital category: 0x0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0x1e]: 16 20 24 32
    formats [0x1]: PCM
  Unsolicited: tag=00, enabled=0
  Connection: 1
     0x1f
Node 0x0b [Audio Mixer] wcaps 0x20010b: Stereo Amp-In
  Amp-In caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1
  Amp-In vals: [0x97 0x97] [0x80 0x80] [0x1f 0x1f] [0x97 0x97] [0x97 0x97] [0x9f 0x9f] [0x97 0x97] [0x97 0x97] [0x97 0x97] [0x97 0x97]
  Connection: 10
     0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x14 0x15 0x16 0x17
Node 0x0c [Audio Mixer] wcaps 0x20010f: Stereo Amp-In Amp-Out
  Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-...

P. Dunbar (vigilcode) wrote :

has anyone tried this here:
http://ubuntuforums.org/showpost.php?p=7627817&postcount=98

my sound still is choppy and staticy at startup and ever since i tried skype and then removed it I get a high pitched beep at startup (plus the normal startup sounds). So I keep looking for any improvements.
If i use that alsa would I then have to specify my model again cause it won't have the patch in this thread?

Chris Lasher (chris.lasher) wrote :

Dunbar, I didn't install it, but I did look through the code of that ALSA snapshot. It simply includes the patches from Kacper (they have made it into mainline code of ALSA, apparently). You will not have to manually specify your model.

pepe (sf-cbg) wrote :

Another MBP 5.2 owner here, using Debian unstable with legacy bios boot, amd64, alsa-driver 1.0.20 and patch posted above.

I did not get pulseaudio to work and I commented out the stuff in /etc/asound.conf again. My left+right HP speakers both work fine anyway. However,

- I also have the noise reported by Chris Lasher above, even though mic/line are muted and gain is minimal.
- The PCM and Master controls only work for speakers, not for HP.
- With mpd, I have to reduce the gain of the HP to about 0% to be comfortable, and 20 is pretty loud already. Using alsamixer, all other settings muted or 0%
- With mplayer, loudness-levels seem more normal. PCM mixer works. Both, mpd and mplayer are run with alsa. However, I can not unload snd_mixer_oss, that might be the culprit here..

Did you compare to PIN settings in windows?

Gionn (giovanni.toraldo) wrote :

With the latest Karmic build, both speakers works out of the box, but when I plug the headphone jack, internal speakers aren't muted and there isn't any control in alsamixer that I can mute.

Alper KANAT (tunix-raptiye) wrote :

Karmic build?

Jim Rorie (jfrorie) wrote :

Confirming Gionn's post. I can confirm that Beta has a working R,L, and LFE. HP plugin changes nothing and I'm not seeing a mixer capable of changing the various levels.

Hi Kacper,

The left speaker issue is gone in Karmic (good work!), but I thought you might have some insights into the remaining jack sense, and inline microphone issues I documented here:
  https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/488103

Thanks,

Alexey

Alex Murray (alexmurray) wrote :

I've developed a patch against alsa-driver-1.0.22.1 which should fix the headphone jack sense and volume control issues (which I've attached to this bug), which you can test as follows:

First make sure you don't have any versions of linux-backports-modules-alsa installed:

apt-cache --names-only search linux-backports-modules-alsa | cut -f 1 -d ' ' | xargs sudo apt-get remove --purge

Now download alsa driver source and the patch, and compile and install a patched version of the driver:

cd ~
wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.22.1.tar.bz2
wget http://dl.dropbox.com/u/174251/alsa-driver-1.0.22.1-mb5.patch
tar xjf alsa-driver-1.0.22.1.tar.bz2
patch -p0 < alsa-driver-1.0.22.1-mb5.patch
cd alsa-driver-1.0.22.1
./configure
make
sudo make install

Now you need to reboot your machine. If this works I'll push the patch upstream and hopefully we can get it applied to linux-backports-modules-alsa as well.

Alper KANAT (tunix-raptiye) wrote :

@Alex Murray: the patch seems to work which makes you the hero of the day! :) But here are some awkward things I've come up with (using Arch Linux - on Macbook Pro 5.1 - btw):

1) I don't know if this's related with the patch or not but alsaconf cannot found any sound cards, but the kernel seems to recognize and load all the necessary modules for the sound card

2) When headphones are plugged in, I've to mute and unmute the Headphone channel a few times in order to get sound from them. I don't know why this happens.

But all in all, the jack sense is working! :)

Alper KANAT (tunix-raptiye) wrote :

I needed to delete all lines inside /etc/modprobe.d/sound.conf btw because there were some error messages during boot process due to unrecognition of sound card indicating those lines.

Alex Murray (alexmurray) wrote :

Sounds like an Arch linux specific thing, worked fine for me in Ubuntu (unless anyone else can clarify)

Alper KANAT (tunix-raptiye) wrote :

@Alex Murray: do you have any specific configuration lines defined in /etc/modprobe.d/* ? have you tried muting headphone channel while headphones are plugged in? you would have to unmute and mute a few more times in order to get back the sound..

Alex Murray (alexmurray) wrote :

Muting headphones whilst plugged in works fine - ie. they unmute perfectly fine.

Ubuntu provides a /etc/modprobe.d/alsa-base.conf which I have not modified - I've attached it here.
Thanks for testing the patch, I've submitted it to alsa-devel (http://mailman.alsa-project.org/pipermail/alsa-devel/2010-January/024465.html)

If the patch has been tested and is known to work, then I'll send this upstream, unless of course Alex has done that already...

Luke Yelavich (themuso) wrote :

Never mind, I see your patch is now in the alsa sound-2.6 git tree.

Alex Murray (alexmurray) wrote :

Thanks Luke - any chance this can get rolled into ubuntu-backports-modules-alsa? Or applied to the 2.6.32 kernel for lucid?

pepe (sf-cbg) wrote :

Thanks for the patch alex.

I appear to have a slightly different chip than most other MBP 5.2 owners but your mb5 model works quite well. Except for the background noise on the headphones, which some other guy also complained about earlier. In Windows the PINs are totally different from the alsa configuration and there is no noise. I tried to replicate this configuration in alsa but got no sound at all. Surround/LFE/Center are also dead.

Anyways, when pushing this upstream maybe you can also merge the attached patch to recognise my chip.

Its from a 17" MBP from about July 2009.

Alex Murray (alexmurray) wrote :

@pepe - have already pushed it upstream but I'll send your patch upstream as well.

Alex Murray (alexmurray) wrote :

@pepe - can you post the output from /proc/asound/card0/codec#0 since the values you've provided look a little suspect and I just want to confirm the patch it correct

pepe (sf-cbg) wrote :

Yes, there's definitly something fishy about this..

Using just your patch, it will not autodetect without reboot, even if I unload all alsa modules. So I used printk to extract the values it tries to match, patch, recompile, install, reload, and then it works. But now I noticed that without this modification, normal reloading also works after it was rebooted once. Whats that about?

Codec: Realtek ALC889A
Address: 0
Function Id: 0x1
Vendor Id: 0x10ec0885
Subsystem Id: 0x106b4600
Revision Id: 0x100103

Alex Murray (alexmurray) wrote :

Your patch is not needed as you have the same subsystem id as already exists in patch_realtek.c - not sure why it didn't work before.

Brad Figg (brad-figg) on 2010-03-11
tags: added: apple
Brad Figg (brad-figg) on 2010-03-26
tags: added: kj-triage needs-required-logs no-sound-speakers
tags: added: sound-macbook
Brad Figg (brad-figg) wrote :

Please, if you are still having issues, test with the latest development release of Ubuntu. ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p alsa-base 337314

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds .

Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

Please let us know your results.

Changed in alsa-driver (Ubuntu):
status: New → Incomplete
Alex Murray (alexmurray) wrote :

This was partially fixed in Karmic and is now fully fixed in Lucid as well as the upstream kernel.

Changed in alsa-driver (Ubuntu):
status: Incomplete → Fix Released
Changed in alsa-driver:
status: Unknown → New
Dražen Lučanin (kermit666) wrote :

I am still affected by this bug (left speaker not working) in Oneiric on a MBP 8,1. I tried unmuting channels in ALSA mixer and adding the alsa-base.conf line (options snd-hda-intel model=mbp55), but nothing helps.

To post a comment you must log in.