Score:0

Intermittently frozen screen

es flag

My screen freezes for a few seconds to a few minutes up to a few times per minute but the system is not frozen. Spotify will continue to play, VLC sound will continue to play, Youtube sound in Firefox or Chrome will continue. It appears that mouse clicks or Page Up/Down keyboard commands will stack up and execute as soon as the screen starts moving again. Mute keyboard command will not execute until the screen starts moving again.

If I log out and log back in or reboot, the freezes will go away for a while but they eventually come back and get worse until I have to log out again.

I have tried System Monitor and TOP but I don't see any obvious causes. Error logs don't show anything obvious to an idiot (me - but I really am an idiot here). I don't know how to troubleshoot this any further.

This problem has been occurring for more than a year but different versions of Ubuntu are better or worse. 21.04 was very good (I could live with it) but 21.10 is really bad (I can't live with it). I don't remember what version of Ubuntu started it (2019?). Same PC since 2017. Same functional configuration HTPC since 2010.

Other freezes searched do not seem to be the same problem. Their solutions did not help.

Dual boot to Win10 with no issues there.

  • CPU - AMD A8-7600 w Radeon R7
  • MOBO - ASROCK fm2a88m pro 3+
  • RAM - 2 x 8 GB
  • SSD partition - 270 GB - 130 GB free

What can I do to troubleshoot this further?

edit 2021/01/04: Yesterday while I was writing this post, screen freezes where constantly interrupting me. Today when I ran the below commands, screen freezes were nearly nonexistent. Some days have always been better than others. I did perform an Update/Upgrade and a reboot this morning but I do not think my problem has resolved until I experience a longer period without screen freezes.

I will also try a live USB suggested below when I get the chance.

ed@ed-htpc:~$ sudo dmidecode -s bios-version
P2.60
ed@ed-htpc:~$ free -h 
               total        used        free      shared  buff/cache   available
Mem:            13Gi       3.1Gi       1.6Gi        97Mi       8.9Gi        10Gi
Swap:          2.0Gi       1.0Mi       2.0Gi
ed@ed-htpc:~$ sysctl vm.swappiness
vm.swappiness = 60
ed@ed-htpc:~$ swapon -s
Filename                Type        Size    Used    Priority
/swapfile                               file        2097148 1792    -2

Also, this HTPC records television from a network attached TV tuner (MythTV <-> HDHomerun) and the recorded video file shows no interruptions if the screen freezes during a background recording. MythTV will also continue to play sound while the screen is frozen during video playback.

edit 2021/01/07: Increasing swap to 4 GB did not fix problem

ed@ed-htpc:~$ free -h
               total        used        free      shared  buff/cache   available
Mem:            13Gi       4.4Gi       620Mi       166Mi       8.6Gi       8.7Gi
Swap:          4.0Gi       244Mi       3.8Gi

edit 2021/01/12: Tests run so far seem to rule out hardware problems. I do not know how to troubleshoot this further. I have looked in the Logs app but I do not know how to recognize a significant message. I should wait until the freezes become a major disruption and then look at some kind of log but I don't know what. (or look at logs for 2021/01/03 - that day was very heavy)

in flag
If you have a bit of time and a Live USB nearby, one option would be to boot into a live session and see if the system continues to have issues when playing videos or doing simple things. If there are no issues with the Live USB session, then there's a potential configuration issue. If the problem continues, then a deeper investigation of drivers and log files will be necessary
heynnema avatar
ru flag
Edit your question and show me `sudo dmidecode -s bios-version` and `free -h` and `sysctl vm.swappiness` and `swapon -s`. Start comments to me with @heynnema or I'll miss them.
Sadaharu Wakisaka avatar
pl flag
Welcome to AskUbuntu, you can either do a bug report or go back to 20.04 LTS for steady operation, other half-year span release is more like a testing purpose.
Ed McGuirk avatar
es flag
@heynnema requested data added above.
heynnema avatar
ru flag
@EdMcGuirk Please see my answer. If it helps to solve the problem, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
Score:0
ru flag

BIOS

ASROCK FM2A88M Pro3+

Your BIOS is the most current, at 2.60.

SWAP

Let's increase your /swapfile from 2G to 4G and see if that solves the problem.

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 16G 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

MEMTEST

Go to https://www.memtest86.com/ and download/run their free memtest to test your memory. Get at least one complete pass of all the 4/4 tests to confirm good memory. This may take a few hours to complete.

Ed McGuirk avatar
es flag
increasing swap to 4 GB did not fix problem. I will try to remember to run memtest overnight. (New 'free -h' results added above)
heynnema avatar
ru flag
@EdMcGuirk Thanks for the update! Let me know how `memtest` goes. If it freezes, then it may point to bad memory.
Ed McGuirk avatar
es flag
I think it might have frozen. I will attempt several more overnight runs of memtest including removal of each 8 GB memory stick and maybe different allocations of video memory from RAM.
heynnema avatar
ru flag
@EdMcGuirk Thanks for the update! Keep me posted.
Ed McGuirk avatar
es flag
It took 10 hours but memtest completed without errors. I am a little confused by RAM dedicated to graphics. Memtest shows 14 GB RAM whether 0 or 2 GB is dedicated to graphics and it appears like memtest freezes if 2 GB is dedicated to graphics. I need to test again with dedicated graphics RAM to prove memtest freeze. So, I still do not know what is causing Ubuntu freeze.
heynnema avatar
ru flag
@EdMcGuirk If `memtest` freezes, no matter how much graphics memory is configured, then it's not a Ubuntu problem, but a hardware problem. You were going to pull out a 8G DIMM at a time and test with the remaining 8G, and then test with the other DIMM by itself... what happened with that?
Ed McGuirk avatar
es flag
I did not test 8 GB with one stick removed because the test passed with 16 GB. My first test had 2 GB RAM allocated to graphics and it looked frozen but I was unfamiliar with the program and I may not have read the screen correctly. The second test was with graphics RAM disabled and passed with zero errors after 10 hours. I have since tested that disabling graphics RAM will leave the previous RAM allocation. That explains memtest showing 14 GB of 16 GB available for testing. I have reduced graphics RAM allocation to the minimum of 32 MB and disabled graphics. I will test full 16 GB overnight.
heynnema avatar
ru flag
@EdMcGuirk Thanks for the update.
Ed McGuirk avatar
es flag
Which would be more valuable: testing 16 GB with 32 MB graphics deactivated or testing 14 GB with 2 GB graphics activated? I'll do both but each one will be more than 10 hours for 4 passes of all tests so it will be two overnight tests.
heynnema avatar
ru flag
@EdMcGuirk 16G with minimal shared graphics memory.
Ed McGuirk avatar
es flag
Test passed for 16 GB with zero errors. It took 11.5 hours. I will modify future tests for only 3 passes. I will test again with graphics RAM allocation 2 GB activated. I doubt this is a hardware problem.
heynnema avatar
ru flag
@EdMcGuirk You don't need to run `memtest` again. On your normal boot, do you have the latest Radeon drivers installed? Do you know how to boot from the GRUB menu with nomodeset?
Ed McGuirk avatar
es flag
I am not using any proprietary drivers and none show as available. I don't know how to use nomodeset but a quick search implies it only affects boot before X is loaded?
heynnema avatar
ru flag
@EdMcGuirk At the GRUB menu, hit "e" to enter edit mode. Use the arrow keys to find "quiet splash" and change it to "quiet splash nomodeset", then control-x or F10 to continue booting. This will only prove if there's a problem with the Radeon or its driver. Screen resolutions may be off, and the Display Settings may not fully function, until reboot. See if the freezing stops.
Ed McGuirk avatar
es flag
Normally the freezing only starts after many hours of run time. 6, 12, or more than 24 hours before the first freeze then usually getting worse until a reboot or logout/login is required. Some days are better then others.
heynnema avatar
ru flag
@EdMcGuirk And increasing the /swapfile didn't help this freezing? Monitor `free -h` and keep an eye on swap/used. Did you do the nomodeset?
Ed McGuirk avatar
es flag
Increasing swap did not fix problem. Freezing has only been light/moderate all week (reboot a day keeps freezing away) even before increasing swap to 4 GB but swap/used has never been worse than a few hundred MB (currently 1 MB). I will try nomodeset later this afternoon. All tests that require a reboot delay heavy freezing.
Ed McGuirk avatar
es flag
nomodeset set the resolution to a nearly unusable 800x600 and no sound through the HDMI port with no options to change. I can't use that for hours waiting for freeze to come back. I didn't see any freezing but I would not normally see any in the first few minutes anyway.
heynnema avatar
ru flag
@EdMcGuirk Don't know what to say then. Sorry.
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.