Tutorial #25: TWEAKING THE ASUS TUF GAMING A15 - Part Deux

 



My previous post about the A15 was about plucking the low hanging fruit of performance. However, there is always the scope of optimising the settings further to gain the greatest benefit for the lowest cost. That is what I was up to on and off since the last post and having reached a satisfactory result, I have decided to share the same for anyone trying to squeeze the little bit extra from this hardware.

The base concept is still the same, to get more out of the GPU at the expense of CPU within the permitted power and thermal budget. To that end, I went through the process as follows:

1. Reduced the CPU temperature and Normal/Short/Long TDP limits to 85 and 25/35/45 respectively in Ryzen controller to provide further headroom to the GPU.

2. Reset the MSI Afterburner settings to stock which had the following curve for my RTX2060.

3. Ran an actual game as I would like to play it (in this case Dishonored 2 at 2K Ultra with HBAO and Triple Buffer) and noted the Average and Maximum GPU frequencies attained in the middle of the game.

4. Few observations first. Neither the CPU or GPU are thermally throttled in any way. Instead, the GPU hits the power limit which in the case of the A15 is 90W. Note that the included GPU is the RTX 2060 Notebook Refresh and thus it is a 110W TGP part. This indicates that the laptop does have thermal capacity to spare, especially as I had conducted these test with an ambient temperature close to mid-30 degree Celsius. Having the option to push the GPU Power further would have been great but with that being an impossibility with a locked BIOS, the next step was to figure out how to extract the most from the hand I have been dealt with.

To that end, I noted the frequencies which yielded the sustained performance (1560 MHz @812 mV) and the peak performance (1755 Mhz @918 mV) in-game.


This concluded the stock performance analysis. Now, there might be multiple guides present that put forth different suggestions as to how you can proceed with undervolting or overclocking but I decided to use these figures to try to set a target that I wanted to attain. In this case, it was to try to push the stock sustained performance to the lowest voltage (i.e. 1560@700) and the peak stock performance to the sustained voltage (i.e. 1755@812). Doing so manually with a smooth curve was going to be quite a challenge, so I decided to take a bit of a shortcut in attaining this objective as follows:

5. Executed the Nvidia OC Scanner within MSI Afterburner to produce an OC curve. The curves are not always the same, so I executed it a few times, also at slightly different CPU TDPs to come up with the curve that resulted in the highest boost frequency. In this case, it was as indicated below.


If I look at the frequencies at the concerned voltages, then it is 1515@700 and 1755@812. Thus, it seems I have almost attained the target I set out for without doing much.

 
Taking a look at the HWInfo figures again with the OC curve, it can be seen now that the sustained frequency has jumped to 1725 MHz from 1560 Mhz which is a decent OC. Also, the peak frequency now is at 2040 MHz which is an even bigger leap but it comes at a much higher voltage (1006 mV). The effect of this however is that the GPU is now hitting all the performance limits apart from the thermal one.

Almost there, but "almost" is not good enough, so I had to push it a bit further.


6. At this point, I decided to try to move the curve to the left, in effect overclocking the OC curve even further to see how much more performance can be extracted from it. I started by essentially shifting the curve to the left by 25 mV but as soon after I started encountering artifacts within the game indicating that I had pushed it a bit too far. As a result, I shifted the curve by 12.5 mV instead and found it to be perfectly stable. 

The other change I did was to flatten the curve at the half-way mark of the complete voltage range which is at 975 mV. There are various reasons to do so, primary of which was that the GPU never really reaches the frequency associated with that voltage and if it does as stated in the point above, it is for a fraction of a second. Consequently, it also saves the effort of manually adjusting the curve in futility. An argument could be made that the curve can be flattened even earlier to essentially attain an undervolt but I wanted to allow the GPU to boost to its practical maximum as much as possible.

With the above, after smoothing out the double frequency jumps (15 Mhz instead of 30 Mhz for a single increment in voltage step), I was left with the curve indicated below.


It starts at 1560@700 (surprise!), reaches 1755@800 and peaks at 2010@975. So how does this curve now fare within the game?


Firstly, we are back to only hitting the power and utilisation limit. The sustained in-game frequency is now 1755 Mhz, a further 30 Mhz boost from the default OC Scanner curve. The peak frequency is now 1965 Mhz though as against 2040 MHz earlier, but as I mentioned previously, it is transient and if you look at the average GPU power, it has come down to 69.4W compared to 70.3W for the OC scanner curve and 71.3W for the default curve. Amusingly, the maximum power consumption was over 97W with the stock curve and I also observed it breaching the 100W barrier in an intermediate test. May be it is due to some quirk in HWInfo or otherwise, the card is indeed capable of going over its locked TDP of 90W in some cases, though without much benefit.

