Laptop gaming with cooler

I played game with my laptop, and I prefer performance rather than graphic quality. Hence, I use MangoHud (previously I used libstrangle), by changing the FPS to 24 or 25, the gameplay is still good, and there is no heating issue on GPU (or CPU). But some of the action games like “Bloodstained: Curse of the Moon” and “Record of Lodoss War: Deedlit in Wonder Labyrinth” will require higher FPS, else the action is not smooth.

However, some games are not optimized I believe. They easily cause the heating issue, and laptop fan spins quickly and loudly.

Recently, I spent some money to buy a good laptop cooler, not those cheap one. With a good cooler, when I play the game, the heating issue is greatly reduced, though not 100% evitable. As a result, I can play more advanced games in future.

Bluetooth devices

Due to previously reviving old Samsung Galaxy Tab, I bought a bluetooth gamepad/joystick (MOCUTE 053 Gamepad). Then I found that bluetooth technology is so wonderful, as I am not bound by wires.

Configurations

In Linux, to make Bluetooth to start on boot, need to edit /etc/bluetooth/main.conf and set AutoEnable to true. Furthermore, I have issue on the paired device. I also set AlwaysPairable to true.

Another issue I faced was the devices are not able to auto reconnect after resume from sleep. As a result, I created a custom “systemd unit file”,

[Unit]
Description=Restart bluetooth when resume from suspend
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/bin/systemctl restart bluetooth.service

[Install]
WantedBy=suspend.target

Some good bluetooth devices

There are some bluetooth devices that I like.

  • iClever BK10 – keyboard
  • Logitech M590 – mouse
  • MOCUTE 053 Gamepad
  • Lenovo LP40 Pro – earphone

Not able to boot

Recently, I failed to boot into my laptop. I was shocked.

home contains a file system with errors, check forced.
home: Inode 12976129 seems to contain garbage.
home: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
fsck failed with exit status 4.

Then not able to mount the home partition, I was prompted to login as root. However, I was too nervous, I forgot what is my root password.

Luckily, I always have an Arch Linux LiveUSB, though it was 2020 release. I boot into it. Then the screen is tearing, due to the graphic card issue (NVidia). I tried to remember how I did the installation previously. At the end, it involves BIOS to change the graphic card to non Discrete Graphic Card. Boot again, yes, success boot into LiveUSB.

The next thing is, I immediately run fsck to check the partition again. And auto fix all prompts.

During the fix, fsck shows me such frightening screen.

Luckily there is no read error caused by bad sector.

After finish running fsck, I reboot and no more issue to boot into Linux.

Backup! Backup! And always do backup! And I should remember my root password!

Dell Vostro 5459 revive

I was using Dell Vostro 5459 previously. However, it has some hardware deficiencies. The battery capacity keeps dropping drastically within a year. That’s a very bad experience. Now, the fully charged battery is only 1% of the designed capacity. Then I purchased an external power bank from Dell. But that’s not an ideal design for a laptop that you need to bring extra gadget to everywhere, and charging external battery is too troublesome.

Since I mostly work from home, battery issue is still bearable. Then about 4 years of usage, the keyboard became weird. It will randomly fire some keys (I forgot which key) (related post). That’s truly unbearable because it affects my working experience. At the end I bought a new laptop, Lenovo Legion Y7000.

But recently, I have done some online shopping and I bought some useful tools, including (i) laptop opener pry tools, and (ii) compressed air. Both are super useful for DIY hardware cleaning. I use opener pry tools instead of screwdriver to avoid physical damage of the hardware cover. Moreover, taking out Dell Vostro 5459 keyboard becomes much easier. For compressed air, it allows me to clean out the dirt from laptop without disassembling the laptop. Disassembling the laptop for cleaning is too difficult for a noob like me.

Finally, I bought a Dell Vostro 5459 compatible keyboard replacement through online shopping. That’s wonderful thing, since the laptop keyboard is not purchasable from Dell official website. I replaced the keyboard with the pry tools I bought earlier, then clean the fans with compressed air. I haven’t spent time to verify whether the keyboard issue is totally solved, though I think it is solved.

Great online shopping!

