Thursday, 13 December 2018

iTunes Movies with Corrupt Blocked Downloads

This is a recurring procedure for me now, since about a year, so I may as well share the solution.

Update: The solution below was written for MacOS 10.14 and earlier. In 10.15, the solution seems simply to be to stay very calm. Even when "TV" shows that it has all the bytes, something is still going on in the background. Just do something else for some while. After another hour or so, depending on your connection, the movie will be downloaded.

Problem

Sometimes Media downloads (especially Movies and TV Programmes) in iTunes on MacOS lock up. The Media will not download completely. It superficially looks like it is downloaded, but when you click on it, it stays at 0:00 and will not budge.

Solution

I have found no both reliable and acceptable solution, so let's have a look at the unacceptable solutions.

If the downloads are ongoing with no progress, one can pause the failed downloads and quit iTunes. Then visualise the movies in the Store, and try to download them from there.

One can try to remove temp downloads in ~/Music/iTunes/Downloads . This never helped for me, but it looks like something that could help.

If that doesn’t work, the following should work, in spite of some data loss.

  1. Close iTunes.
  2. In ~/Music/iTunes delete the file iTunes Library.itl.
  3. Open iTunes. It will now be void of any media.
  4. Go to File > Add to Library... and select ~/Music/iTunes/iTunes Media (or other location, if you store your media elsewhere).
  5. Click on "Open." This will make iTunes go through the media and add it to a new iTunes Libary.itl file.

iTunes will recognise files that were downloaded from iCloud and iTunes Store. iTunes will recognise media files that were added from other sources and consolidated into ~/Music/iTunes.

iTunes will not restore Playlists. I assume there is more information that is lost, like playcounts and probably other info.

But you will be able to download and finally watch that movie.

Update

Funny observation. If you have a television series with 30 episodes and you have downloaded 15 of them, and you select one (1!) of them and choose "remove download" from the pop-up menu, then all 15 downloads will be removed, and you have to download them again.




Friday, 9 November 2018

Web Surfing and the Environment

The data centres of big computer companies, like Google and Facebook use a huge amount of energy. One study claims that data centres will use 20% of our global energy consumption in less than ten years. Discarded computers can contain poisons like lead, mercury, beryllium, cadmium and different kinds of harmful plastics that are difficult or impossible to dispose of in a sensible way.

Unfortunately, the computer giants only indirectly have an interest in the environment. The more often you throw away your old computer and buy a new one, the more money they make. The more you use their cloud services and social media and see their ads, the more money they make. Luckily, a lot of computer companies are aware of their negative impact, and they try to improve the situation. At least, many of them say so, and I guess some of them actually do something.

Nevertheless, if we users want to help the environment, we unfortunately often have to fight the actions of the companies.

Keep your old hardware.

There is an environmental impact of hardware that is thrown away, and that needs to be taken care of. The longer you can use your old computer, the better - in most cases. Unfortunately, a lot of web sites get more and more bloated, with tons of javascript and integrated movies, which slows down our old computers, and which make them use more electricity.

If you need to go to power hungry sites that block your computer, so you need to sit and use it for much longer time than you would have needed on a new computer, it may be time to switch. You may have to do this even if it is accepting defeat. Your computer worked fine when it was new. That it is slow now is solely the fault of the companies that provide it with bloated software and bloated web sites.

Switch off javascript. 

There are still web sites that work fine without javascript. Switch it off in your browser whenever you can, and the pages will load much faster.

Switch off automatic media. 

Unfortunately, I have not found many settings that work for this. There are still idiotic irrelevant films that run as soon as one accesses certain pages, at least when javascript is on.

One thing to do here is really painful, but it helps. Load the page. Once all the text is loaded, highlight it with ctrl+a or command+a. Then copy it with ctrl+c or command-c. Then close the browser window with ctrl+w or command+w. From this moment, there is no unnecessary heavy data traffic. There is no unnecessary script doing obscure things. Now, go to a text or word processor and paste. You will now be able to read the pasted page in Word or TextEdit, or wherever it is, and there will not be much more impact on the environment than the lit screen.

Use Ad blockers.