7. With the GPU OC sorted, next, I wanted to see if I can push the CPU a bit more in co-ordination with this curve. You will have to take my word for it, but I tried increments and decrements for all the TDP values while keeping the temperature limit at 85 degrees Celsius and I finally found the best performance at Normal/Long/Short TDP of 25/40/50 respectively.


The proof, of course, is in the pudding. Thus, I present to you now, the comparison between the stock performance and after the CPU/GPU tweak. The duration of the HWInfo figures spanned from the launch of the Time Spy test to the calculation of the score.

Stock:

Post tweak:

A good jump and also a slightly higher score than the tweak in my last article (6703). What it doesn't indicate though is that the power consumption is lower than last time.

8. One last thing! I didn't at any point mention anything about the GPU memory overclock because I kept it for the last. After trying out different increments, I settled for a boost of 500 MHz as it was stable and didn't lead to any noticeable increment in power consumption and thermals. With that, here is the final result.


To put things in perspective then, this is how the tweak stacks up against the stock setting.








Tutorial #24: Tweaking the Asus Tuf Gaming A15


Previously, in my review of the laptop, the only tweaking I had undertaken was an auto-overclock of the GPU which, as per expectation, yielded a performance improvement of around 6% overall with only a slight loss in CPU performance, purely on the basis of the additional available thermal headroom.


During that time I had left the CPU untouched because AMD does not officially support tweaking on laptops and Ryzen Controller did not work for me then. However, later I came across Renoir Mobile Tuning and found it to be operational for this laptop, albeit with a few bugs. I switched to Ryzen Controller again and found that it too now worked well for Renoir with the additional benefit of applying the setting automatically on boot.

With a CPU tuning tool in place, the next thing was determining what to do with it. While these tools often end up as overclocking utilities, my intention couldn't be further opposite to that. The idea was to effectively underclock the system without losing performance i.e. to reduce the temperatures while still maintaining a performance boost over the stock settings.

To cut a long story short, I played around various combination of settings to finally settle on one that seems to work the best. Not that it an exhaustive analysis but rather the most practical among the ones I had tried. Note that I only experimented with the Boost TDPs and the temperature limits. The boost duration seemed pretty logical and I did not want to introduce yet another variable that muddied up the testing. Eventually this resulted in the following changes:
  • Temperature Limit: 90
  • Long Boost TDP: 54 
  • Short Boost TDP: 50
For reference, the default temperature limit is 95 with long and short boost TDPs of 60 and 54 respectively. Also, I auto-overclocked the GPU again to make the most of any benefit available from reduction of the CPU performance. So, how did this theoretical reduction in CPU performance impact the benchmark scores for Fire Strike and Time Spy compared to the ones from the review?


As expected, this has quite an impact on the CPU performance as it has dropped by nearly 5% but on the other hand the graphics score has jumped by 1% resulting in an overall gain of 0.7% on Fire Strike, taking it past 16,000 for the first time. However, the result for Time Spy was more interesting as there was a minor loss instead overall indicating the underclock has more of an impact of DX12 than it does on DX11, which is probably not unexpected. Note that this is an indication of the gain over the gain already achieved by overclocking the GPU originally, so overall the incremental gain is still worth it.

Lastly, the laptop has a secret weapon up its sleeve. Until now, all the tests were conducted using the default Performance mode. However, there is also a Turbo mode which sets the fans whirring to possibly the maximum setting under full load. Yes, it boosts up the scores even further. Below I have again attached a comparison of the Turbo mode performance for the stock CPU settings in comparison to the underclocked one and it is quite the same as earlier. While the DX11 performance is higher with the underclock, it is lower by an equal proportion in case of DX12. 

It has to be kept in mind though that apart from the scores, the underclock has an additional benefit in reducing the overall temperatures and also prolonging the life of the components. Also with the combination of the 4800H with the RTX2060, it is the latter that is going to hit the limit rather easily compared to the former, so a sacrifice of CPU performance for a GPU gain makes a lot more sense.

Finally, I leave you with a comparison of the current profile comprising of a GPU Overclock and CPU Underclock on Turbo with the stock GPU and CPU settings.

A jump of 7.8% on DX11 and 6.6% on DX12 with lower overall temperatures to boot is nothing shoddy. Seems something called as free lunch does exist after all.

Tutorial #23: Taming the beast (Dell XPS 7590 Core i9)


One of the significant purchases I made over the past 6 months is the Dell XPS 7590 with Intel's Coffee Lake Core i9-9980HK, Samsung's 32 GB DDR4-2667 RAM, Toshiba's 1 TB SSD, Nvidia's GTX 1650 and the crème de la crème that is the 4K OLED panel made by Samsung. But before you get any ideas, this is not a device that I would have otherwise purchased but for the fact that I found a single piece listed on Amazon 2 days prior to its official launch of the device at a price that was lesser than the 2019 Acer Helios 300. The risk was worth it as it came sealed with a valid 12-month Premium Plus support from Dell. There are instances in one's life where one doesn't mind getting lucky and this was certainly one of those.

