Archive

Posts Tagged ‘music’

Listener Feedback Podcast Episode 3: Drunksouls – On verra plus tard

April 9th, 2012 No comments

A new episode of the Listener Feedback podcast has been released. On this episode it is the French band Drunksouls with their album On verra plus tard. Check it out here.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Listener Feedback Podcast Episode 2: Blackwell

April 8th, 2012 No comments

Just a quick update to let you know that the second episode of the Listener Feedback podcast has been released. The artist on this episode is Blackwell with his album Un4givable. Check it out here.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

First episode of Listener Feedback podcast released!

March 26th, 2012 No comments

A fellow Linux Experiment Guinea Pig and I decided that we would start a new podcast showcasing some of the very best (and possibly worst) royalty free and creative commons music available. We’ve devised a short-format creation, so you don’t get bored, that aims to explore a new artist/album combination with each episode. In the podcast we share our thoughts, praise and criticism of each work and also feature a few songs in order to give you a taste of what to expect on the full album.

Check out the podcast over at www.listenerfeedback.net where you can listen to the show, download the episode’s featured album, leave us a comment or make a suggestion as to what we should listen to next. I hope you enjoy.




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Samsung Captivate SGH-i896 Meets Linux

November 7th, 2010 2 comments

Yesterday, I picked up the newly launched (in Canada) Samsung Captivate. So far, I’m extremely impressed with the device. The super amoled display is gorgeous, the touch screen is responsive, and the UI is stunning to look at and use. Coming from a Blackberry Curve 8310, this phone is like a digital orgasm.

Once I finished gushing over how awesome this phone is, I decided to try and get it to interact with my Linux Mint 9 Isadora install. For now, I just want to be able to transfer images and music to and from the device, although later on, I’d like to get a development environment set up and try my hand at writing some apps.

My first try at getting the phone to play nicely with Linux was not successful. It took me a little bit of fooling around before I could figure it out, but here goes:

  • On the phone, navigate to Settings > Applications > USB Settings and make sure that ‘Ask on Connection’ is selected
  • Plug your phone into the a USB port, and when prompted, select ‘Mass Storage’ from the dialog that appears on the phone
  • At this point, if you open up your Computer in Nautilus, you should see an icon that says something like SAMSUNG SGH-I896, but you won’t be able to interact with it in any way
  • On the phone, grab the notification bar at the top of the home screen and drag it down
  • In the notifications area, tap USB Connected, and when prompted, select Mount from the dialog
  • Back in Nautilus, the icon under Computer should now say something like SAMSUNG SGH-I896: 14GB Filesystem, and you should be able to read and write to the card

With these steps complete, I was able to interact with the phone through the file system and from within Banshee and FSpot. I’m not sure why the phone won’t allow Linux to mount its storage devices by default when in Mass Storage mode, but this little work around seems to make it behave correctly.

Drop me a line in the comments if you have any Linux/Android compatibility questions, and I’ll do my best to help you out.




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.

Vorbis is not Theora

April 21st, 2010 17 comments

Recently I have started to mess around with the Vorbis audio codec, commonly found within the Ogg media container. Unlike Theora, which I had also experimented with but won’t post the results for fear of a backlash, I must say I am rather impressed with Vorbis. I had no idea that the open source community had such a high quality audio codec available to them. Previously I always sort of passed off Vorbis’ reason for being regarded as ‘so great’ within the community as simply a lack of options. However after some comparative tests between Vorbis and MP3 I must say I am a changed man. I would now easily recommend Vorbis as a quality choice if it fits your situation of use.

What is Vorbis?

Like I had mentioned above, Vorbis is the name of a very high quality free and open source audio codec. It is analogous to MP3 in that you can use it to shrink the size of your music collection, but still retain very good sound. Vorbis is unique in that it only offers a VBR mode, which allows it to squeeze the best sound out of the fewest number of bits. This is done by lowering the bitrate during sections of silence or unimportant audio. Additionally, unlike other audio codecs, Vorbis audio is generally encoded at a supplied ‘quality’ level. Currently the bitrate for quality level 4 is 128kbit/s, however as the encoders mature they may be able to squeeze out the same quality at a lower bitrate. This will potentially allow a modern iteration of the encoder to achieve the same quality level but by using a lower bitrate, saving you storage space/bandwidth/etc.

So Vorbis is better than MP3?

Obviously when it comes to comparing the relative quality of competing audio codecs it must always be up to the listener to decide. That being said I firmly believe that Vorbis is far better than MP3 at low bitrates and is, at the very least, very comparable to MP3 as you increase the bitrate.

The Tests

I began by grabbing a FLAC copy of the Creative Commons album The Slip by Nine Inch Nails here. I chose FLAC because it provided me with the highest quality possible (lossless CD quality) from which to encode the samples with. Then, looking around at some Internet radio websites, I decided that I should test the following bitrates: 45kbit/s, 64kbit/s, 96kbit/s, and finally 128kbit/s (for good measure). I encoded them using only the default encoder settings and the following terminal commands:

For MP3 I used LAME and the following command. I chose average bitrate (ABR) which is really just VBR with a target, similar to Vorbis:

flac -cd {input file goes here}.flac | lame –abr {target bitrate} – {output file goes here}.mp3

For Vorbis I used OggEnc and the following command:

oggenc -b {target bitrate} {input file goes here}.flac -o {output file goes here}.ogg

Results

I think I would be a hypocrite if I didn’t tell you to just listen for yourself… The song in question is track #4, Discipline.

Note: if you are using Mozilla Firefox, Google Chrome, or anything else that supports HTML5/Vorbis, you should be able to play the Vorbis file right in your browser.

45kbit/s MP3(1.4MB) Vorbis(1.3MB)

64kbit/s MP3(2.0MB) Vorbis(1.9MB)

96kbit/s MP3(2.9MB) Vorbis(2.8MB)

128kbit/s MP3(3.8MB) Vorbis(3.6MB)




I am currently running a variety of distributions, primarily Linux Mint 17.
Previously I was running KDE 4.3.3 on top of Fedora 11 (for the first experiment) and KDE 4.6.5 on top of Gentoo (for the second experiment).
Check out my profile for more information.

Filling a Zune from Linux

January 1st, 2010 2 comments

Thinking that I was up for a challenge, I decided to spend the day figuring out how to put the music in my Banshee library onto a Microsoft Zune. Since my library contains a good number of FLAC files that I’ve ripped in from my CD collection, my solution called for a caching system that converts the FLAC files to mp3s and stores them so that the playlist can be changed without having to re-convert the FLAC files into something that the Zune can play on every sync. My weapons of choice for the project were a Windows XP instance running inside of Sun Virtual Box, and 126 lines of perl script.

The Steps:

  1. Create a WinXP VM that has the Zune software installed and can see two shared folders on my Linux machine:
    1. My normal Music folder, which contain my entire collection
    2. The cache folders, which contain all of the FLAC files in my collection, but converted to mp3 so that the Zune can play them
  2. Open the Banshee database, located at ~/.config/banshee-1/banshee.db
  3. Select all of the FLAC files in the playlist that we’d like to put on the Zune
  4. For each, check if it has been converted and cached
    1. If so, simply add the path to the cached copy of the track to an m3u file in the cache folder
    2. If not, convert the track, and then add the path to the cached copy of the track to an m3u file in the cache folder
  5. Select all of the mp3 files in the playlist that we’d like to put on the Zune
  6. Put those in a separate m3u file that is located in the Music folder.
  7. Boot up the Zune software on the VM. It should autoscan it’s monitored folders, find the m3u playlists, and put them in its library
  8. Sync the playlists with the Zune by dragging and dropping them to the device icon in the lower left corner of the screen

As previously mentioned, steps 2 through 6 were accomplished by way of a perl script that I can run as often as I like:

#/usr/local/bin/perl

#Requirements: libdbd-sqlite3-perl, flac, lame

#We need database support
use DBI;

#Database path – change this to reflect your user environment
my $dbpath = “dbi:SQLite:dbname=/home/jon/.config/banshee-1/banshee.db”;

#Playlist name – change this to reflect the playlist that you want to export
my $plistname = “Favorites”;

#Cache Path – the path to the directory where you’ve been caching converted FLAC files
my $cachepath = “/home/jon/Storage/mp3Cache/”;

#Music Path – the path to the folder where your music collection is actually stored
my $musicpath = “/home/jon/Music/”;

#Connect to the database – no username/password
my $dbh = DBI->connect($dbpath,””,””,{RaiseError => 1, AutoCommit => 0});

if(!$dbh) {
print “Could not connect to database $dbpath”,”\n”,”Exiting”;
exit;
}