In general, one should not use ad blockers. There are web sites that are free to us and paid by income from advertisements. If we switch off all ads, those web sites will die, and no one will get the free information. However, when a web site hosts high resolution movies and heavy javascript for their ads, the environmental cost is heavy. In those cases, there is a very good reason to block it.

Switch web sites.

Avoid power hungry websites. Try to find quicker sites that provide similar information.

Switch off automatic updates.

Facebook may think it fun to send out 400 Mb updates of its app every week or every other day on your smartphone to fix a few invisible bugs. However, it is expensive for the environment. Facebook has to use power both to host the data and to allow you to download it. Network companies pay for the transport. You pay for the data traffic, and your phone spends power on downloading, verifying and installing the software. Often the benefit of the update is zero. Sometimes it is negative, as the update that was supposed to fix a problem that was insignificant instead adds a bug that is really annoying.

Most software, app stores and download programs have an option to switch off automatic updates. Switch it off. Keep an eye on the news, and if people talk of big security risks or great new functionality, update the software manually. Once. Not every day.

Some intrusive software, like Apple's Appstore on iOS devices, displays red circles to notify you that there is new software to download. You can actually switch those distracting circles off. Go into Settings and Notifications, and block notifications from places that display red circles you don't want.

In short

Computer companies make us harm the environment more than necessary. We can fight back. It is better for the environment and cheaper for us.

Tuesday, 16 January 2018

MacOS Processes and Daemons

Every now and then, a processes in MacOS goes bad. Slowed down performance and whining fans can be symptoms of an overactive process.

To see which process has gone bad, one can
  1. Launch Applications > Utilities > Activity Monitor.
  2. Click on CPU (if this tab isn't already active).
  3. Click on % CPU to sort by most active process. Click once or twice to get the highest numbers on top.
Some of the processes, like photoanalysisd will simply take a lot of time. The best thing (and sometimes only thing) one can do, is to sit them out. Let the Mac run for a few minutes, hours or more, to let them do whatever they do. In other cases, a restart will fix the problem.

Here are some processes and some short description of what they do in High Sierra, MacOS 10.13. I found no easy to use official page for all this. The following information comes mostly from different forums, so take it with a pinch of salt.
  • amfid - Apple Mobile File Integrity Daemon. Checks the integrity of files running on the system.
  • cloudd - syncs iCloud data. Uses nsurlsessionid.
  • helpd - some help daemon. Indexes help files. May create caches that could go corrupt. If it goes bad, try to delete cache files (see below), and prepare to wait for it to rebuild the cache. It wants to connect to the internet for updates.
  • hidd - Human Interface Device Daemon. Linked to mouse, trackpad, keyboard, and so on.
  • ksfetch - part of Google Chrome's update
  • launchd - launches other processes.
  • mds - ‘metadata server worker' or in other words: Spotlight indexing.
  • mds_stores - Spotlight indexing.
  • mdworker - Spotlight indexing.
  • nsurlsessiond - a process that is used by iCloud to sync. It handles background internet connections.
  • photoanalysisd - analyses photos in Photos to create categories like “flowers” or “cars”. You access them by searching in Photos.
  • secd - relates to runtime security policies for processes. Linked to Keychain.
  • sysmond - monitors system activity in background.
Some information can be found for some of the processes using MacOS' Unix shell:
  1. Launch Applications > Utilities > Terminal.
  2. Type man process_name, where "process_name" is the name of the process you want information about.
  3. Type q to get out of the information screen. 
The cache files of helpd contain help information like the one you find in the Finder menu Help. If they go corrupt and cause helpd to go in overdrive, one may try to delete them. Just keep in mind that deleting this kind of information could cause other problems. If you want to be brave, these are the steps to delete the files:

  1. Go to Finder.
  2. Hold down the alt button and click on the menu Go > Library. (The option Library is only visible if you hold down the alt button.)
  3. Go to Library/Caches/com.apple.helpd/
  4. Drag anything you think could be wrong to the Trash.
  5. Wait for helpd to rebuild the cache. This may take some time.
Other more generic remedies against bad performance are: Close unused open applications to free up CPU and memory. Restart. If nothing else helps: delete the current account and create a new one to start from scratch.