Normally, I would be prompt in reviewing devices within the first few weeks of purchase. However, in this case I think I am too biased towards the device to perhaps put up a worthwhile review. Hence, I thought it better to post a tutorial that would be of some assistance to fellow users. One thing that I am certain of is that the hardware has outgrown the XPS chassis design over the years and the Core i9 pushes things a bit too far in terms of what the chassis is capable of handling thermally. Hence, I went on an optimisation quest with the intention of lowering the temperatures and increasing the overall efficiency of the device. I will own up to the fact that I don't intend to use the device on battery at all unless I am forced to but for that eventuality I decided to find a compromise which would at least provide stock performance at lower battery consumption as against higher performance when operating directly on AC.

The tool of choice in this case for the CPU is Throttlestop which offers significantly more tweaking potential than Intel's Extreme Tuning utility. As for the GPU, the mainstream tool to use is MSI Afterburner. However, in case of this GPU, I found that the temperature limit setting on MSI AB was locked for some reason even after unlocking all the advanced options and the Auto Overclocker resulted in far too frequent game crashes. Hence, I instead went ahead with Asus GPU Tweak II which allowed the GPU temperature target to be set upfront. By default, this is set to 75 Celsius and I instead bumped it to the stock value of GTX 1650 which is 87 Celsius. However, the idea in general is to still not exceed 75 Celsius during most strenuous tasks but to provide the headroom to exceed that if needed.

With this background, in the interest of time, I have decided to simply post the screenshots of the various screens from the tools since further elaboration on each parameter can be found on their respective forums. In case of the GPU, I eventually stuck with simply pushing up the clocks by 10% as undervolting using the frequency curve resulted in far too many instability issues. Is this the most optimum setting possible, most probably not. However, I believe this is the best setting I could identify with trial and error, as attested by the 88 unexpected reboots on record. I could certainly push the clocks and voltages quite a bit more but in general it led to instability and I am certainly no fan of BSODs. Another point to note is that while Asus GPU Tweak II can be set to start on reboot, Throttlestop requires additional effort in setting up the task scheduler which is what I have indicated below.

Starting Throttlestop on Login:

Throttlestop settings for AC profile:

Throttlestop settings for Battery profile:

Now to focus on the fruits of the labour or the pudding so to say. I am not a fan of benchmarks in general but in this case, I needed something to comparatively measure the impact of the changes and a few basic benchmarks provide the easiest reference in this case. Note that I ran all the benchmarks with only the discrete GPU enabled with the overclock settings, so it represents the worst possible scenario in case of thermals.

UserBenchmark:
This might not be the first benchmark utility that springs to mind but for the fact that it allows comparative analysis for similar hardware components and is of considerably short duration. In this case, the CPU came up at 97th percentile and the GPU at 100% percentile which, considering the fact that is mostly going up against much bulkier gaming laptops with much better thermals, is noteworthy. Overall, the CPU efficiency is excellent with the tweaks providing higher performance at lower power. The discrete GPU however doesn't scale up in terms of efficiency and while it is possible to get more performance out of it, it comes at a significant cost in terms of power and heat.

Cinebench:
Cinebench really pushes the CPU and is thus a good test of its ultimate performance. A sequence of 2 consecutive runs also pushes the CPU to its thermal limits. Not surprisingly then, the 1st run score of 3684 is more than 20% better than stock and even the 2nd consecutive run scores better than the stock settings with lower average temperatures.

Heaven:
This benchmark was run at the Extreme preset. As I have already mentioned previously, pushing the GPU doesn't really yield huge benefits in this constrained form factor as the any performance benefits come with equally higher power consumption and heat generation. However, as can be seen in the results, a 3% performance boost in Heaven comes with lower CPU temperatures and the GPU power consumption is lower even though it hasn't been undervolted. So, a win-win overall.

Lastly, how do these modifications fare with a modern game. I happen to have Hitman 2 installed at present, so I thought I'd give it a go with the in-built benchmarks which I frankly didn't find to be entirely consistent across different runs. But I believe it should give at least give an idea of what the laptop is now capable of, even though it is not meant to be a gaming laptop.
I set all the details to the maximum possible apart from lowering it a notch to 'High' for 'Level of Detail', 'SSAO' and 'Shadow Quality', besides turning 'Motion Blur' to 'Off'. The Mumbai benchmark produced a score of 70.95 FPS with CPU averaging at 79C and the GPU at 70C. The more demanding Miami benchmark chewed out 54.04 FPS with CPU/GPU temperatures averaging at 78C/69C respectively. A more than serviceable gaming machine if I may say so.

Tutorial #22: Optimal performance from the Samsung Galaxy A50 (or any mid-range device)


The demands from the hardware have arisen significantly with every passing year, which is only made worse by manufacturer-specific UIs adding an extra layer of cruft. While hardware capabilities increase demonstrably every year, the software demands more than negate the gains and ensure that even last year's flagship is not a safe bet anymore. However, not everyone needs the latest flagship device or wants to spend a small fortune for the extra processing power.

