Bug 32406 - nouveau fails to send hotplug event to ALSA hda hdmi audio
Summary: nouveau fails to send hotplug event to ALSA hda hdmi audio
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-15 02:53 UTC by James
Modified: 2015-02-27 00:51 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
mmio trace of the nvidia module while running "service gdm start" (403.21 KB, application/x-gzip)
2010-12-15 03:22 UTC, James
no flags Details
mmio trace of the nvidia module loading, and then starting X (850.38 KB, application/x-bzip)
2010-12-15 03:46 UTC, James
no flags Details

Description James 2010-12-15 02:53:47 UTC
The nvidia driver causes this event
[ 2250.800276] HDMI hot plug event: Pin=5 Presence_Detect=1 ELD_Valid=1
The nouveau driver fails to sent this event, and thus the ALSA driver fails to update its /proc/asound/card1/eld#1.0  and therefore does not output sound.
Comment 1 James 2010-12-15 03:22:10 UTC
Created attachment 41137 [details]
mmio trace of the nvidia module while running "service gdm start"

mmio trace of the nvidia module while running "service gdm start"
That is enough to should the needed messages
[ 4326.778126] HDMI hot plug event: Pin=5 Presence_Detect=1 ELD_Valid=0
[ 4351.695743] HDMI hot plug event: Pin=5 Presence_Detect=1 ELD_Valid=0
[ 4352.597993] HDMI hot plug event: Pin=5 Presence_Detect=1 ELD_Valid=1
Comment 2 James 2010-12-15 03:46:10 UTC
Created attachment 41138 [details]
mmio trace of the nvidia module loading, and then starting X

The previous trace did not seem to output anything useful.
This one is better.
Comment 3 James 2010-12-15 16:17:55 UTC
I tried the following and it worked:

I modified the patch. nv50_sor.c::nv50_sor_create(), remove the "|| dev_priv->chipset == 0xac" case so that nva3_audio_init is called for your card.

I now get the hotplug event, and the ALSA audio picks up the HDMI output.
I will test actual audio tomorrow.
Comment 4 James 2010-12-16 03:07:36 UTC
Update: It does not actually work from boot.
If you modprobe the nouveau module after boot, it works, if nouveau loads during boot up, it does not send the "hot plug" event.
Comment 5 James 2010-12-17 15:00:58 UTC
Further investigation has found the following:
1) The nouveau driver sets the correct gpio pins and the ALSA audio driver can see them set.
2) The hotplug event only happens when the state of the gpio pins changes.
3) The ALSA driver creates the hotplug event as a result of detecting the gpio pins change.
4) nouveau modules seems to load before the alsa module, so the hotplug event never gets created by the ALSA audio driver because it is not loaded.
5) If the nouveau driver is loaded after boot, the hotplug event is sent to ALSA and it works fine.
6) If the ALSA driver is loaded after boot, it detects the gpio pins settings and acts correctly and works fine.
7) The problem is only present if the nouveau and alsa module load at boot time.
I am investingating (7) next.
Comment 6 James 2010-12-18 09:23:23 UTC
I have found the problem.
nouveau tries to send the eld info in
nv50_audio_mode_set()

Unfortunately, this is sent before the audio driver is loaded.
It is then resent later.
If the ALSA audio driver is forced to try and read the eld data 3 times instead of just once, the eld data finally reaches the ALSA audio driver, and sound then works.
So, I now have a valid work around.
Some further investigation is needed to discover why the sending of eld data is so unreliable, requiring it to be sent multiple times.
Maybe some co-ordination between the nouveau driver and ALSA is required to ensure good delivery of the eld data, so that it is valid before setting the eld_valid GPIO.
Comment 7 torquil 2011-10-01 04:53:57 UTC
(In reply to comment #6)
> I have found the problem.
> nouveau tries to send the eld info in
> nv50_audio_mode_set()
> 
> Unfortunately, this is sent before the audio driver is loaded.
> It is then resent later.
> If the ALSA audio driver is forced to try and read the eld data 3 times instead
> of just once, the eld data finally reaches the ALSA audio driver, and sound
> then works.
> So, I now have a valid work around.
> Some further investigation is needed to discover why the sending of eld data is
> so unreliable, requiring it to be sent multiple times.
> Maybe some co-ordination between the nouveau driver and ALSA is required to
> ensure good delivery of the eld data, so that it is valid before setting the
> eld_valid GPIO.

I've just been trying to get HDMI audio to work, using the Nouveau driver, and I'm running into this ELD issue. Is there any progress on this issue so as to make it work "out of the box"?

Btw, I'm using Debian Sid with:

Linux 3.0.4
Nouveau x-driver: 1:0.0.16+git20110411+8378443-1+b2
libasound 1.0.24.1-4

on an Asis X5DID computer with:

lspci -vs 02:00.0
02:00.0 VGA compatible controller: nVidia Corporation GT216 [GeForce GT 320M] (rev a2) (prog-if 00 [VGA controller])
	Subsystem: ASUSTeK Computer Inc. Device 1312
	Flags: bus master, fast devsel, latency 0, IRQ 17
	Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
	Memory at e0000000 (64-bit, prefetchable) [size=256M]
	Memory at f6000000 (64-bit, prefetchable) [size=32M]
	I/O ports at dc00 [size=128]
	Expansion ROM at faf80000 [disabled] [size=512K]
	Capabilities: <access denied>
	Kernel driver in use: nouveau

and

lspci -vs 02:00.1
02:00.1 Audio device: nVidia Corporation High Definition Audio Controller (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 1312
	Flags: bus master, fast devsel, latency 0, IRQ 17
	Memory at faf7c000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: HDA Intel
Comment 8 Ilia Mirkin 2013-08-18 18:09:16 UTC
It appears that this bug report has laid dormant for quite a while. Sorry we haven't gotten to it. Since we fix bugs all the time, chances are pretty good that your issue has been fixed with the latest software. Please give it a shot. (Linux kernel 3.10.7, xf86-video-nouveau 1.0.9, mesa 9.1.6, or their git versions.) If upgrading to the latest isn't an option for you, your distro's bugzilla is probably the right destination for your bug report.

In an effort to clean up our bug list, we're pre-emptively closing all bugs that haven't seen updates since 2011. If the original issue remains, please make sure to provide fresh info, see http://nouveau.freedesktop.org/wiki/Bugs/ for what we need to see, and re-open this one.

Thanks,

The Nouveau Team
Comment 9 Kip Warner 2015-02-27 00:51:30 UTC
Hey Ilia,

I can confirm that this is still an issue. In fact, I noticed it not just with the Nouveau driver (Ubuntu, amd64, 1:1.0.11+git1411032101.3fb97d~gd~u), but also with the non-free nVidia 346 driver. 

In both cases the hotplug notification was not being reported by udevadm (and presumably the kernel hotplug system either via netlink or script driven). The card in question was an nVidia GeForce GTX 960. 

This may be a hardware issue because plugging in the same HDMI sink (Onkyo TX-NR535) to my integrated Intel HDMI port emits several hotplug events no problem on both connect and disconnect.


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.