Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 506188

Summary: Automatic radeon GPU switching added in kernel 3.13 breaks pulseaudio sound in gnome session
Product: Gentoo Linux Reporter: Garri <g.djavadyan>
Component: [OLD] GNOMEAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: kernel, x11
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugs.freedesktop.org/show_bug.cgi?id=67946
See Also: https://launchpad.net/bugs/1210470
Whiteboard:
Package list:
Runtime testing required: ---

Description Garri 2014-03-29 20:38:56 UTC
In kernel 3.13 added and enabled by default function 'Automatic GPU switching' for radeon module. The function automatically disables discrete GPU via vgaswitcheroo kernel interface.

When the function is used on system with kernel 3.13, radeon module, ATI Radeon GPU with integrated HDMI audio, GDM, Gnome 3 session and pulseaudio  - sound breaks.

GDM executes pulseaudio which hangs because radeon module automatically disables Radeon card with HDMI audio. The hanged pulseaudio process (user gdm) prevents a user's pulseaudio process in Gnome 3 session to access non-disabled sound card.

My workaround was to disable radeon's automatic GPU switching using module params 'runpm=0' and 'dpm=0'. To disable discrete GPU I always used vgaswitcheroo interface called before GDM service (echo OFF > /sys/kernel/debug/vgaswitcheroo/switch).

Maybe more elegant method needed for users, which could be used in Gentoo systems by default. Thank you.

---

Software:
sys-kernel/gentoo-sources-3.13.7
media-sound/pulseaudio-5.0
gnome-base/gdm-3.10.0.1-r1
gnome-base/gnome-3.10.0
sys-apps/systemd-212

Hardware:
lspci
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Madison [Mobility Radeon HD 5650/5750 / 6530M/6550M] (rev ff)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Redwood HDMI Audio [Radeon HD 5000 Series] (rev ff)

lspci -n
01:00.0 0300: 1002:68c1 (rev ff)
01:00.1 0403: 1002:aa60 (rev ff)
Comment 1 Pacho Ramos gentoo-dev 2014-03-29 21:18:47 UTC
And, why is the card being disabled by the kernel even if it's used? (not sure if the kernel is acting ok :/)
Comment 2 Garri 2014-03-30 06:01:19 UTC
Sorry, I failed to explain that my laptop uses hybrid graphics (integrated Intel and discrete Radeon). So I have 2 GPU and 2 sound devices (integrated Intel HDA and AMD HDMI Audio on discrete GPU).

I never used discrete GPU and always disabled it via vgaswitcheroo on startup. So X system and pulseaudio always saw only 1 Intel GPU and 1 Intel HDA.

As kernel 3.13 introduced Automatic GPU switching for radeon (http://kernelnewbies.org/Linux_3.13#head-f95c198f6fdc7defe36f470dc8369cf0e16898df), kernel no longer reacts to scripts used on startup to disable discrete GPU. But automatically controls the switching process when performance needed (https://wiki.archlinux.org/index.php/Hybrid_graphics#The_New_Dynamic_Switching_Model).

At the moment I faced problems only with automatically disabled HDMI audio, as that results in hanged pulseaudio process spawned by GDM. And the hanged process prevents user's pulseaudio process to access Intel HDA.
Comment 3 Pacho Ramos gentoo-dev 2014-03-30 07:22:12 UTC
Could you take a look to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1210470
https://bugs.freedesktop.org/show_bug.cgi?id=67946

to see if they could be related with your issue?
Comment 4 Garri 2014-03-30 17:37:42 UTC
Yes, it looks like pulseaudio can't correctly handle the event that audio device is powered down.

I'll try to add some details in upstream. Thank you!
Comment 5 Pacho Ramos gentoo-dev 2014-03-30 18:34:50 UTC
Well, upstream report points to X11 :/
Comment 6 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-03-30 19:00:32 UTC
kernel issue, not X11
Comment 7 Pacho Ramos gentoo-dev 2014-06-12 17:45:58 UTC
(In reply to Chí-Thanh Christopher Nguyễn from comment #6)
> kernel issue, not X11

Still valid with latest kernel? If that is the case, I would report to upstream (kernel per previous comment) -> bugzilla.kernel.org
Comment 8 Garri 2014-06-28 12:57:01 UTC
(In reply to Pacho Ramos from comment #7)
> (In reply to Chí-Thanh Christopher Nguyễn from comment #6)
> Still valid with latest kernel? If that is the case, I would report to
> upstream (kernel per previous comment) -> bugzilla.kernel.org

I've tested the problem using 3.15.2 kernel. Can't reproduce it anymore. Seems like the bug have been resolved. Many thanks!

(Can I close the report, as there are no more people affected by the bug?)
Comment 9 Garri 2014-06-28 13:27:29 UTC
As it turned out, the third system reboot showed that problem is not resolved.
Comment 10 Pacho Ramos gentoo-dev 2015-07-08 15:54:14 UTC
what is the status of this with a full updated system and kerne-4.0.5?(or newer)
Comment 11 Garri 2015-07-12 10:49:23 UTC
(In reply to Pacho Ramos from comment #10)
> what is the status of this with a full updated system and kerne-4.0.5?(or
> newer)

Hello, I tried to verify the problem using kernel 4.1.1-gentoo-r1 and Xorg 1.17.1-r1, but I could not start user session. Here error messages, no related to the bug report:

Jul 12 15:13:17 gentoo.local /usr/libexec/gdm-x-session[476]: Xorg: /var/tmp/portage/x11-base/xorg-server-1.17.1-r1/work/xorg-server-1.17.1/dix/p
rivates.c:385: dixRegisterPrivateKey: Assertion `!global_keys[type].created' failed.
Jul 12 15:13:17 gentoo.local kernel: audit: type=1701 audit(1436695997.284:5): auid=1001 uid=1001 gid=1001 ses=1 pid=478 comm="Xorg" exe="/usr/bi
n/Xorg" sig=6
Jul 12 15:13:17 gentoo.local /usr/libexec/gdm-x-session[476]: Unable to run X server


Then, I downgraded to Xorg 1.16.4 and successfully started the user session, but without sound :). Here, related messages:

Jul 12 14:19:15 gentoo.local pulseaudio[834]: [pulseaudio] main.c: User-configured server at {82b25778862ae282f6ff4aae0000000f}unix:/run/user/100
1/pulse/native, which appears to be local. Probing deeper.
Jul 12 14:19:15 gentoo.local pulseaudio[837]: [pulseaudio] pid.c: Daemon already running.


Up to date, I'm using switchable graphic system with disabled discrete ATI card and disabled radeon runtime power management. The method gives very stable graphics subsystem. At times, when I needed GPU performance, I rebooted to BIOS setup and selected only discrete card. So, I'll continue to use the method until laptop's final days. :)

During 4+ years I learned that hybrid graphics support is very weak in Xorg environment (AFAIK because of architecture). Frankly, I've seen serious problems with hybrid graphics in Windows environment too on the same laptop (compatible combination of Intel/ATI driver versions required :)).

Thank you for support!