As I touched upon previously, my primary reason for getting the A50 was the large OLED screen. With gaming on the mobile out of the picture, all I really wanted was to not have a horrible user experience which becomes part and parcel of any mid-range device over time. Mi devices are most offending in that respect with MIUI but Samsung hasn't won itself any honors by bundling lots of promoted apps, some uninstallable, coupled with a Samsung Pay Mini card that interferes with the gesture system.

While adb commands offer a fair degree of control over the device, I prefer to root the device when possible to be able to customise it just that bit better with lesser hassles. The Samsung A50 has perhaps the unintended benefit of being able to boot into the rooted as well as the unrooted system at any point of time which kind of ensure the best of both worlds, if you are not looking to use rooted apps all the time.

With this, I present a step-by-step guide to setting up the device to run like it does when brand new, only better because of the uninstallation of all the bloatware. While it wouldn't make any of games run any faster than what the hardware allows it to, what it does is ensure that the phone is running optimally at any point of time, so no memory-hogs or sudden slow-downs or battery-drains.

1. Rooting the device (optional)

First the disclaimer. Rooting the A50 trips the Knox bit, so you are immediately foregoing device warranty as well as the ability to use any Knox-secured apps like Secure folder and Samsung Pass, though you can still run some Samsung apps like Pay Mini and Health.

For this, I will simply point you to John Wu's excellent tutorial. It has worked with every firmware released till date and allows you to upgrade to every new release while retaining your data, the downside being that you will have to download the entire firmware to do so as OTAs are no-go.

Also, as I mentioned previously, the peculiar partitioning and button combination allows one to boot in to either the rooted or the unrooted system. I personally prefer optimising the system in root mode but don't run it as daily driver as it has issues with WiFi disconnections and random reboots. However, the changes are carried over just fine to the unrooted system which is rock stable and has not rebooted randomly on me till date.

2. Installing Island and making it device admin

Island makes use of the 'Android for Work' feature to create a separate work profile for which it, and consequently you, are the admin. It can be made the device admin without root access provided you delete all other user accounts and make it the admin using adb commands. There is also the option of God Mode which essentially allows Island to control the Mainland apps.

3. Installing Greenify

However, Island by itself doesn't have a background service and it utilises Greenify for that purpose, unsurprisingly from the same developer. While Greenify can normally hibernate apps using Android Doze, the integration with Island takes it to the next level.

4. Deep Hibernation
The easiest way to ensure that apps undergo deep hibernation is to select the 'Auto-freeze with Greenify' option from within Island. This directly adds the app to the "Hibernation list" in Greenify with the 'Deep Hibernation (by Island)' option enabled. Alternately, one can manually add the app within Greenify and then select the same hibernation option.

5. Create 'Unfreeze' shortcut
Subsequent to selecting an app for Deep Hibernation within Island as mentioned in the previous step, it is a good idea to immediately select the 'Create Unfreeze & Launch Shortcut' option which does what it says. It allows you to directly launch the hibernated app but requires you to maintain the shortcut on the homescreen, iOS-style.

6. Create Hibernation Shortcut
Lastly, I would suggest selecting the 'Create Hibernation Shortcut' from the Greenify menu. This places a "Hibernate" shortcut on the home screen, selecting which immediately freezes all the apps for which 'Deep Hibernation (by Island)' has been selected while also queuing up for normal hibernation any other apps you might have selected within Greenify.

7. Profit
The screenshot above indicates my app drawer post-hibernation and as you can see, the "all-time" enabled apps don't even cover a single drawer page (the folders only contain about 4 apps each). At the end of the day, you really don't need Maps or Uber running all the time in the background and tracking your location while draining the battery. Another illustration is the immediate memory consumption which in this example goes from 951 MB free to 1.2 GB free, just by hibernating the currently running apps. The interface fluidity and memory consumption is certainly much better by having only a limited number of running apps at any point of time.
The other benefit is that you can run dual instances of nearly every app, independently within Mainland and Island. A tip over here - it is recommended to create a separate folder (or tab) within your launcher in which you can retain the Island apps that you wouldn't like to be frozen like the duplicates of Play Store or VPN apps. It simply makes the launcher look cleaner and perhaps helps prevent confusion in case the padlock symbol against the Island app icons doesn't work for you.

8. Loss

The only downside I have seen is that the apps don't come up for update on the Play Store unless they are enabled, so be sure to check the Play Store for updates every now and then. Also, as I mentioned previously, the hibernated apps altogether disappear from the launcher and don't reappear within the folder you might have assigned to them, as they are effectively seen as new apps by the launcher on every "unhibernation", though the app data is retained. Hence, the recommendation to create the unfreeze shortcuts on the home screen.

9. Conclusion

