system hangs when switching between TTY and X (12.10)

Bug #1155501 reported by Kirill
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)
Expired
Low
Unassigned

Bug Description

So, I have this problem on lenovo ideapad y460, with hybrid graphics (AMD 5650 and intel) on ubuntu 12.10 with preinstalled open-source video drivers.

To reproduce bug on my system:

1) switch off discrette videocard using vgaswitcheroo:

kirill@lenovo:~$ sudo -s
[sudo] password for kirill:
root@lenovo:~# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
root@lenovo:~# cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :Off:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0
2:DIS-Audio:+:Off:0000:01:00.1
root@lenovo:~#

2) switch to any TTY using ctrl+alt+F1..F6
3) switch back to X-server using ctrl+alt+F7

After that I see the scree in state I leave it, but in frost state (for example, I can open gif animation, switch to TTY and back, and after I have static image on screen). Also I can't use keyboard and mouse.

If I try to go to the TTY and back with discrette videocard switched on, it works fine.

I have that bug on 12.10 and 13.04. But 10.10, 11.04, 11.10 and 12.04 work great.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1155501/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → xorg (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg (Ubuntu):
status: New → Confirmed
Revision history for this message
Igor Tarasov (tarasov-igor) wrote :

Similar to bug #1069694.

I have found out that the bug is somehow related to vgaswitcheroo. Here is a way to reproduce it (installing lm-sensors is welcome):

1. Let's say you have both integrated and discrete. Then, `cat /sys/kernel/debug/vgaswitcheroo/switch` should give you something like
{{{0:DIS: :Pwr:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0}}}

2. If you `pm-suspend` now and resume, and then repeat step 1, you should see the same results.

3. If you now try to turn ON the discrete card it should work well, since it is already on and vgaswitcheroo is aware of this.

4. Now, turn discrete card off: `echo OFF > /sys/kernel/debug/vgaswitcheroo/switch`. If you read the status, it shoul render
{{{0:DIS: :Off:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0}}}

5. If you `pm-suspend` now and resume, you might get frozen screen.

6. If not, you can check vgaswitcheroo status, you'll see that discrete card is switched off:
{{{0:DIS: :Off:0000:01:00.0
1:IGD:+:Pwr:0000:00:02.0}}}

However, if you do `sensors` you'll see that discrete card reports it's temperature - that is, it is on.

7. Now, if you try to turn it on by `echo ON > /sys/kernel/debug/vgaswitcheroo/switch` you'll probably get freeze.

And since we know all this, we can create a workaround. Just make our discrete card turn on before suspend, and turn off in a few seconds after resume. In order to achieve this, just create file `/etc/pm/sleep.d/77_amd_toggle` with the following content:
{{{#!/bin/bash
# Script to disable and enable the discrete graphics card before suspend and after resume

case "${1}" in
suspend)
  # We turn it on before resume to prevent bugs
  echo ON > /sys/kernel/debug/vgaswitcheroo/switch
  ;;

resume)
  # Your GFX would freeze if you turn off discrete card immediately, that's why this delay:
  sleep 3
  # We turn it off after resume to save energy
  echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
  ;;
esac}}}

Revision history for this message
Igor Tarasov (tarasov-igor) wrote :

Aww, sorry for errors with formatting, please ignore all ticks (`) and curly braces ({{{ and }}})

Revision history for this message
penalvch (penalvch) wrote :

Kirill, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p xorg <replace-with-bug-number>

Thank you for your understanding.

Helpful bug reporting tips:
https://wiki.ubuntu.com/ReportingBugs

Changed in xorg (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for xorg (Ubuntu) because there has been no activity for 60 days.]

Changed in xorg (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.