Reviving Samsung Galaxy Tab 10.1 (GT-P7500)

I bought a Samsung Galaxy Tab 10.1 many many years ago. But recently, I am trying to revive it so that, it will be a possible solution to allow my son to watch cartoon on an old tablet, in future.

Reviving this Galaxy Tab (P7500) takes me so much time to try out those custom ROMs and the apps. But it is an interesting experience.

I tried several ROMs, flashed with TWRP.

  • Nameless ROM (Android 4.4.4 Kitkat) – Fast, but no MTP, I cannot transfer file.
  • AOSP 7.1.2 – Slow. Am not sure it is caused by gapps or what, it is slow and can’t run Firefox, Opera Mini or Brave. A device without a modern web browser is quite useless.
  • AOSP 5.1.1 – Flashed the ROM, but it doesn’t start. Not sure what’s the problem.
  • CyanogenMod – It is too old (Android 4.2.2 Jellybean). I flashed this ROM many many years ago.
  • AOSP 6 – Because AOSP 7 is too slow, I tried to downgrade. But I can’t find the P7500 related ROM to download.
  • Omni ROM – Also Android Kitkat. I installed, but I didn’t find the virtual keyboard (forgot to check the right-bottom corner), then I gave up.
  • AOKP – I think I tried this ROM before using Nameless ROM, but that’s many years before, not remember well.
  • /e/ (/e/ OS, eOS) – Lastly I tried this ROM. This is so far the best as it is based on Android 7.1.2, and the performance is good, far more better than AOSP.

/e/ OS (eOS)

I tries eOS, I am happy with it. But after I installed the ROM, I cannot install gapps , because not enough space. At the end I decided to continue Android without Google Apps (most importantly Google Play). This also means, I need an alternative app store.

I am currently using two app stores: F-Droid and Aptoide. F-Droid focuses on the free and open source apps. This is a good solution to exclude apps that contain ads, as ads are super distracting. Some useful apps can be installed from F-Droid:

Aptoide itself contains ads, but I still can bear it. I can find all the apps that I need in Aptoide.

Customization

There are several apps from eOS I have disabled them. Notably, eOS default web browser is Via. Then I tried FOSS Browser. It has built-in ads block, but it is lack of other features like remember last visit tabs. As a result, I tried Opera Mini again in eOS (failed to work on AOSP). And Opera Mini works good.

eOS default launcher is Bliss Launcher. It lacks features such as grouping, shortcut management, etc. Then I found a good alternative, and it is really good. Microsoft Launcher. It is ads free!!!!!!

Now I am using Simple File Manager and Astro File Manager. I am still looking for an ads free (I don’t mind In-App Purchase), with show hidden files feature. Looks like FX File Explorer can fit my requirement. By the way, those file managers/explorers naming are damn annoying: FX, ES, CX, FS, FE.

Video problem

After installing eOS, I tried to play movie. But found out it is choppy. Tried run with mpv, it is choppy; built-in Gallery, it has no sound; QuickPic has no sound as well.

At the end, I believe that it is due to the coder problem. So, I tried to use ffmpeg to convert the video into other format (mkv, m4v), and it works.

Besides that, I tried to use the Camera to record video, but then it crashed.

Audio hardware problem

Because the tablet was put on a rack for a long time. When I started trying it again, found that there is no audio, and the tablet thought that I have jacked in the earphone.

At the end, I found a forum discussed how to solve this. Yes, I tried with hair dryer. It didn’t fix immediately. But after few days, I tried again, the tablet sound works again!

Brave browser

I wrote a post about Brave recently, and found that Brave browser is interesting. So, I am switching to Brave from Chromium for a trial.

A brief introduction about Brave: Brave is developed by Brave Software, which is founded by Brendan Eich, creator of JavaScript and former CEO of Mozilla Corporation. Firefox is the product of Mozilla Corporation. However, Brave is built on Chromium, the open source project for Google Chrome. So, I personally perceive Brave as the Chromium with the soul of Firefox. That is why, it makes Brave different from Chromium and Firefox.

Why not Firefox?