There can be some paranoia over having an app become the device admin, especially coming from China. However, I have previously interacted with the app developer over email and have found him to be polite while immediately addressing the issues reported by me.

If you simply want the benefits of an independent work profile, you can use the Test DPC app which allows you full control over the work profile as an admin. You can also use the open-source equivalent of Island known as Shelter.

However, neither of the apps integrate with Greenify like Island and neither are able to create a work profile when the Knox bit is tripped. Hence, in my case, it is the only feasible option to keep rogue Android apps in check. In case you feel differently or have any queries, feel free to drop a comment below and I shall do my best to address the same.

Tutorial #20: Home (Network) Improvement using a Pi


Update #1 (Aug 19, 2018):

With the passage of time, things change and in this case it is mostly for the better. I was setting up the Pi once again and was pleasantly surprised that some of the workarounds mentioned previously are no longer needed. Thus, I have edited the original tutorial to accommodate these changes while striking out the old text.

Also, after comparison, I found AB-Solution to be a better solution for network-wide ad blocking, if you happen to have a Merlin supported Asus router like I do. Since the router is on 24x7, having an old ext2 formatted pen drive plugged in to the router itself and running ab-solution is a better alternative as against running the Pi 24x7. It also has various preset ad blocking files that suit different needs while pixelserv-tls does a great job with HTTPS ads.

Lastly, I failed to mention the option of having a Samba server running on the Pi itself in order to access the files directly from the pen drive over the network. This can be accomplished by simply following the official tutorial on the Raspberry Pi website.

Original Article (May 3, 2018):

I had previously shared some tutorials in setting up the Pi and putting it to good use. However, the use cases I mentioned then have ceased to exist. The Fire TV has taken care of most of my multimedia needs and I have come to realise that I really don't have much time to go back in time for nostalgia. For the retro needs that remain, the lesser-used Core M 5Y10 equipped Windows tablet of mine does a much better job plugged in to the TV.

Hence, it is time to put the Pi to good use in a different sense. Thankfully, the versatility of the Pi means that it is not difficult to identify its next project. Ads can become a nuisance, especially for the more aged members of the family and hence my first intent was to set up an ad blocker across my home network. However, putting the Pi to such limited use and keeping it on 24/7 would be quite a waste, so I decided to also repurpose it as a download box with centralised storage.

Setting up the tools necessary to accomplish these tasks seemed straightforward. However, the relevancy of publicly available tutorials diminish over time due to changes in technology. In fact, I had to put quite some effort beyond the listed tutorials and hence I have decided to put the same to words for posterity.

Before starting out:

PINN is a great utility when multi-booting across different distributions on the same SD card. However, Raspbian alone fits the bill for the current use case. Hence, writing the raw Raspbian image directly on the card is preferable as it provides more usable space. As far as writing on the card goes, Etcher is the way to go.

1. Pi-hole®

As the website so prominently displays, all you need is a single command.

curl -sSL https://install.pi-hole.net | bash
However, I made a couple of settings that are worth mentioning:

a. The predefined list of upstream DNS providers does not yet include Cloudflare which I found to be the fastest of the lot. Hence, it would be worthwhile to use the custom option and enter the Cloudflare DNS Server IP addresses of 1.1.1.1 and 1.0.0.1.

b. The other part of the equation is setting up the home equipment to use the local DNS server. In case of Asus routers, this implies changing the DNS Server IP address to the Pi-hole one, not only on the WAN page (under WAN DNS Settings) but also under LAN > DHCP Server > DNS and WINS Server Setting. Make sure that there are no other IP addresses present in either of the pages. You could also run the DHCP server on Pi-hole, in which case the latter setting is not needed. However, since I use the router-assigned IP addresses for other functions (eg. VPN), I prefer to have the DHCP server running on the router itself.

2. qBittorrent

qBittorrent has been my preferred Bittorrent client for quite some time with it being open-source and having proper support for proxies as against Transmission. It can be installed easily using APT, though I prefer the headless route.

sudo apt-get install qbittorrent-nox
My primary endeavour was to have the downloaded files ready on the USB 3.0 hard disk connected to my router (and thus acting like a NAS) while minimising the read-write operations. Since it is not a great idea to write to the SD card running the client, I decided to plug in an old 32 GB pen drive to act as the "working folder" by adding it under Downloads > Hard Disk > Keep incomplete torrents in:

The next part was to add the network drive as the final resting place by entering its address under  Downloads > Hard Disk >  Save files to location: and also under the Copy .torrent files for finished downloads to field. The latter is sometimes necessary due to some quirks in different versions of qBittorrent. The external network drive needs to be mounted within Raspbian on boot which can be accomplished by editing /etc/fstab with these details:

mount -t cifs //xx.xx.xx.xx/folder /media/NAS -o rw,vers=2.0,username=abc,password=xyz
//xx.xx.xx.xx/folder /media/NAS cifs vers=1.0,username=abc,password=xyz,x-systemd.automount