#Pull the list of FLAC files for conversion and caching
my $flac = $dbh->selectall_arrayref(“SELECT sme.TrackID, ct.Title, car.Name AS ‘Artist’, ca.Title AS ‘Album’, ct.Uri, ct.Duration AS ‘Length’ FROM corealbums AS ca, coreartists AS car, coresmartplaylistentries AS sme INNER JOIN coretracks AS ct ON sme.TrackID = ct.TrackID WHERE sme.SmartPlaylistID = (SELECT `SmartPlaylistID` FROM `coresmartplaylists` WHERE `Name` = ‘$plistname’) AND ca.AlbumID = ct.AlbumID AND car.ArtistID = ct.ArtistID AND ct.MimeType LIKE ‘%flac'”);

#open the m3u file to write the cached items to
open my $m3u, ‘>’, $cachepath.$plistname.’_cached.m3u’ or die “Error trying to open cache m3u playlist for overwrite. Do you have write permissions in $cachepath ?”;
print $m3u “#EXTM3U\r\n\r\n”;    #note windows \r\n here

#add /music to $cachepath so that files are in a subdirectory, away from the m3u file
$cachepath = $cachepath.”music/”;
if( ! -e $cachepath ) {
`mkdir “$cachepath”`;
}

#loop through the files and check if they need to be cached
foreach my $i (@$flac) {
my ($trackid, $title, $artist, $album, $uri, $length) = @$i;

#correct the uri by removing the file:// prefix and reverting the uri escaping
$uri = substr $uri, 7;
$uri =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;

#fix time into seconds
$length = int($length/1000);

#check if the flac file has already been converted and cached at cachepath
#if not, convert it and put it at cachepath.
my $path = $cachepath . $artist . ‘/’ . $album . ‘/’ . $title . ‘.mp3′;
if( ! -e $path ) {
#file dne, convert it
print “\nTrack: $title by $artist has not yet been cached, converting…”,”\n”;

#make sure that the file actually exists before attempting to convert it
if( ! -e $uri ) {
print “WARNING: Track $title by $artist does not exist at $uri”,”\n”;
} else {

#ensure that cache album/artist directories exist
my $partpath = $cachepath.$artist;
if( ! -d $partpath ) {
`mkdir “$partpath”`;
}
$partpath = $partpath.’/’.$album;
if( ! -d $partpath ) {
`mkdir “$partpath”`;l
}

#do the conversion – we’re chaining flac and lame here, reading in the flac file from $uri, and putting the resulting mp3 at $path
`flac -cd “$uri” | lame -h – “$path”`;
}
}

#add the track to the m3u file – note that these entries are relative to the location of the m3u file in the root of $cachepath
#the paths use a backslash and a \r\n newline so that they work correctly on windows
print $m3u “#EXTINF:$length,$artist – $title\r\n”;
print $m3u ‘\\music\\’.$artist.’\\’.$album.’\\’.$title.’.mp3′,”\r\n\r\n”;
}

#close the m3u file in the cachepath directory
close $m3u;

#TODO: scan the m3u file and delete any files that aren’t in it from the cache directory

#Pull the list of MP3 files and dump them into an m3u file
my $flac = $dbh->selectall_arrayref(“SELECT sme.TrackID, ct.Title, car.Name AS ‘Artist’, ca.Title AS ‘Album’, ct.Uri, ct.Duration AS ‘Length’ FROM corealbums AS ca, coreartists AS car, coresmartplaylistentries AS sme INNER JOIN coretracks AS ct ON sme.TrackID = ct.TrackID WHERE sme.SmartPlaylistID = (SELECT `SmartPlaylistID` FROM `coresmartplaylists` WHERE `Name` = ‘$plistname’) AND ca.AlbumID = ct.AlbumID AND car.ArtistID = ct.ArtistID AND ct.MimeType LIKE ‘%mp3′”);

#open the m3u file to write the cached items to
open my $m3u, ‘>’, $musicpath.$plistname.’.m3u’ or die “Error trying to open music folder m3u playlist for overwrite. Do you have write permissions in $musicpath ?”;
print $m3u “#EXTM3U\r\n\r\n”;    #note windows \r\n here

#loop through the files and check if they need to be cached
foreach my $i (@$flac) {
my ($trackid, $title, $artist, $album, $uri, $length) = @$i;

#correct the uri to become a windows file path
$uri = substr $uri, 7;            #remove file:// prefix
$uri =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;    #correct uri encoding
$uri =~ s/$musicpath//g;            #remove musicpath prefix
$uri =~ s/\//\\/g;                #change forward slashes to backslashes
$uri = ‘\\’.$uri;                #add the leading backslash

#fix time into seconds
$length = int($length/1000);

#add the track to the m3u file – note that these entries are relative to the location of the m3u file in the root of $cachepath
#the paths use a backslash and a \r\n newline so that they work correctly on windows
print $m3u “#EXTINF:$length,$artist – $title\r\n”;
print $m3u $uri,”\r\n\r\n”;
}

#close the m3u file and the database connection
close $m3u;
$dbh->disconnect;

Sorry for the horrible formatting.

The only snag that I hit during the entire process was really my fault – I have a tendency to overcomplicate things, and did so on this project by initially writing the script to output a *.zpl file instead of a *.m3u file. That didn’t work at all, and I ended up simplifying the script greatly by just outputting an *.m3u file and hoping for the best.

On the off chance that the Zune jukebox software refuses to properly update its playlists after you change the *.m3u files, first try deleting them from the application, and then restarting it. If that doesn’t work, you can write a Windows batch script with code similar to the following:

del /q “C:\Documents and Settings\Jonathan\My Documents\My Music\Zune\Playlists\*”
xcopy “\\Vboxsvr\mp3cache\Favorites_cached.m3u” “C:\Documents and Settings\Jonathan\My Documents\My Music\Zune\Playlists”
xcopy “\\Vboxsvr\music\Favorites.m3u” “C:\Documents and Settings\Jonathan\My Documents\My Music\Zune\Playlists”

This script deletes all files from the Zune playlists directory, and then copies each of the *.m3u files that we created with the above perl script directly into the Zune playlists directory. This should force the application to get it’s act together.

Overall, I’m happy with this patchwork job. It allows me to use the Zune on Linux, which is great because the Zune really is a beautiful piece of hardware. Now if only the libmtp guys could get it working natively, without a WinXP VM…

This piece was mirrored at Index out of Bounds




On my Laptop, I am running Linux Mint 12.
On my home media server, I am running Ubuntu 12.04
Check out my profile for more information.