May 24 2016

Graduating Class – The New Yorker – 30 May 2016

Today I saw the cover of the 30 May 2016 edition of The New Yorker, which was designed by artist R. Kikuo Johnson, and it really hit home for me. The illustration depicts the graduating class of 2016 walking out of their commencement ceremony whilst a member of the 2015 graduating class is working as a groundskeeper:

Graduating Class 2016 - The New Yorker - R. Kikuo Johnson
Click for full quality

I won’t go into a full tirade here about my thoughts of higher education within the United States throughout recent years, but I do think that this image sums up a few key points nicely:

  • Many graduates (either from baccalaureate or higher-level programmes) are not working in their respective fields of study
  • A vast majority of students have accrued a nearly insurmountable amount of debt
  • Those two points may be inextricably linked to one another

I know that, for me, I am not able to work in my field of study (child and adolescent development / elementary education) for those very reasons—the corresponding jobs (which I find incredibly rewarding), unfortunately, do not yield high enough salaries for me to even make ends meet. Though the cover artwork doesn’t necessarily offer any suggestion as to a solution to the problem, I think that it very poignantly brings further attention to it.


May 19 2016

FLAC encoding of WAV fails with error of unsupported format type 3

Whenever I purchase music from Bandcamp, SoundCloud, or other music sites that offer uncompressed, full-quality downloads (I can’t bring myself to download anything but original or lossless music files), I will always download the original WAV if it is offered. I prefer to keep the original copy around just in case, but usually I will put that on external storage, and use FLAC compression for actual listening (see my post comparing FLAC compression levels, if you’re interested).

Typically, my workflow for getting songs/albums ready is:

  • Purchase and download the full-quality WAV files
  • Rename them all according to my naming conventions
  • Batch convert them to FLAC using the command line (below)
  • Add in all the tags using EasyTag
  • Standardise the album artwork
  • Add the FLAC files to my playlists on my computers and audio server
  • Batch convert the FLACs to OGG Vorbis using a flac2all command (below) for my mobile and other devices with limited storage

It takes some time, but it’s something that I only have to do once per album, and it’s worth it for someone like me (read “OCD”). 😉 For good measure, here are the commands that I run:

Batch converting files from WAV to FLAC:
find music/wavs/$ARTIST/$ALBUM/ -iname '*.wav' -exec flac -3 {} \;
obviously replacing $ARTIST and $ALBUM with the name of the artist and album, respectively.

Batch converting files from FLAC to OGG using flac2all:
python2 vorbis ./music/flac/ -v 'quality=7' -c -o ./music/ogg/

By the way, flac2all is awesome because it copies the tags and the album art as well. That’s a huge time saver for me.

Normally this process goes smoothly, and I’m on my way to enjoying my new music rather quickly. However, I recently downloaded some WAVs from SoundCloud and couldn’t figure out why I was coming up with fewer FLACs than WAVs after converting. I looked back through the output from the command, and saw the following error message on some of the track conversions:

05-Time Goes By.wav: ERROR: unsupported format type 3

That was a rather nebulous and obtuse error message, so I decided to investigate a file that worked versus these ones that didn’t:

File that failed:
$ file vexento/02-inspiration/05-Time\ Goes\ By.wav
RIFF (little-endian) data, WAVE audio, stereo 44100 Hz

File that succeeded:
$ file vexento/02-inspiration/04-Riot.wav
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz

The differences are that the working files indicated “Microsoft PCM” and “16 bit.” The fix for the problem was rather simple, actually. I used Audacity (which is a fantastic piece of cross-platform, open-source software for audio editing), and just re-exported the tracks that were failing. Basically, open the file in Audacity, make no edits, and just go to File –> Export –> “Wav (Microsoft) signed 16 bit PCM”, which you can see in the screenshot below:

Using Audacity to fix FLAC to WAV unsupported format 3
Click to enlarge

Just like that, the problem was gone! Also, I noticed that the file size changed substantially. I’m used to a WAV being about 10MiB for every minute of audio. Before re-exporting these files, they were approximately 20MiB for every minute. So, this track went from ~80MiB to ~40MiB. :)

Hope that helps!


P.S. By the way, Vexento (the artist who released the tracks mentioned here) is amazingly fun, and I recommend that everyone give him a chance. He’s a young Norwegian guy (actually named Alexander Hansen) who creates a wide array of electronic music. Two tracks (that are very different from one another) that I completely adore are Trippy Love (upbeat and fun), and Peace (calming yet cinematic).

May 12 2016

NVIDIA Linux drivers, PowerMizer, Coolbits, Performance Levels and GPU fan settings

Whew, I know that’s a long title for a post, but I wanted to make sure that I mentioned every term so that people having the same problem could readily find the post that explains what solved it for me. For some time now (ever since the 346.x series [340.76, which was the last driver that worked for me, was released on 27 January 2015]), I have had a problem with the NVIDIA Linux Display Drivers (known as nvidia-drivers in Gentoo Linux). The problem that I’ve experienced is that the newer drivers would, upon starting an X session, immediately clock up to Performance Level 2 or 3 within PowerMizer.

Before using these newer drivers, the Performance Level would only increase when it was really required (3D rendering, HD video playback, et cetera). I probably wouldn’t have even noticed that the Performance Level was changing, except that it would cause the GPU fan to spin faster, which was noticeably louder in my office.

After scouring the interwebs, I found that I was not the only person to have this problem. For reference, see this article, and this one about locking to certain Performance Levels. However, I wasn’t able to find a solution for the exact problem that I was having. If you look at the screenshot below, you’ll see that the Performance Level is set at 2 which was causing the card to run quite hot (79°C) even when it wasn’t being pushed.

NVIDIA Linux drivers stuck on high Performance Level in Xorg
Click to enlarge

It turns out that I needed to add some options to my X Server Configuration. Unfortunately, I was originally making changes in /etc/X11/xorg.conf, but they weren’t being honoured. I added the following lines to /etc/X11/xorg.conf.d/20-nvidia.conf, and the changes took effect:

Section "Device"
     Identifier    "Device 0"
     Driver        "nvidia"
     VendorName    "NVIDIA Corporation"
     BoardName     "GeForce GTX 470"
     Option        "RegistryDwords" "PowerMizerEnable=0x1; PowerMizerDefaultAC=0x3;"

The portion in bold (the RegistryDwords option) was what ultimately fixed the problem for me. More information about the NVIDIA drivers can be found in their README and Installation Guide, and in particular, these settings are described on the X configuration options page. The PowerMizerDefaultAC setting may seem like it is for laptops that are plugged in to AC power, but as this system was a desktop, I found that it was always seen as being “plugged in to AC power.”

As you can see from the screenshots below, these settings did indeed fix the PowerMizer Performance Levels and subsequent temperatures for me:

NVIDIA Linux drivers Performance Level after Xorg settings
Click to enlarge

Whilst I was adding X configuration options, I also noticed that Coolbits (search for “Coolbits” on that page) were supported with the Linux driver. Here’s the excerpt about Coolbits for version 364.19 of the NVIDIA Linux driver:

Option “Coolbits” “integer”
Enables various unsupported features, such as support for GPU clock manipulation in the NV-CONTROL X extension. This option accepts a bit mask of features to enable.

WARNING: this may cause system damage and void warranties. This utility can run your computer system out of the manufacturer’s design specifications, including, but not limited to: higher system voltages, above normal temperatures, excessive frequencies, and changes to BIOS that may corrupt the BIOS. Your computer’s operating system may hang and result in data loss or corrupted images. Depending on the manufacturer of your computer system, the computer system, hardware and software warranties may be voided, and you may not receive any further manufacturer support. NVIDIA does not provide customer service support for the Coolbits option. It is for these reasons that absolutely no warranty or guarantee is either express or implied. Before enabling and using, you should determine the suitability of the utility for your intended use, and you shall assume all responsibility in connection therewith.

When “2” (Bit 1) is set in the “Coolbits” option value, the NVIDIA driver will attempt to initialize SLI when using GPUs with different amounts of video memory.

When “4” (Bit 2) is set in the “Coolbits” option value, the nvidia-settings Thermal Monitor page will allow configuration of GPU fan speed, on graphics boards with programmable fan capability.

When “8” (Bit 3) is set in the “Coolbits” option value, the PowerMizer page in the nvidia-settings control panel will display a table that allows setting per-clock domain and per-performance level offsets to apply to clock values. This is allowed on certain GeForce GPUs. Not all clock domains or performance levels may be modified.

When “16” (Bit 4) is set in the “Coolbits” option value, the nvidia-settings command line interface allows setting GPU overvoltage. This is allowed on certain GeForce GPUs.

When this option is set for an X screen, it will be applied to all X screens running on the same GPU.

The default for this option is 0 (unsupported features are disabled).

I found that I would personally like to have the options enabled by “4” and “8”, and that one can combine Coolbits by simply adding them together. For instance, the ones I wanted (“4” and “8”) added up to “12”, so that’s what I put in my configuration:

Section "Device"
     Identifier    "Device 0"
     Driver        "nvidia"
     VendorName    "NVIDIA Corporation"
     BoardName     "GeForce GTX 470"
     Option        "Coolbits" "12"
     Option        "RegistryDwords" "PowerMizerEnable=0x1; PowerMizerDefaultAC=0x3;"

and that resulted in the following options being available within the nvidia-settings utility:

NVIDIA Linux drivers Performance Level after Xorg settings
Click to enlarge

Though the Coolbits portions aren’t required to fix the problems that I was having, I find them to be helpful for maintenance tasks and configurations. I hope, if you’re having problems with the NVIDIA drivers, that these instructions help give you a better understanding of how to workaround any issues you may face. Feel free to comment if you have any questions, and we’ll see if we can work through them.


Older posts «