where,
xx.xx.xx.xx -> LAN IP address as configured on the router running the Samba server
folder -> Path to the folder on the network drive that needs to be mounted
/media/NAS -> Path on the Pi where the network drive is to be mounted

In my case, I had to specifically mention the SMB version (2.0), without which the mounting would fail as well as the rw argument to be able to write to the device. Also. it is a good idea to update the cifs-util package from APT prior to editing the fstab file, as mentioned above.

Note: The earlier entry no longer worked with the June 2018 version of Raspbian due to which I had to use the alternative entry in /etc/fstab mentioned above. Also, I was only able to get v1.0 working this time despite the server supporting v2.0 as well.

Finally, to cover for unexpected reboots, it is preferable to have qBittorrent autostart which can be accomplished using systemd. First, create the startup script using:

sudo nano /etc/systemd/system/qbittorrent.service
Next, enter its contents as follows:

[Unit]
Description=qBittorrent Daemon Service
After=network.target
[Service]
User=pi
ExecStart=/usr/bin/qbittorrent-nox
ExecStop=/usr/bin/killall -w qbittorrent-nox
[Install]
WantedBy=multi-user.target 
Lastly, enable the script.

sudo systemctl enable qbittorrent
3. pyLoad

The final part of the exercise was to set up a download manager. I had briefly given thought to JDownloader but decided against running JRE just for it. Hence, I opted for pyLoad instead. The tutorial listed over here works fine for the most part but needed quite some tweaks along the way. For the sake of completion, I will list all the steps in brief.

1. Create system user for pyload

sudo adduser --system pyload
2. Edit /etc/apt/sources.list to be able to install the dependencies. For Raspbian Stretch, the source URLs are as follows:

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi
3. Update package list and install dependencies.

sudo apt-get update
sudo apt-get -y install git liblept4 python python-crypto python-pycurl python-imaging tesseract-ocr zip unzip python-openssl libmozjs-24-bin
sudo apt-get -y build-dep rar unrar-nonfree
sudo apt-get source -b unrar-nonfree
sudo dpkg -i unrar_*_armhf.deb
sudo rm -rf unrar-*
4.  Create symlink to get "spidermonkey" working.
cd /usr/bin
sudo ln -s js24 js
5. Unlike in the linked tutorial, I had to first switch to the stable branch before I could initiate the pyLoad setup. This is done as follows:

cd /opt
sudo git clone https://github.com/pyload/pyload.git
cd pyload
git branch -r
git checkout stable 
 6. The next step, as per the linked tutorial, should have been the initiation of the pyLoad setup using:


sudo -u pyload python pyLoadCore.py
However, doing so produced the following error: "ImportError: No module named pycurl". Hence the next logical step was to install pycurl:


sudo pip -v install pycurl --upgrade
This in turn resulted in the error: "InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-IsWfyN/pycurl/". This was resolved by:


sudo apt-get install libcurl4-gnutls-devpip
 As you can now guess, this in turn resulted in yet another error: "Failed building wheel for pycurl" which was remedied as follows:


sudo apt-get install libgnutls28-dev

After all this effort, I was finally able to install pycurl using the command mentioned previously...


sudo pip -v install pycurl --upgrade 
...and execute the pyLoad setup using a slightly shorter command:


 python pyLoadCore.py
On the June 2018 release, I was able to get pyload wizard started by executing
sudo -u pyload python pyLoadCore.py 

The final tweak was to get pyLoad running on boot with the commands executed in a manner similar to what has been already covered for qBittorrent.

sudo nano /etc/systemd/system/pyload.service 
[Unit]
Description=Python Downloader
After=network.target
[Service]
User=pyload
ExecStart=/usr/bin/python /opt/pyload/pyLoadCore.py
[Install]
WantedBy=multi-user.target
 sudo systemctl enable pyload.service
Beyond Home

The benefits of this setup can be extended beyond the home network, though a lot depends on the vagaries of the network setup.

Pi-hole can be put to use on external networks by accessing the home network over OpenVPN, though speed and latency might be factors to consider. It can also be setup as a Public DNS but it is extremely risky and not at all recommended.

qBittorrent and pyLoad can be simply accessed using the IP address and port, provided they have been setup to be accessible from outside the LAN. For dynamic IP addresses, the Dynamic DNS (DDNS) option available on most routers can be put to use and my suggestion would be to pick up a cheap $1 domain from NameCheap for this purpose. However, if you happen to be under a multi-layered NAT network under ISP control like me, then there is no option other than to pay for a static IP for public access.

Thankfully, there is a last resort to access the Pi over a public network. The licensed copy of RealVNC that comes with Raspbian offers Cloud Connect that enables one to remotely control the OS and thereby all applications on it. It is quite cumbersome to use if your intent is to only load some links on qBittorrent or pyLoad, but it is better than nothing.

Thus, the Pi can be extremely useful even when used in a rather sedentary capacity and you grow to appreciate the efforts that everyone has put in to make this possible.

Tutorial #19: Optimally managing photos and videos on iOS


Apple’s anaemic storage options (specifically at the lowest tier) have been a running joke for a majority of the iPhone’s existence. I was at the receiving end of Apple’s largesse with the entry-level iPhone 7 switching to 32 GB which was further enhanced to 64 GB with the iPhone 8. Even with these storage options, one can easily fill it up with content other than captured photos and videos. Also, it is not a sound idea to have all your files stored locally on the device, irrespective of its storage capacity.

Apple provides a few options to mitigate the storage issues resulting from ever larger multimedia content. These are as follows:

1. The default option that most may take recourse to is the iCloud Photo Library. However, Apple provides a meagre 5 GB of storage for starters and as is typical of the company, you are expected to pay more to use this option practically. It only makes sense to go with Apple’s cloud if you live on it through other devices in the Apple ecosystem, like the Mac or iPad. The more important thing to note here is that by default Apple syncs your local photo library with the iCloud one, so you can end up permanently deleting your photos from the device as well as the cloud if you are not paying attention.

2. With the release of iOS 11, Apple introduced the high-efficiency formats, HEVC for videos and HEIF for images, that significantly reduce the file size on modern iDevices. The down side to this is that compatibility for this format is still not standard across platforms and devices. Most notably, the HEIF format is not yet natively supported by Windows. Even within Apple’s ecosystem, sharing the images or videos with older devices necessitates a conversion which takes up time as well as processing power on the mobile device.

3. Lastly, iOS also provides an ‘Optimize Storage’ option that keeps a lower quality version of the image on the phone for immediate viewing purpose while retrieving the full quality image from iCloud. This helps in dealing with storage issues but yet again results in the usage of additional time and data.

Luckily for iOS users, there are several third-party options available that allow one to back-up and retrieve photos and videos without having to pay or worry about running out of storage. After using quite a few options, I have shortlisted two well-known ones that together offer an unbeatable 1-2 combination. They are Flickr and Google Photos.

Before starting out, I would recommend that you go to Camera > Formats and select the ‘Most Compatible’ option which uses JPEG/H.264 instead of HEIF/HEVC. This ensures that the images are available for use without any conversion and accessible on all platforms. It will, of course, take up additional space but since we are offloading most of the stuff on to the cloud anyway, storage isn’t a constraint. On the other hand, data usage can be a constraint if you are limited to a cellular network, but the solution here ensures that even that eventuality is covered. As for the ‘Optimize Storage’ option, you can leave it enabled as iOS always provides the full quality image to any other app that requests it.

Our primary solution to the image storage problem is Flickr. One can argue that Flickr has seen better days and the Yahoo hacks might have left a few people dishevelled. Many photographers might have a preference for 500px as well, but that doesn’t take anything away from Flickr as far as our use case is concerned. Assuming that Oath (Verizon) wouldn’t bring about any drastic storage policy changes, Flickr offers the best value proposition for free users. The 1000 GB of storage space is unprecedented and the photography focus of the site is much better for image/photo management compared to a paid, storage-only option like OneDrive.

While Flickr has moved some of its tools like the desktop ‘Uploadr’ under the Pro banner, the iOS app is unaffected. It is capable of syncing with the iOS Photo Library and more importantly, uploading the original image to the cloud. It does not however support the HEIF format as is evident when you try to upload these images over the website. On iOS however, the images in the Photo Library are still uploaded after conversion to JPEG. Hence, I have previously recommended the usage of the ‘Most Compatible’ option to prevent unnecessary conversions. Unfortunately, Flickr doesn’t allow the segregation between photos and videos when uploading over a cellular connection and hence I would recommend syncing only over WiFi, unless you have an uncapped cellular connection.

The sidekick to our protagonist Flickr is Google Photos. On its own, Google Photos is an awesome product. However, ‘original quality’ images and videos are limited to the storage available on Google Drive for non-Pixel users, which in most cases is 15 GB. Luckily, Google offers an unlimited ‘High Quality’ option, which one should note, significantly compresses the image. However, thanks to clever use of algorithms and machine learning, the effects are not visible on most devices unless the image is blown up significantly.

As a secondary backup solution, Google Photos offers some distinct advantages. Firstly, it caches lower quality variants of all the images so that the entire library is accessible even when you are offline. Secondly, it offers smaller-sized files on account of the compression and resolution limitations of 16 MP/1080p, which is useful when accessing or sharing something over a cellular connection on social media. Thirdly, it allows photos and videos to be synced separately over WiFi and cellular connections, so that images can be synced immediately while larger videos can be uploaded later over WiFi. Fourthly, once images are backed up, they can be easily deleted from the device (and iCloud) using the ‘Free up space’ option. However, for this, you should ensure that the original images are first uploaded to Flickr. Lastly, the machine-learning powered search is really useful in unearthing hidden images and recreating past memories.

