jwallace.us

tech, tunes, and other stuff

Music Vendors Still Using DRM

Digital Rights Management (DRM) is still being used by music vendors. What vendors would do in the past was to make it impossible to own music. Windows based WMA and Apple based AAC files could not be transferred from device to device without using iTunes or Windows Media Player.  In other words, you couldn’t simply transfer music to another computer using a USB drive or something similar.  There was an uproar about that, and so vendors convinced music labels that that form of DRM was a bad idea and hurting sales. With the removal of that specific DRM scheme music sales have soared, but the record labels are at it again with a more sneaky approach. While music files are now more easily distributed,  they are now encoding information into the MP3 files (and in Apple’s case, AAC files) themselves which would make it possible to trace which vendor a specific file was downloaded from, who downloaded it, and when it was downloaded. Essentially your music can be now traced to you. You may say you don’t mind that, but what if you lose your music player or MP3 stick with gigabytes of your music on it. What if someone finds that device and decides it would be really cool to share your music with thousands of internet friends? If the RIAA then downloaded your music from the punk that found your music device, do you suppose the RIAA would care HOW that guy was in possession of YOUR music? Of course not. The RIAA has proven to be fairly unscrupulous when it comes to such matters, even to the point of suing grandmothers who don’t have an internet connection or own any digital music for thousands of dollars! So how can you protect yourself?

There are only a couple of steps you need to take.  The first step is to identify which music contains your private data, and the next step is to remove that data without affecting the music.

So, how does one identify which music contains their personal data information?   First we need to know what to look for.  I have found that both eMusic, 7digital, and Amazon (and probably others) encode the personal DRM data into an MP3 id3v2 header field with a PRIV label. All you have to do is scan your MP3 files for this PRIV field.

Before we go any further, lets see what one of these PRIV fields look like.  This PRIV field is from a track downloaded from eMusic:

1
2
3
4
5
6
<?xml version=”1.0″ encoding=”UTF-8″?>
<uits:UITS xmlns:uits=”http://www.udirector.net/schemas/2009/uits/1.1″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><metadata><nonce>5ZwmfSmK</nonce><Distributor>eMusic</Distributor><Time>2012-07-12T14:34:49-06:00</Time><ProductID type=”UPC” completed=”false”>00049377181536</ProductID><AssetID type=”ISRC” >NZF050181529</AssetID><TID version=”1″>XDxzK4HApNvssOHLQ4hvaw==</TID><Media algorithm=”SHA256″>b34a9d293826dd3e46ddc7c774f058b6221dea5cff4bc0df6bd993526e3140092</Media></metadata><signature algorithm=”RSA2048″ canonicalization=”none” keyID=”VKgH48vE88xoM7lVQm+b9B031TQ=”>hxQQxC9ex6h1UXjzJ1kSPCeR9D/q+TaFb2mijIeAkqcN5dnLIei0xzF3
Irs58NJByFScJhCZYe6G54xUAzYlvWOHb/klEAcnAxW5IHMKGLuqybZrC8B0jrUTQ9+Ezad8eFrDoKCsGZLTag9Uc
TptffpYrCroSGp4nvMqm/p/9bpCiiq2xxA7ad5SSvwELuTgIj2s44SlKtLqij854UohlJMMcrp+c//sFZAF2niwDMvLQfh8
0lG7weKVJgxPAnKpb4GgaIprOvvzU4xhGK56spRRDyPQ/SJ+/gnUsgPMyHv4RF8zZiVeathLGyJuRoT2BXXiJnPAyyOU
hk6l4yhug==</signature></uits:UITS>

I changed a bunch of the numbers and letters around to take my specific information out, but you can get the idea here. This one was from an eMusic MP3 file that I downloaded as part of my subscription that I pay for.

Not all MP3 files have this PRIV field encoded into them.  Most do not as it appears the PRIV field is included into the files on a per-contract basis – probably paid for by the record label at an additional cost (and probably at the artist’s expense).  I’ve found that if one track from an artist has DRM encoded into it, then all tracks from the same artist will as well.

I have written a PHP based command line utility which will scan your MP3 music folders searching for these DRM PRIV fields in your MP3s. You can download it from here:  mp3_info_v10.zip  You will also need the open source getID3 library as my utility needs it to run.  Once you have it, you can type mp3_info.sh -h for help.

You’ll need PHP installed on your machine to run this utility.  If you are running Windows, you can download PHP here:  PHP for Windows.  If you are running Mac OSX you will need to have the XCode  development package installed.  (It should be on your Mac OSX installation disk.)  If you’re running Linux, you’ll have to make sure you have the PHP package installed for your Linux distribution.  FYI, I developed this on a PHP 5.3 system, but it will not run using PHP 5.4 because the getID3 library is not currently 5.4 compatible..

