Score:2

Ubuntu 20.04 Freezes randomly and media loops the last 1-2 seconds clip

cn flag

After a few days of installation of Ubuntu 20.04 on my Desktop system, I am facing this issue of my OS freezing at random intervals. Happening 2-3 times a day.

The question may be similar to this one but the those answers are not applicable because I already have 16 GB of SWAP and a recent kernel version.

I also checked many other similar questions but could not find the specific solution.

The picture of the htop, the last time it happened.

enter image description here

I checked the /var/log/syslog file and could not find anything relevant.

Screenshot of syslog file.

enter image description here

All the time it froze, I was using two browsers: Firefox(2-3 tabs) and Chrome(4-5 tabs, youtube in on of them) and a few other applications like Vscode, Terminal etc. I was not doing any heavy(memory-wise) work.

I am not sure what is causing this. One possible culprit I am guessing is 'may be', the dconf-editor. The issue started the day I installed dconf-editor because I had to add Byobu to the favorites in the dock. So, I followed some of the steps from this answer. But it didn't work as expected and showed some weird results. So I reverted all the changes done to it.

Adding here the relevant system information.

sudo lshw -short
H/W path        Device     Class          Description
=====================================================
                           system         All Series (All)
/0                         bus            H81M-K
/0/0                       memory         64KiB BIOS
/0/1                       memory         16GiB System memory
/0/1/0                     memory         8GiB DIMM DDR3 Synchronous 1333 MHz (0.8 ns)
/0/1/1                     memory         8GiB DIMM DDR3 Synchronous 1067 MHz (0.9 ns)
/0/3d                      memory         256KiB L1 cache
/0/3e                      memory         1MiB L2 cache
/0/3f                      memory         6MiB L3 cache
/0/43                      processor      Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
/0/100                     bridge         4th Gen Core Processor DRAM Controller
/0/100/1                   bridge         Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller
/0/100/2                   display        Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
/0/100/14                  bus            8 Series/C220 Series Chipset Family USB xHCI
/0/100/14/0     usb3       bus            xHCI Host Controller
/0/100/14/0/2              input          Rapoo 2.4G Wireless Device
/0/100/14/1     usb4       bus            xHCI Host Controller
/0/100/16                  communication  8 Series/C220 Series Chipset Family MEI Controller #1
/0/100/1a                  bus            8 Series/C220 Series Chipset Family USB EHCI #2
/0/100/1a/1     usb1       bus            EHCI Host Controller
/0/100/1a/1/1              bus            USB hub
/0/100/1b                  multimedia     8 Series/C220 Series Chipset High Definition Audio Controller
/0/100/1c                  bridge         8 Series/C220 Series Chipset Family PCI Express Root Port #1
/0/100/1c.2                bridge         8 Series/C220 Series Chipset Family PCI Express Root Port #3
/0/100/1c.2/0   enp3s0     network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/1d                  bus            8 Series/C220 Series Chipset Family USB EHCI #1
/0/100/1d/1     usb2       bus            EHCI Host Controller
/0/100/1d/1/1              bus            USB hub
/0/100/1f                  bridge         H81 Express LPC Controller
/0/100/1f.2                storage        8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]
/0/100/1f.3                bus            8 Series/C220 Series Chipset Family SMBus Controller
/0/2                       system         PnP device PNP0c01
/0/3                       system         PnP device PNP0c02
/0/4                       system         PnP device PNP0b00
/0/5                       generic        PnP device INT3f0d
/0/6                       system         PnP device PNP0c02
/0/7                       system         PnP device PNP0c02
/0/8                       system         PnP device PNP0c02
/0/9            scsi0      storage        
/0/9/0.0.0      /dev/sda   disk           480GB WDC WDS480G2G0A-
/0/9/0.0.0/1    /dev/sda1  volume         476MiB Windows FAT volume
/0/9/0.0.0/2    /dev/sda2  volume         15GiB Extended partition
/0/9/0.0.0/2/5  /dev/sda5  volume         15GiB Linux swap volume
/0/9/0.0.0/3    /dev/sda3  volume         114GiB EXT4 volume
/0/9/0.0.0/4    /dev/sda4  volume         316GiB EXT4 volume
/0/a            scsi4      storage        
/0/a/0.0.0      /dev/sdb   disk           1TB WDC WD10EZEX-60M
/0/a/0.0.0/1    /dev/sdb1  volume         931GiB EXT4 volume
/1                         power          To Be Filled By O.E.M.




swapon -s
Filename                Type        Size    Used    Priority
/dev/sda5                               partition   15999996    0   -2



sudo dmidecode -t 2

# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
    Manufacturer: ASUSTeK COMPUTER INC.
    Product Name: H81M-K
    Version: Rev X.0x
    Serial Number: 191059533403458
    Asset Tag: To be filled by O.E.M.
    Features:
        Board is a hosting board
        Board is replaceable
    Location In Chassis: To be filled by O.E.M.
    Chassis Handle: 0x0003
    Type: Motherboard
    Contained Object Handles: 0




free -h
              total        used        free      shared  buff/cache   available
Mem:           15Gi       4.5Gi       6.7Gi       1.0Gi       4.2Gi       9.7Gi
Swap:          15Gi          0B        15Gi




sudo lshw -c video
  *-display                 
       description: VGA compatible controller
       product: Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 06
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:31 memory:f7800000-f7bfffff memory:e0000000-efffffff ioport:f000(size=64) memory:c0000-dffff

ls -al /usr/share/gnome-shell/extensions
total 20
drwxr-xr-x 5 root root 4096 अगस्त   19 16:20 .
drwxr-xr-x 7 root root 4096 अगस्त   19 16:25 ..
drwxr-xr-x 2 root root 4096 नवम्बर   3 16:50 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 अगस्त   19 16:20 [email protected]
drwxr-xr-x 3 root root 4096 अगस्त   19 16:20 [email protected]

sudo ls -al ~/.local/share/gnome-shell/
total 12
drwx------  2 sand sand 4096 नवम्बर   6 22:00 .
drwxr-xr-x 23 sand sand 4096 नवम्बर   6 17:03 ..
-rw-rw-r--  1 sand sand 1770 नवम्बर   6 22:00 application_state
-rw-rw-r--  1 sand sand    0 नवम्बर   3 16:13 gnome-overrides-migrated


uname -r
5.11.0-38-generic
Someone avatar
my flag
**Should I provide an answer on** "What precautions should I take to avoid random freezes" **?**
cn flag
@Algnis, sure! It will help me as well as others.
karel avatar
sa flag
Does this answer your question? [My screen freezes when I'm multitasking and videos loop](https://askubuntu.com/questions/1364590/my-screen-freezes-when-im-multitasking-and-videos-loop)
heynnema avatar
ru flag
Edit your question and show me `ls -al ~/.local/share/gnome-shell/extensions` and `ls -al /usr/share/gnome-shell/extensions`. Also, try running with Chrome, and see if anything improves. Start comments to me with @heynnema or I'll miss them.
cn flag
@heynnema I have edited the question with the output of `ls -al /usr/share/gnome-shell/extensions` and `ls -al ~/.local/share/gnome-shell`. There is no `extensions` folder inside `~/.local/share/gnome-shell`. Thanks for the comment.
heynnema avatar
ru flag
Try running without Chrome and see if things improve. Report back.
Someone avatar
my flag
Also you said that you are on the latest kernel but didn't mention the kernel version , add the result of `uname -r`
Someone avatar
my flag
Also please tell that have you done a lot of configurations in gnome ? Maybe try resetting all the configuration (this will not delete any extension) `dconf reset -f /org/gnome/`
cn flag
@Algnis I added the kernel version. I had done a minor change in gnome through dconf-editor but I have removed that and uninstalled(purged) the dconf-editor.
cn flag
@heynnema okay I will try without chrome for 2-3 days and will report back.
heynnema avatar
ru flag
@SandeshYadav I just noticed that you have two different 8G memory DIMMs installed, and **they're at different clock speed rates**. What does your computer/motherboard **spec out for DIMM clock speed**?
heynnema avatar
ru flag
@SandeshYadav 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.
heynnema avatar
ru flag
@SandeshYadav 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!
heynnema avatar
ru flag
@SandeshYadav Status please...
cn flag
@heynnema Still stuck with 18.04 due to some projects. Last time I used 20.04 for 2 days without any problem but had to switch back to 18 again :(. Once I use 20.04 for at least 3-4 days, I will report here. Thanks again.
Score:1
gr flag

If the issue is something that is occurring with some specific software or browser like Chrome, try disabling the hardware acceleration option in the software, I had a almost similar case and nothing helped but disabling hardware acceleration in Chrome seems to have fixed the issue.

You can check my issue here, Random screen distortion and freeze in Ubuntu 20.04/22.04

Score:1
ru flag

You have two different 8G memory DIMMs installed, and they're at different clock speed rates.

/0/1/0                     memory         8GiB DIMM DDR3 Synchronous 1333 MHz (0.8 ns)
/0/1/1                     memory         8GiB DIMM DDR3 Synchronous 1067 MHz (0.9 ns)

When installed in pairs, memory interleaving calls out that both DIMMs should be exactly the same size, access, and clock rates.

The memory spec for your ASUS H81M-K motherboard is:

2 x DIMM, Max. 16GB, DDR3 1600/1333/1066 MHz Non-ECC, Un-buffered Memory
Dual Channel Memory Architecture

Source: https://www.asus.com/Motherboards-Components/Motherboards/Business/H81MK/techspec/

Note: See https://www.crucial.com/compatible-upgrade-for/asus/h81m-k#memory for compatible memory DIMMs.

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.

Update #1:

Regarding different memory DIMMs, it may slow down to the slowest speed (which in your case is almost 1/2 speed), or it might get confused, but for memory interleaving to work, the DIMMs must be exactly the same. Removing the slowest DIMM, for testing purposes, would tell you if the freezing problems went away.

Update #2:

Check your BIOS with sudo dmidecode -s bios-version... it should be 3604. Get it at https://www.asus.com/Motherboards-Components/Motherboards/Business/H81MK/HelpDesk_BIOS/

cn flag
Thank you for the answer. I have used the same system(with the two RAMs) with Ubuntu 16.04 and Ubuntu 18.04 for 2-3 years without facing any issues.
cn flag
Also, for the last two days, I used the system without chrome and I have not faced the freezing issue. Could it be that the google chrome was the issue? If yes, then what would be the good solution for it? Thanks.
heynnema avatar
ru flag
@SandeshYadav The incorrect RAM is still a problem. You can see if it effects Chrome by removing one of the DIMMs (the slower one) and see if things improve. In Chrome, do you have any apps or extensions installed? Do you have XMP enabled?
cn flag
I thought the motherboard automatically falls back to the slower one. I have not enabled XMP. Chrome Extensions: https://imgur.com/a/KnNUSRo
heynnema avatar
ru flag
@SandeshYadav Of your Chrome extensions/apps, I might suspect Telegram. Regarding memory, it **may** slow down to the slowest speed (which in your case is almost 1/2 speed), or it might get confused, but for memory interleaving to work, the DIMMS **must** be the same. Removing the slowest DIMM, for testing purposes, would tell you if the problems went away.
heynnema avatar
ru flag
@SandeshYadav Did you run `memtest`?
cn flag
I ran the memtest when I installed the second RAM stick. It had passed 4/4 tests. It was almost 2-3 years ago. For now, I will remove the telegram extension and will check for a day or two. If the problem persists, I will run the memtest again. Then I will report back. Thank you :)
Someone avatar
my flag
@SandeshYadav Is the problem solved?
heynnema avatar
ru flag
@Algnis As far as I know, OP hasn't pulled out the slower memory DIMM, as per my recommendation on Nov 9, and tested if it made any difference with the freezes.
cn flag
@heynnema My apologies for the delayed response. I had to switch back to the Ubuntu 18.04 for a few days to complete the urgent tasks. The problem is not solved in ubuntu 20.04. It happens even when I don't use chrome. But in the same system(dual boot), I used ubuntu 18.04 without facing any issues at all. So, I am confused if it is hardware issue.
heynnema avatar
ru flag
@SandeshYadav Show me `sudo dmidecode -s bios-version`... it should be 3604. Did you ever test after removing the slower DIMM as per my answer? Did you re-run `memtest`?
Score:0
my flag

There is no obvious way to fix this problem but you could take the following Precautions , Good Luck!


  • Try increasing the swap size (Only for the author of the question - Your swap size is more than enough (16 GB) , Maybe try decreasing it and configure swapiness)

  • Try a lighter desktop environment such as XFCE .

  • Change the power button to suspend button (suspend fixes the problem without a full restart (sometimes) ) settings > power options > power button action > suspend

  • try disabling services that you don't want (You can use Stacer also for that sudo snap install stacer)

  • Always keep your system updates sudo apt update ; sudo apt upgrade

  • Avoid heavy usage

  • Use cpu freq with power saving mode .

  • Use alternative flavours of ubuntu like XUBUNTU or LUBUNTU

  • rm -rf .config ; mkdir .config #Removes configurations

  • Use more workspaces rather than opening more then 3 apps in 1 workspace

  • keep your computer clean sudo apt autoremove && sudo apt clean

  • use an old kernel (only use if if it is supported)

  • And at last decrease swapiness.(10 is a good value)


If the problem is after update or kernel update

If that is the case then

  • Open Grub menu (Press ESC or SHIFT key before the boot splash screen appear)

  • From there choose "advanced options for ubuntu"

  • Then choose an older kernel (probably the oldest)

Check if the problem is still there if not then Give me further updates in the comments.

karel avatar
sa flag
The author of this question reports that he has 16GB of swap space, so clearly increasing the swap size wouldn't solve this problem.
Someone avatar
my flag
@karel Ya I know , but this answer is for everyone who will read in the future may not have so much swap right ? So that is why I mentioned that, there are other points OP can see
karel avatar
sa flag
I would phrase it something like "Your 16GB swap partition is large enough that it rules out insufficient swap space as a possible cause of freezing and audio looping." Please don't use this direct quote in your answer without providing attribution.
Someone avatar
my flag
@karel I have done that , please can you see and tell that if it is fine or not ?
Someone avatar
my flag
@karel please reply ?
cn flag
@Algnis Thanks for the response. This will definitely help definitely help at times. I upvoted the answer. I have not updated the kernel. It is the default version that came with the OS.
Someone avatar
my flag
@SandeshYadav Great ! I am happy to help , Your problem doesn't seem to be with any hardware or memory but instead it looks like it is an OS issue , Nowadays We can see a lot of questions about freezes , I would recommend you to perform a reinstall or at least change your desktop environment to Something lighter like LXQT or XFCE4 , Also still I would recommend you to open grub menu and choose the oldest kernel , Because sometimes you don't even know when the kernel was updated , Please Give me further updates
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.