Thus, the combination of Flickr and Google Photos ensures that you have all your images and videos backed up regularly with redundancy and available on demand. While Flickr provides the long-term, original quality storage; Google Photos complements it with smaller-sized, optimized content for on-the-go consumption. It completely cuts off iCloud from the picture and ensures that you more storage available on your device for things that you need and use far more regularly.

Tutorial #18: Unlocking the bootloader on Redmi Note 3

As I had mentioned in my review of the Redmi Note 3, it was good value for money. However, MIUI proved to be a hindrance for the target user because of which I had switched the device to LineageOS while not rooting it and keeping the bootloader locked. However, with the phone now back in my hands, it was time to break the shackles for good.

To Xiaomi's credit, they have an official process in place for unlocking the bootloader. However, it has its quirks and more often than not following the official guide results in the process being stuck at 50% due to incompatibilities. This was the case with my first attempt and hence I decided to proceed with it unofficially.

As always, I headed to XDA to quickly gather the process for this device. However, the process seems to be a bit outdated and perhaps a bit difficult to follow for the uninitiated, so I have listed the steps undertaken by me. There could be other ROM versions or files you can use but I have mainly picked up the ones from the XDA thread linked above which you might visit in case you need visual reference.

Note: Prior to starting with the flashing process or even after flashing the MIUI ROM in Step 4, make sure you have the 'OEM unlocking' option selected under Developer Options, without which the fastboot unlocking will fail.

Step 1: Download and extract/install the following:
1. MIUI Global ROM v7.2.5.0 (You will have to extract the file twice to get the folder contents)
2. Mi Flash Tool (Official MI tool to flash ROMs - used v2017.7.20.0 at the time of writing)
3. Unlocked emmc_appsboot file (Primary file needed to unlock bootloader)
4. EDL Fastboot (To enter emergency download mode)
5. Minimal ADB and Fastboot (Installs necessary ADB and fastboot drivers)
5. TWRP Recovery (Gateway to flashing anything on the device)

Step 2:
Browse to the 'images' folder within the extract ROM folder (kenzo_global_images_V7.2.5.0.LHOMIDA_20160129.0000.14_5.1_global) and replace the emmc_appsboot.mbn file in that folder with the downloaded one.


Step 3:
After installing the Minimal ADB and Fastboot drivers, connect the phone and run 'edl.cmd' from within the extracted 'fastboot_edl' folder to boot the phone to the emergency download (EDL) mode. If you don't, then the Mi Flash tool may give a 'tz error'. This mode can be recognised by the flashing red LED on the device.


Step 4:
Run the Mi Flash tool using 'XiaoMiFlash.exe' and select the folder containing the extracted ROM files (kenzo_global_images_V7.2.5.0.LHOMIDA_20160129.0000.14_5.1_global). Clicking on 'Refresh' should list the device and then subsequently, click on 'Flash'. The process will take 4-5 minutes to complete after which you will be able to see the 'success' status.

Step 5:
Boot the phone to the normal fastboot mode using the Volume Down + Power button. Open a command prompt window and browse to the 'Minimal ADB and Fastboot' folder. Here, execute the following command:
fastboot oem device-info
It should indicate 'Device unlocked: false', following which execute the command:
fastboot oem unlock-go
Running the 'fastboot oem device-info' command once again should now indicate 'Device unlocked: true'. That's it, your device now has an unlocked bootloader.

Step 6:
While not part of the bootloader unlocking process, a follow-up step should be to flash the TWRP recovery which opens a whole window of opportunities. This can be done by copying the 'twrp-3.1.1-0-kenzo' (latest file at the time of writing) to the 'Minimal ADB and Fastboot' folder and running the following command from the cmd window:
fastboot flash recovery twrp-3.1.1-0-kenzo.img
Following this, you will have complete freedom to tinker with the device in any way you deem apt. Oreo, anyone?

Tutorial #17: A batter(!) understanding of dosa economics


Raghuram Rajan has been featuring a lot in the media recently in promotion of his book 'I Do What I Do'. While I am yet to read it, there has been no escaping it as select excerpts and anecdotes have been making their way to the news every day now. Earlier today it was the turn of 'Dosa Economics' on BBC.

On the face of it, it is a simple concept of understanding the real interest rate as against the nominal one. Most people tend to look at interest rate in absolute terms since it is the most visible one and inflation as the silent killer is rarely understood. It was a noble attempt by Rajan at explaining this concept, though how many pensioners received the message even after the simplification of numbers is debatable.

However, I see no reason for Raghuram Rajan to have a monopoly on dosas in economics. Moreover, one would be hard pressed to find a dosa for ₹50 in a city like Mumbai, let alone 1-year fixed deposits at 8% and real-life consumer inflation at 5.5%. So, now you get to create your own realistic dosa economics, provided you have the appetite for it.

Open in new tab