Actually I was trying to switch from Chromium to Firefox before. However, Firefox doesn’t fit my needs. Since I am doing web development, sometimes the web browser will be crashed. Firefox crashes more frequent than Chromium. The worst is, Firefox crashing will cause systemd core dump and the computer slow down, until I do hard reboot on the computer. That is very bad development experience.

Besides that, Firefox rendering engine is different from Chromium. Most of the web developers I know are using Chrome. If I am using different web browser, the CSS styling may be varied. It will be difficult to do testing and review.

Bookmark sync

Bookmark sync is one of my main requirement to choose a web browser. Chromium and Firefox both support bookmark sync, with the requirement to create user account.

Brave is a little different, it doesn’t require any account created, but it can sync between desktop version and mobile version.

Please take note that, Brave desktop disabled the Sync feature by default. This can be enabled by going to brave://flags, then enable “Enable Brave Sync”.

Besides that, we can doing copy-paste for the bookmark folders from Chromium to Brave easily. Need not to export and import.

Side note: Workspace (personal method)

Since I am migrating from Chromium to Brave, I also discover a method to manage my workspace.

Most of my works require Slack as the communication channel, so does other communication applications like Skype, GMail, Google Calendar, etc. These web apps need to open during working hours.

I was using All-in-One Messenger long time ago. However it focuses on messengers only.

Then one of my project managers mentioned Shift. It has similar interface like Slack App. But I didn’t try any of them. I used alternative app, namely Franz. After some time of using Franz, the app limits to three services only, meaning I can maximum run three services at the same time, such as one GMail, one Slack, one Google Calendar, no extra.

After Franz, I found the other alternative, that’s Rambox. It is very good solution so far.

The rationale that I use different app for the communications is to decentralize the usage of single web browser for all tasks. Let’s say the web browser crashes, the communication app can still work.

However, I plan to centralize every task in Brave, in order to try out the potentiality. In order to make a working environment similar to Rambox or Franz, this is what I am doing:

  1. Create a bookmark folder, eg: Workspace
  2. Create all the bookmarks for my working web app in the folder
  3. Whenever I work, just right-click and open all bookmarks in the folder in New Window
  4. Practise that the New Window is for communication only, don’t open new tab for browsing or development.

By doing the above, Rambox will be unnecessary.

Lenovo Legion Y7000 (2019)

In my previous blog, I mentioned I changed a new laptop. My older faulty laptop is Dell Vostro 5459, which was four years old. My current laptop is Lenovo Legion Y7000 2019 PG0 model 81T0, which as higher spec than the old one. Besides that, I added another 1T HDD, just in case I may doing machine learning study, or my work requires large disk space.

Note: All the instructions should follow official Arch Linux Wiki. The followings are only based on my experience of this installation.

Installation preparation

Since I have an extra HDD and plan for dual boot, I preserve the Windows in the SSD. Therefore in Windows, firstly disable Fast Boot, and secondly allow UTC time.

After this, I disable the Secure Boot through BIOS.

Since my primary OS is Arch Linux, I usually prepare two Live USBs, Arch Linux and SystemRescueCD. I just found that the recent SystemRescueCD is built based on Arch Linux.

SystemRescueCD is useful especially doing partitioning, shrinking/growing partition, and moving partitions, using GUI. Command-line like cfdisk and cgdisk can do partitioning, but moving partitions will be less intuitive comparing to GUI.

However, I failed to run SystemRescueCD with Xorg (running startx) due to graphic driver issue. (Though later, I found that it can be solved by going to BIOS, and change the Graphic Mode to “Switchable”, where the default is “Discrete”.)

As a result, I continued with Arch Linux Live USB. Due to the graphic driver issue, the TTY is not rendered properly. This can be solved by adding nomodeset parameter to the Kernel, by editing the GRUB menu during the boot.

Network

After boot into the Arch Linux installation Live USB, the first thing must solve is the networking. In this modern day, a laptop that cannot connect internet with WiFi is useless. However, the WiFi of Lenovo Legion Y7000 was blocked (plane mode) by default when running in Live USB. This can be solved by rfkill unblock all. Then, I started the network service with netctl.

Partitioning and boot loader

