Score:0

How do I go about fixing my system freezing every time I launch a video after installing mpv?

ng flag

Since installing mpv, every time I launch a video, my system completely freezes, and I have to do a hard shutdown. Even when trying to use another media player, the same thing happens. I'm new to Linux and am trying it out on an external drive using Kubuntu.

I installed it following the instructions on its website, which says to follow the link Ubuntu (PPA), which says to install youtube-dl, and then follow the instructions on that page to add the PPA and install:

sudo add-apt-repository ppa:mc3man/mpv-tests
sudo apt-get update
sudo apt install mpv

Computer specs:

OS: Kubuntu 20.04.2 LTS x86_64 
Host: HP Pavilion dv7 Notebook PC Rev 1 
Kernel: 5.8.0-59-generic
Resolution: 1600x900
CPU: Intel Core 2 Quad Q9000 (4) @ 2.001GHz 
GPU: AMD ATI Mobility Radeon HD 4650/5165 
Memory: 5912MiB

Because @heynnema asked:

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          5.8Gi       2.1Gi       1.9Gi        27Mi       1.8Gi       3.4Gi
Swap:         2.0Gi          0B       2.0Gi
Nmath avatar
ng flag
This sounds like a bug, so you should file a bug report
heynnema avatar
ru flag
Edit your question and show me `free -h`. Start comments to me with @heynnema or I'll miss them.
CactusCities avatar
ng flag
@heynnema Thanks. I edited my post but have fixed the issue by uninstalling and reinstalling mpv.
heynnema avatar
ru flag
@CactusCities MPV may not be the fix, as you mentioned that other video players had the same problem. Please see my answer below. If you still have a problem, and my answer helps to resolve it, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
CactusCities avatar
ng flag
@heynnema Thanks for your responses. My other video players began working again after reinstalling mpv. It seems something happened with the install that messed things up, as I didn't have the issue before the install. However, I'm sure having a larger swapfile will be helpful, so I followed the instructions of your answer. and my swapfile is now 4GB. Thanks.
Score:0
ru flag

Your 2G /swapfile is too small. You probably have a freezing or crashing problem.

Let's increase the /swapfile from 2G to 4G...

Note: Incorrect use of the rm and dd commands can cause data loss. Suggest copy/paste.

In the terminal...

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile  # set proper file protections
sudo mkswap /swapfile     # init /swapfile
sudo swapon /swapfile     # turn on swap
free -h                   # confirm 6G RAM and 4G swap

Edit /etc/fstab, using sudo -H gedit /etc/fstab or sudo pico /etc/fstab.

Confirm this /swapfile line in /etc/fstab... and confirm no other “swap” lines... use SPACES in this line... confirm NO TABS...

/swapfile  none  swap  sw  0  0

reboot                    # reboot and verify operation

Update #1:

Uninstalling and reinstalling the MPV application resolved the problem. /swapfile was also changed from 2G to 4G.

Score:0
ng flag

I fixed this by uninstalling and reinstalling mpv.

sudo apt remove mpv
sudo apt install mpv

Edit: Actually fixed by uninstalling SMPlayer. SMPlayer doesn't support mpv version 0.33 yet. Changing SMPlayer to use MPlayer would also work.

BeastOfCaerbannog avatar
ca flag
How does SMPlayer come into play here? You haven't mentioned anything about it in your question! If you don't mind, please edit your question by adding all the necessary info so that your answer actually makes sense and can be helpful for other people with similar issues. Thanks!
CactusCities avatar
ng flag
I don't know how or why SMPlayer ended up being the cause. I did say that "Even when trying to use another media player, the same thing happens." I selected mpv in SMPlayer by browsing to the binary's location. I had to do that because selecting from the drop-down wouldn't work. After that, the media players would freeze the system.
CactusCities avatar
ng flag
BeastOfCaerbannog Since I so few rep points, I have to post this here. Just wanted to say I appreciate you approving and re-editing my "suggested" edit for the post answer here: https://askubuntu.com/a/956410/1118841. It took me over 12 hours to look all that up and create that edit, though I know my original formatting could have better.
BeastOfCaerbannog avatar
ca flag
You're welcome! It was obvious that it was a lot of work, and I felt that it deserved to be better formatted! So thank you for your effort! :)
Score:-1
it flag

System "freezes" are often caused by running too many, too large programs and running out of available memory. Use free to see if you have swap space, read man mkswap swapon fstab to create some. Swap space must be contiguous. use mkswap or fallocate, not dd. Traditionally, swap space of 1.5 × RAM has been recommended, but YMMV. If you don't plan to hibernate your system, you can have less than 1.0 × RAM.

CactusCities avatar
ng flag
Thanks for your response. I'll save this info for later use. Didn't see it as I was editing my post.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.