Bug 21371

Summary: HDMI audio stops working when X starts
Product: xorg Reporter: paul <paul>
Component: Driver/intelAssignee: MaLing <ling.ma>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: haien.liu
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
X log with modedebug
none
please try the patch on your machine, thanks. none

Description paul 2009-04-24 02:09:31 UTC
Fully patched Fedora Core 10
Kernel: 2.6.30-rc3
xf86-video-intel-2.7.0
libdrm-2.4.9
$ xdpyinfo|grep X.Org
vendor string:    The X.Org Foundation
X.Org version: 1.5.3


Issue is that HDMI audio works until X starts. While X is running there is no sound. When X stops, I get sound again.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC888 Digital [ALC888 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 3: INTEL HDMI [INTEL HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I think device 1 is for S/PDIF, which I don't use.

I can play a .ogg file with:
$ ogg123 -d alsa -o dev:plughw:0,3 test.ogg

If I start X with init 5, I see the following message in dmesg
HDMI hot plug event: Presence_Detect=0 ELD_Valid=1
and sound stops.
When I stop X, I get the corresponding event:
HDMI hot plug event: Presence_Detect=1 ELD_Valid=1
and sound starts playing again.

$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.19.
$ lsmod|grep hdmi
snd_hda_codec_intelhdmi    14320  1
snd_hda_codec          62304  3 snd_hda_codec_intelhdmi,snd_hda_codec_realtek,snd_hda_intel
snd                    64920  14 snd_hda_codec_intelhdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq_dummy,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
$ lspci -nn|egrep -i 'audio|graph'
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07)
00:02.1 Display controller [0380]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a43] (rev 07)
00:1b.0 Audio device [0403]: Intel Corporation 82801I (ICH9 Family) HD Audio Controller [8086:293e] (rev 03)
Comment 1 MaLing 2009-04-26 18:08:21 UTC
hi paul,
Could you upload you xorg log file with modedebug option on?

thanks
maling
Comment 2 paul 2009-05-06 04:37:16 UTC
Created attachment 25542 [details]
X log with modedebug

Sorry for the delay - travelling.
Comment 3 MaLing 2009-05-10 00:51:36 UTC
Created attachment 25684 [details] [review]
please try the patch on your machine, thanks.
Comment 4 MaLing 2009-05-10 00:59:24 UTC
writting to HOT Plug Interrupt Detect Enable bit will generate an interrupt which is caught by audio driver ,but video driver's operation doesn't consider specified output as below.
    OUTREG(PORT_HOTPLUG_EN,
           temp |
           HDMIB_HOTPLUG_INT_EN |
           HDMIC_HOTPLUG_INT_EN |
           HDMID_HOTPLUG_INT_EN);

The above debug patch intends to handle corresponding output precisely, please try it on your machine.

Thanks
Ma Ling
Comment 5 paul 2009-05-10 01:31:36 UTC
Patch works. Fantastic, thanks!

There is a missing close brace in the patch.

Paul
Comment 6 Eric Anholt 2009-05-15 17:05:36 UTC
Pulled to 2.6.30:

commit 9d2949a4cdb77b9b5c243c79be6489d34d770c7c
Author: Ma Ling <ling.ma@intel.com>
Date:   Mon May 11 11:33:22 2009 +0800

    drm/i915: Set HDMI hot plug interrupt enable for only the output in question.
    
    We detect HDMI output connection status by writing to HOT Plug Interrupt
    Detect Enable bit in PORT_HOTPLUG_EN.  The behavior will generate a specified
    interrupt, which is caught by audio driver, but during one detection driver
    set all Detect Enable bits of HDMIB, HDMIC HDMID, and generate wrong
    interrupt signals for current output, according to the signals audio driver
    misunderstand device status. The patch intends to handle corresponding
    output precisely.
    
    It fixed freedesktop.org bug #21371
    
    Signed-off-by: Ma Ling <ling.ma@intel.com>
    Signed-off-by: Eric Anholt <eric@anholt.net>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.