If you don’t want to do all this geeky PHP stuff, then you would be safe simply deleting the id3 headers (tags) from ALL of your purchased MP3 files.  It might be a little more trouble as you would need to add the non-DRM data back such as artist, album, genre, year, track number, etc – but thats all easy to do.  I’ll explain that next.

Once you have identified which tracks have DRM, the next step is to remove the DRM.  If you’re running Windows, the best software I have found for manipulating MP3 (and other formats) metadata is to use a free program called mp3tag.  Using mp3tag simply delete the entire id3 tag.  Its the only way I know to do it, but it is also very effective.  It will wipe the song information, the album cover, and anything else including the DRM.  So, you’ll have to add  all that back if you want it back in there, but mp3tag has the ability to fill in those fields automatically using free online music databases.  You can also add the cover art back using mp3tag.  I know this isn’t much help, but if you’re running OSX or Linux I have no idea which tool to use.  I just boot Windows using Oracle Virtualbox running on my OSX or Slackware Linux system and use the Windows based mp3tag tool mentioned above.

Mozilla Killing Off Firefox 3.6

Actually, according to this Macworld article Mozilla will be auto-upgrading people running Firefox 3.6.  Such news may not come as a surprise to you, but if you have a PowerPC Mac 3.6 is the very latest version of Firefox that will run on your Mac.  By auto-upgrading those machines, Mozilla will effectively break the browser on that platform.

The good news is that there are some alternatives.  If you have a PowerPC Mac try out these browsers:

TenFourFox is an unofficial Firefox browser specifically tuned to your machine’s architecture.  It is probably your best option as its built from the latest Firefox source.  Note that with this project the source has been modified so they cannot legally call it Firefox (even though your machine won’t know the difference).  For security reasons TenFourFox comes with plugins disabled.  If you wish to enable plugins type about:config in the browser’s address bar, and then change the tenfourfox.plugins.enabled setting to true.  Mozilla recommends you use TenFourFox in their MozillaWiki.

El Furbe is also tuned to your PowerPC machine’s architecture, but the latest version available is built from Firefox 4 source.

Carol Capshaw 1942-2012

My cousin, Carol Capshaw, died today from a brain tumor.  What a way to go.  I understand they gave her morphine for the pain towards the end, and she was able to die at home under the care of hospice.  She was the only child of my Uncle Carl who died a three years ago.  She remembered more of me than I did of her as she used to baby sit me when I was but a wee tot.  However, she spent most of her life in Massachusetts so I rarely saw her.  Carol  was a pretty nice person, although she could be difficult at times.  I suppose that description could apply to most of us.  Rest in peace my cousin.

ZCE 5.3 !

I passed the Zend Certified Engineer 5.3 (200-530) exam today,  but first I am going to give all the credit to the good Lord Jesus Christ.  Without his help I would not have passed.  I’m not kidding.  I would also like to thank my wife Carol, who has been so very supportive in my efforts to take this exam.  She is one in a million.  So, I have no idea how I passed it as it was the most difficult exam I’ve ever had to take.  Its not that it was all that complex, but there was so dang much material to remember… Perhaps if I had had some professional experience with web development using PHP prior to taking the exam it would have been a little bit easier, but I’m not going to make any bones about it.  I’m one happy guy today,  and I’ll take my certification thank you very much.

What It Takes to Be Number One

I remember my 7th grade science teacher (who was also the middle school football coach), Mr. Brock, giving this speech by Vince Lombardi to us in a handout.

What It Takes to be Number One

“Winning is not a sometime thing; it’s an all the time thing. You don’t win once in a while; you don’t do things right once in a while; you do them right all the time. Winning is a habit. Unfortunately, so is losing.

“There is no room for second place. There is only one place in my game, and that’s first place. I have finished second twice in my time at Green Bay, and I don’t ever want to finish second again. There is a second place bowl game, but it is a game for losers played by losers. It is and always has been an American zeal to be first in anything we do, and to win, and to win, and to win.

“Every time a football player goes to play his trade he’s got to play from the ground up — from the soles of his feet right up to his head. Every inch of him has to play. Some guys play with their heads. That’s O.K. You’ve got to be smart to be number one in any business. But more importantly, you’ve got to play with your heart, with every fiber of your body. If you’re lucky enough to find a guy with a lot of head and a lot of heart, he’s never going to come off the field second.

“Running a football team is no different than running any other kind of organization — an army, a political party or a business. The principles are the same. The object is to win — to beat the other guy. Maybe that sounds hard or cruel. I don’t think it is.

“It is a reality of life that men are competitive and the most competitive games draw the most competitive men. That’s why they are there — to compete. To know the rules and objectives when they get in the game. The object is to win fairly, squarely, by the rules — but to win.

“And in truth, I’ve never known a man worth his salt who in the long run, deep down in his heart, didn’t appreciate the grind, the discipline. There is something in good men that really yearns for discipline and the harsh reality of head to head combat.

