VLC freezes PC when resuming from suspend to ram (Debian, Ubuntu, Linux Mint) - SOLUTION

// = VLC freezes PC when resuming from suspend to ram (Debian, Ubuntu, Linux Mint) - SOLUTION :id: 7690728f-f37f-4385-8b15-7f6aabc29368 :author: Andrei Clinciu :website: https://andreiclinciu.net/ :publish_at: 2018-02-20 22:24:00Z :heading_image: \N :description: \N :type: article :tags: :keywords: :toc: left :imagesdir: ../assets/

image::{heading_image}[] I’ve been observing this weird thing that when I leave VLC open and I suspend my Linux machine.

Whenever I try to resume the system from suspend I can’t login and there’s a black screen. If I try to CTRL+ALT+F1-F8 I can sometimes  login but it’s a black screen again and nothing happens. + This freezes the whole system and only the CTRL+ALT+PAUSE+O (K or L) works by shutting down the system in a graceful manner.

== Solution Kill VLC

Ctrl+Alt+F4 to get to a console TTY and login with your user.

[source,lang:default,decode:true]

ps -aux | grep vlcsudo pkill -9 vlc

After killing VLC you can go back to CTRL+ALT+F1 or CTRL+ALT+F2 and login, everything will work fine.

== Solution 2 system2 system-sleep script

We can do something else to automate this process since I might not want to go in the console each time. If I go to sleep with VLC open, then let the system close VLC and then restart it later

vim /lib/systemd/system-sleep/vlc-pm

[source,lang:default,decode:true]

#!/bin/bashPATH=/sbin:/usr/sbin:/bin:/usr/bincase “$1” inpre)\tpkill -9 vlc\texit 0\t;;post)\t\texit 0\t;; \t*)\texit 1\t;;esac

NOTE, this seems NOT to work all of the time, so the first solution is better.

Subscribe to my Newsletter

Receive emails about Linux, Programming, Automation, Life tips & Tricks and information about projects I'm working on