Bug 16339 - ALC889 SPDIF intermittently working
Summary: ALC889 SPDIF intermittently working
Status: RESOLVED OBSOLETE
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-04 17:23 UTC by Daniel J Blueman
Modified: 2012-08-09 14:17 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.35-rc3
Tree: Mainline
Regression: No


Attachments
Output from 'alsa-info.sh' when SPDIF is working as expected (36.74 KB, application/octet-stream)
2010-07-04 17:41 UTC, Daniel J Blueman
Details
Output from 'alsa-info.sh' when SPDIF is not working as expected (36.72 KB, application/octet-stream)
2010-07-04 17:41 UTC, Daniel J Blueman
Details
Fix patch (3.80 KB, patch)
2010-07-05 15:03 UTC, Takashi Iwai
Details | Diff

Description Daniel J Blueman 2010-07-04 17:23:17 UTC
When booting 2.6.35-rc3 with HDA power save enabled, we see the optical SPDIF output intermittently working.

Disabling power saving in the kernel config makes it consistently work as expected.

Differences from the 'alsa-info.sh' script in both non-working and working cases show 'Pin-ctls: 0x40 OUT' in the working case, and 'Pin-ctls: 0x00' in the non-working case with the SPDIF pin complex node:

Node 0x1e [Pin Complex] wcaps 0x400300: Mono Digital
  Pincap 0x00000010: OUT
  Pin Default 0x01452120: [Jack] SPDIF Out at Ext Rear
    Conn = Optical, Color = Grey
    DefAssociation = 0x2, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Connection: 1
     0x06

Other times, when the SPDIF output is enabled and the power saving mode kicks in, it will be disabled, but not reenabled.
Comment 1 Daniel J Blueman 2010-07-04 17:41:14 UTC
Created attachment 27013 [details]
Output from 'alsa-info.sh' when SPDIF is working as expected
Comment 2 Daniel J Blueman 2010-07-04 17:41:41 UTC
Created attachment 27014 [details]
Output from 'alsa-info.sh' when SPDIF is not working as expected
Comment 3 Daniel J Blueman 2010-07-04 18:52:29 UTC
Looking at patch_realtek.c, it looks like there is nothing to enable the SPDIF pin complex in the verb array at alc880_pin_5stack_init_verbs, which would explain the non-deterministic state when the chip is brought out of sleep/power-down state.

We need:

{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{0x1e, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
Comment 4 Takashi Iwai 2010-07-05 14:53:59 UTC
OK, that's a problem indeed.
Could you try the patch below?  It'll restore the cleared pin controls.
Comment 5 Takashi Iwai 2010-07-05 15:03:57 UTC
Created attachment 27024 [details]
Fix patch
Comment 6 Takashi Iwai 2010-07-08 14:54:49 UTC
Ping.
Comment 7 Daniel J Blueman 2010-07-08 15:05:29 UTC
Ack. Just saw the mail and preparing to test your patch. Thanks, Takashi!
Comment 8 Daniel J Blueman 2010-07-08 22:16:57 UTC
Excellent - this addresses the bug, Takashi-san. I cross-checked both failing and non-failing cases with the patch a number of times, and it looks good for -rc5. Many thanks!

This has potential to address quite a lot of HDA power_save regressions people experience with this feature enabled, which I think has kept this good feature disabled in distros.

If you feel this will address a significant number of these cases, is it worth general heads-up LKML and eg kernel-team@lists.ubuntu.com for their evaluation?

Thanks again, Daniel
Comment 9 Daniel J Blueman 2010-07-08 22:23:29 UTC
late-night typos fixed:

If you feel this will address a significant number of these cases, is it worth a general heads-up on LKML and a quick post to eg kernel-team@lists.ubuntu.com for their evaluation?
Comment 10 Takashi Iwai 2010-07-09 06:59:39 UTC
Is power_save disabled on distros due to this bug?  I've never heard it, and if so, it's really a communication problem...

There are potential problems hit by this bug, but I think most people didn't notice, because it's mostly unused SPDIF or such pins.  Of course, more tests are welcome, though.

Anyway, I merged it now and it'll be included in the next pull request.

Thanks.

Note You need to log in before you can comment on or make changes to this bug.