Wednesday, December 16, 2009

How to sync Nokia n900 Media player with playlists

How to sync Nokia n900 Media player with playlists

Hello there,

Nokia hardware team has put a good amount of effort in putting up the n900 together. But looks like the maemo is not as developed as its symbian platform is. You know this when you try to sync the music with your n900 device.

I tried to sync n900 with winamp, windows media player, nokia ovi music and media monkey. Off all these options I was successful only with media monkey. With my older phone (N95.8GB), i used to use windows media player and it worked great for me. The media player connect mode of N95 really makes make music sync process hassle free.

Here are things I tried:
1. Sync with Windows Media Player: The N900 storage is recognised as USB storage, so Media player just copies files over to the phone, it does not create the playlist anywhere. Even if you select one of the playlist to sync with n900, it just copies the music files to the phone, it doesn't have the options to copy the playlists to the phone storage.
Also if you are thinking of first syncing the phone with WMP and then creating the M3U files using some tool/ script, you can't really do that because WMP will create folder structure as arlist\album\track. Files from all the playlists follow the same directory structure, so it is not possible to identify the playlists with music files once the sync is done.
So WMP is out of picture as of now.

2. Sync with Winamp: Winamp is really a cool media player, I am sure the guys at winamp are working day and night to make it an ultimate media player. Here is what happened while I tried to sync with Winamp: Winamp copied all the tracks to the USB storage of N900. It also created the M3U playlist file under the designated folder in N900 storage. But there is more caviar to N900 storage. N900 being a linux based device uses / (forward slash) as folder separator where as winamp puts \ (back slash) in the path in M3U playlists. Another thing is winamp puts the full path in the M3U file as \Music\Artist\Album\Track considering that Music folder lies in the root directory of the file system but infact in n900 the 32 GB storage mounted as \home\user\MyDocs. In short the winamp playlist sync does not work. Until you have ways to manually modify the M3U file generated by winamp.


3. Sync with Ovi Music: Simply putting, it does not work. Ovi music does not support USB storage mode of N900.

4. Sync with Media Monkey: it works almost like winamp. It creates the M3U files with \ (back slash) and full path as \Music.. . But Media Monkey supports scripts. I was able to put together a script which would update the m3u playlist files with correct path. And it works like a charm.

I found a similar script here:
http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=33736
Here is my modified script. Save it as FixN900m3us.vbs in the C:\Program Files\MediaMonkey\Scripts folder.

I have N900 storage mounted on G drive and I have configured Media Monkey to copy music files to \Music folder and playlist files to \Music\Playlists\ folder. You may have to change the script as per your needs.


Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")

Sub FixN900M3Us()

'--Set Variable for Path -- the script will search all files in this path (unless limited by extention below)

sPath = "G:\Music\Playlists\"

'--Get extension to search For -- Limit the search to files with this extension

sExt = "m3u"

'--Call the Function to Do search and Replace

s = DoSearch(sPath, sExt)

End Sub

' -- The meat of the script ... function to replace text, basically reads all text into a variable then replaces any instance of
'-- \Music with . then writes the contents of the modified variable to the same filename.

Function DoSearch(FolPath, sExtName)

Set objFSO = CreateObject("Scripting.FileSystemObject")

Dim SubPath, Fol, s1, sList, oFol, Fils, oFil, s, sPath, Fols, LExt
LExt = Len(sExtName)
sExtName = UCase(sExtName)
Set oFol = objFSO.GetFolder(FolPath)
Set Fils = oFol.Files
If Fils.count > 0 Then
For Each oFil In Fils
Set objFile = objFSO.OpenTextFile(sPath & oFil, ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, "\Music\", "..\")
strNewText = Replace(strNewText, "\", "/")

Set objFile = objFSO.OpenTextFile(sPath & oFil, ForWriting)
objFile.WriteLine strNewText
objFile.Close
Next

SDB.MessageBox "Successfully fixed " & Fils.count & " M3U playlists.", mtInformation, Array(mbOk)

End If
End Function




Now modify the Scripts.ini file at the same path (C:\Program Files\MediaMonkey\Scripts) to add:


[FixN900M3Us]
FileName=FixN900m3us.vbs
ProcName=FixN900M3Us
Order=40
DisplayName=Fix Nokia N900 M3U playlists
Description=Edits M3U format to get them to work on Nokia N900 Media Player
Language=VBScript
ScriptType=0

now once you have sync music files with n900, In the media monkey user interface : simply run:
Tools > Scripts > Fix Nokia N900 M3U Playlist.
A message box will be displayed telling you that all the play list files are fixed.

PS: The version of Media Monkey I used copied all Mp3 file to root directory instead of putting them in \Music folder, This was a configuration issue, I found a fix for this in URL:
http://www.mediamonkey.comwww.mediamonkey.com/forum/viewtopic.php?f=12&t=41932
I added the lines to MediaMonkey.ini file at path: C:\Users\Free User\AppData\Local\MediaMonkey. (Simiar path on other windows version would be like c:\document and settings\\appdata or applicatio data (this is the part of review where i really get bored typing and correcting the stuff I just wrote)


[WMDM]
COMApartmentThreading=1

If you do not like to change your preferred media player, Media Monkey does have few skins which makes it look similar to Itunes or WMP. Well that is not only reason, i started liking it. It has some more cool features such as auto DJ, fading effect, etc.
So until nokia fixes the n900 music sync, media monkey is the way to go.. well atleast for me.

i did not try syncing with itunes. Itunes is for iphones, not nokias'.

Thats all guys.. I hope it helped,
if you want to add somethings to it, add your comments.

3 comments:

The Backup Exec Goat said...

Thank You for taking the time to explain your fix for the Playlists. Much appreciated.

Anonymous said...

I connected my N900 in mass storage mode, used Playlist Creator 3, then loaded each playlist into a text editor and removed the absolute portion of the path names with search and replace, for example:

\Music\80s\song.mp3

becomes

80s\song.mp3

The direction of the slash (back vs. forward) did not have to be altered - but that first slash has to go.

Piotr Konieczny said...

I was able to import my playlists easily with Winamp. I copied my music to \.sounds\Music , then I added files in that directory to winamp playlist and saved the playlist in that directory. My n900 sees the playlists under imported playlists and seems to be able to play them easily.