I believe most modern laptop and HDD support GPT. Since I am using command-line interface, cgdisk is sufficient for the partitioning. I created three partitions, for / (root), swap, and /home.

After partitioning and mounting, I installed the Arch through network.

Boot loader is a little troublesome. I chose GRUB. I believe most modern laptop supports EFI. So, I booted into Windows and used Disk Management to find the partition that is used for boot. One of the partitions is EFI.

Then in Arch Linux live media, I installed grub, os-probe, and efibootmgr.

Note: I installed the grub after I have run pacstrap. pacstrap will create /boot directory. So, I renamed it to /boot to /boot~, and create another /boot for GRUB installation.

I mounted the partition to /boot (in arch-chroot environment), then follow the instructions here.

os-probe is useful to allow dual boot to Windows, as it will generate the GRUB menu entry for Windows automatically.

After this, reboot to make sure we can boot into the new installation.

Note: Add nomodeset to the Kernel in the /etc/default/grub if rendering fails.

Network again

After boot into newly installed Arch Linux, I was not able to connect internet, because required packages were not installed. So, I needed to boot to the live media again, with the network connection, install wpa_supplicant, netctl, and dhcpcd. Then at least I can connect to internet with the newly installed Arch Linux.

NVIDIA

After the network, the second big problem is NVIDIA. I choose NVIDIA, because it supports CUDA, as it is important for machine learning, especially deep learning.

I used nvidia-dkms, which I have good experience with this package.

But I faced two main problems. One is the brightness not able to be controlled when running Xorg. The documentation mentioned that this can be solved by adding

option "RegistryDwords" "EnableBrightnessControl=1"

in /etc/X11/xorg.conf or relevant file, under “Device” section “nvidia” driver.

The above solution doesn’t work perfectly. When I boot into LightDM (display manager), sometimes the brightness is 100%, which I cannot reduce the brightness. But sometimes it works fine.

When the brightness is 100%, I need to restart the LightDM, or login and logout (I am using Openbox). Then the brightness is controllable.

The second problem is hibernation. I failed to resume from hibernation. It was a nightmare, as one of my testings failed to boot properly.

I have tried several solution, such as this, and this, and this. None of them work.

I also tried to use linux-lts. But it doesn’t solve the brightness problem, and the WiFi failed to work. So, I give up linux-lts.

And I give up the hibernation as well. It is useful, but I still can work without hibernation.

Note: After successful installation of NVIDIA, we can remove nomodeset from the GRUB entry.

Touchpad

I was using Synaptics. But it is no longer actively updated, and the official documentation suggest to use libinput.

So, I am using libinput now, but it sadly doesn’t support circular scrolling.

f.lux

I was using f.lux for health purpose. However, f.lux package doesn’t work on new laptop with NVIDIA. So, I switch to Redshift. The drawback is that, unlike f.lux GUI, Redshift is not able to change the colour temperature on the fly.

Leftover tasks

After these, I have to migrate a lot of data from my previous computer.

Danshari is necessary, so that not all data need to be migrated.

Family and personal photos (and some videos) are important, as they tell me who I was.

Personal data are important, as they tell me who I am.

Working data are important, as they allow me to continue what I am working with.

Configuration files are important, as I need not to waste my time to setup everything again. Especially Openbox, tint2, Mendeley Desktop, Postman, DBeaver, Emacs, VIM, bash, zsh, SSH, fcitx, fonts (and fontconfig), etc.

Other data files like movies, pictures, music are less important, but valuable. As I need not to collect them again.

Chinese New Year and new laptop

This was a disastrous week. Firstly, internet network cable broken. Secondly, my laptop went wild. Internet network cable broken, I still can online through mobile hotspot. But my laptop, it was catastrophic problem. Because I have a lot of valuable data, and I have to work.

Chinese proverb, 旧的不去,新的不来, but it was damn pressure. Because the old laptop had unpredictable behaviour. The problem was that, the keyboard will trigger some keys unintentionally, especially Alt key. I thought it was software problem, but until I reboot, and saw the GRUB menu cursor moving by itself. Damn! This means, (i) I am not able to work, (ii) I have to spend money to buy new laptop, and (iii) I need to get my data out.

First problem means that, I may not able to earn money during the period, as I am a freelance software engineer. Second problem means that, I need to spend money, with the possibility that I am not able to generate income, and the new laptop may not be Linux compatible. Linux compatibility is important to me, due to the familiarity and the working environment. Third problem means that, I may have possibility loss the data. I have done backup, but not frequent and not all data were backup. Though those data which I didn’t backup were less important, they are still valuable as I spent time on them.

Surely most important data are family photos, personal data, and those work related things. Though we use “git” and commit our source code, setup everything again spends time. Your employer doesn’t pay you to setup, but pay you to work. That is why I felt very pressure.

I prayed, I prayed, and prayed. Luckily keyboard problem was partially solved with USB keyboard, and Linux command “xinput float” can disconnect the built-in keyboard. And the new laptop can be used to work now (since yesterday). Though new laptop has higher hardware specifications than the old one, it is not perfect, as I failed to make it able to hibernate. NVIDIA and Linux combination is sh*t. But I still need NVIDIA, just in case I have to do machine learning with CUDA. So, for the moment, I have to sacrifice hibernation. Also, during the testing when resume from hibernation, it showed a freaking behaviour, I cannot type in the LightDM login. Damn, I cannot bear it if new laptop also broken.

Hopefully this is the end of the accident. I pray that this year will be new as this new powerful laptop.

祸不单行昨夜行,福无双至今日至。祝大家新年快乐。

MacBook Air 11-inch (Late 2010) revive

Recently, I revived my old laptop HP Pavilion dv3, due to the need of second computer to do my research study.

Since it is revived, and works smoothly, I then revived a tablet which was not used, Samsung Galaxy Tab 10.1 (P7500). I flashed the AOSP 7.1.2 Nougat. And it is revived also. However, the hardware specification is too antique, it can neither install Google Chrome nor Firefox. Most of the apps failed to run. 😩

Then lastly, there is a MacBook Air 11-inch (Late 2010), which I have installed Arch Linux onto it before. However, because it has been long time didn’t update all the packages, there are a lot of troubles.

For instance, after partial upgrade, when I ran pacman or pacman-key --init, it complained about

error while loading shared libraries: libreadline.so.6

Even after I boot with Arch Linux LiveUSB, this issue was hardly to be solved. This is because existing packages fulfil the dependencies, but the linked shared libraries’ versions were different.

Another issue was that it complained about

error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

This is even worst. The final solution was to install the latest gnupg, gnutls, and libassuan (as described here). Once pacman can work, then all the upgrades should work fine.

 

MacBook hot (heat) issue

After finished upgrading Arch Linux, there was an issue that I noticed when I first time installed Arch Linux on Mac. The machine was very hot, and the fan was spinning loudly. I firstly thought it was because of the WiFi device driver issue, because this happened even I run Arch Linux with TTY only.

I tried to install macfanctld (according to this), thermald, and cpupower (according to this). But none them solved the over heating issue.

Then after some readings from the forum (such as this post), the possible root cause was the graphic card driver issue, which Nouveau is not compatible with Mac. In order to solve this, I found the solution here (related post here) which allows me to use NVidia graphic card driver. This is a fantastic solution. I tested, and it works.

One thing to note. In the description of the solution, it says

cat << EOF
setpci -s "00:17.0" 3e.b=8
setpci -s "04:00.0" 04.b=7
EOF

Where the “00:17.0” and “04:00.0” may differ for each machine. However, “3e.b” and “04.b”, are just magic number that I just follow them. Though I don’t know what they mean actually.

Now MacBook Air is revived without overheating issue.

AAC audio file and ID3 tag

I just found that, if I have an AAC audio file (technically M4A), and if I added the ID3 tag 2 (aka ID3v2), then the audio file will failed to be converted by ffmpeg.

It can be either converted to mp3

  • using DeadBeef audio player, or
  • remove the ID3v2 tag then convert

So, how to add the metadata like ID3 tag? Use the Kid3 and add the Tag 3 (aka APE tag). This will not affect how ffmpeg to read the file.