“I don’t say these things because I believe in the “brute” nature of man or that men must be brutalized to be combative. I believe in God, and I believe in human decency. But I firmly believe that any man’s finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle — victorious.”

– V. Lombardi, 1913 – 1970

Slackware Maintenance

Slackware has a reputation for being difficult to work with, but there are a couple of tools available that make it easier.

slapt-get

One such tool is called slapt-get.  This tool will go to a Slackware repository and then download and install new packages to keep your system up-to-date.  Simply download the utility, and as root install it using the installpkg (or pkgtool) utility.  There are a few slapt-get commands that you should know:

  • slapt-get -update       (retrieve pkg data from MIRROR)
  • slapt-get -upgrade     (upgrade installed pkgs)
  • slapt-get -available    list available pkgs
  • slapt-get -install     [pkg name(s)] – install specified pkg(s)
  • slapt-get -remove       remove a package
  • slapt-get -search       find a keyword in the package lists
  • slapt-get -dist-upgrade upgrade to newer release

alien

There is another utility that I like called alien.  alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats.  If you would like to try it out, download it from the slacky.eu site.  How do you use it?  Lets try it on a free office suite for Linux called Softmaker Office 2006.  You can download it: here.  (Softmaker also offers the newer Softmaker 2008 for Linux: here.)   You can only get it as a .deb package, so run alien on it to convert it to a Slackware friendly tgz package.  Install it using Slackware’s installpkg utility:

alien --to-tgz softmaker-office-2006_i386.deb
installpkg softmaker-office-2006-468.tgz

PHP Namespaces

Much like directories in a file system, namespaces are a way to group items in an orderly manner.  In this way they are used to avoid collisions.  In addition, namespaces can be used to shorten long names in order to increase a code’s readability.  For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
   namespace my\own\namespace2;
   use my\own\namespace2 as n2;

   function myfunction ($a) {
      echo "this is my function $a\n";
   }

   \my\own\namespace2\myfunction(1);
   n2\myfunction(2);

   # you need the \ in front of Exception to
   # access the global (built in) class
   $a = new \Exception();
?>

Will print out:

this is my function 1
this is my function 2

Note that without the starting slash \ in the first call to myfunction() would have failed because PHP would have considered the function to be undefined.

Namespaces in XML

Namespaces can be used in XML documents with the same purposes in mind:  to eliminate naming collisions and to shorten names for readability.  For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0"?>
   <fleet xmlns="http://cars.org/fleet"
      xmlns:mk="http://cars.org/make"
      xmlns:mo="http://cars.org/model"
      xmlns:vn="http://cars.org/vin">
      <car vn:id="8888">
         <mk:x>ford</mk:x>
         <mo:x>taurus</mo:x>
      </car>
      <car vn:id="5555">
         <mk:x>honda</mk:x>
         <mo:x>civic</mo:x>
      </car>
   </fleet>

SimpleXML and Namespaces

SimpleXML knows how to use namespaces.  For example, given the following code:

1
2
3
4
5
6
7
<?php
   $xml = new SimpleXMLElement ('cars.xml', NULL, true);
   $namespaces = $xml->getDocNamespaces();
   foreach ($namespaces as $key => $value) {
      echo "$key => $value\n";
   }
?>

Prints the following output:

=> http://cars.org/fleet
mk => http://cars.org/make
mo => http://cars.org/model
vn => http://cars.org/vin

DOM and Namespaces

Alone, DOM’s namespace functionality is limited.  Its real power comes into its own when used with XPath.  For example:

1
2
3
4
5
6
7
8
9
10
11
<?php
   $dom = new DomDocument();
   $dom->load('cars.xml');
   $xpath = new DOMXPath ($dom);
   $xpath->registerNamespace('mycars', $dom->documentElement->baseURI);
   echo $dom->documentElement->baseURI . "\n";
   $context = $dom->documentElement;
   foreach( $xpath->query('namespace::*', $context) as $node ) {
      echo $node->nodeValue, "\n";
   }
?>

Prints the following output:

/Users/john/src/php/cars.xml

http://www.w3.org/XML/1998/namespace


http://cars.org/vin


http://cars.org/model


http://cars.org/make


http://cars.org/fleet

Silverlight and Linux

To get Microsoft Silverlight applications working in your browser in Linux all you need to do is download the Moonlight browser extension.  Get that: Moonlight.

When you get it installed, go to this page to see if it is working: Bubblemark Test

If the browser extension was properly installed you should see some little round yellow bubbles bouncing around in a box in your browser window.

Getting Claws Mail Working in Slackware

There are a few Slackware software repositories on the internet:

Note that the linuxpackages.net site appears as if it is no longer being actively maintained.  Regardless, if you wish to run Sylpheed-Claws on your Slackware system you’ll need a couple of Slackware packages:

Thats it.  Simply install the packages with the Slackware installer (installpkg).