From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Henningsson Subject: Re: Radeon unconnected HDMI eats samples at 280 kHz Date: Tue, 23 Sep 2014 11:47:44 +0200 Message-ID: <542141C0.3010503@canonical.com> References: <54198F38.30002@canonical.com> <5419FC9E.9010302@iki.fi> <541A5BCD.2040105@canonical.com> <541A8FA2.7090406@canonical.com> <541C31EE.4020101@canonical.com> <541C6C23.1040403@canonical.com> <541CC506.601@canonical.com> <54203495.60903@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 51E6A261AE4 for ; Tue, 23 Sep 2014 11:47:48 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Deucher, Alexander" , Takashi Iwai Cc: Anssi Hannula , "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org On 2014-09-22 16:52, Deucher, Alexander wrote: >> -----Original Message----- >> From: David Henningsson [mailto:david.henningsson@canonical.com] >> Sent: Monday, September 22, 2014 10:39 AM >> To: Deucher, Alexander; Takashi Iwai >> Cc: Anssi Hannula; alsa-devel@alsa-project.org >> Subject: Re: [alsa-devel] Radeon unconnected HDMI eats samples at 280 kHz >> >> On 2014-09-22 14:46, Deucher, Alexander wrote: >>>> -----Original Message----- >>>> From: David Henningsson [mailto:david.henningsson@canonical.com] >>>> Sent: Friday, September 19, 2014 8:07 PM >>>> To: Deucher, Alexander; Takashi Iwai >>>> Cc: Anssi Hannula; alsa-devel@alsa-project.org >>>> Subject: Re: [alsa-devel] Radeon unconnected HDMI eats samples at 280 >> kHz >>>> >>>> Btw, is there a register dump utility I could use to get the current >>>> register value, e g by reading sysfs or procfs? It could be interesting >>>> to see if anything we do on the audio side would affect this register. >>> >>> You can use the radeonreg tool to dump registers: >>> http://cgit.freedesktop.org/~airlied/radeontool >> >> Thanks, I have now tried this, together with the kernel from >> drm-next-3.18-wip. >> >> From your patches it looks like I should look at the dumped register >> 0x7300, is that correct? > > What GPU do you have? The offset of that register varies between generations. Not sure exactly what GPU info you need, but here's the lspci info: 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV710 [Radeon HD 4550] [1002:9540] (prog-if 00 [VGA controller]) Subsystem: PC Partner Limited / Sapphire Technology Device [174b:e106] >> At boot up, this register is 001000f0. (Out of curiousity, I tried >> disabling unsol events from the audio side, but this did not change the >> register.) >> After HDMI plug in, the register changed to 0x8f1000f0, the jack >> reported being plugged in, and audio worked. >> >> After HDMI unplugged again, the register remained at 0x8f1000f0, and >> "xrandr --output HDMI-0 --off" did not help. >> >> However, when looking at your code, I also spotted something in the >> patch called "disable audio when we disable hdmi": >> >> if (!enable && dig->afmt->pin) { >> r600_audio_enable(rdev, dig->afmt->pin, 0xf); >> ^^^ >> If enable is false, should we not set the last parameter to 0 instead of >> 0xf? > > Yup. Good catch. I've fixed that up and pushed a new drm-next-3.18-wip branch. Ok, I have tested this now, with mixed results. One time when I unplugged I believe it correctly switched back to unplugged on the audio side (after running "xrandr", with no parameters). But the next time it did not. So far, it looks like whenever the audio side reports presence, the 0x7300 register is set to 0x8f1000f0. So as long as we can get the video side to correctly turn off the right bits of that register when the monitor is disabled/disconnected, things should be working on the audio side. -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic