Porting SongBird to Solaris

It seems that my comment to the topic http://www.songbirdnest.com/node/1377 is considered to be a spam. So I'd like to post it here again.

Following are the current status on my porting of SongBird to Solaris. SongBird GUI can be launched on my Solaris x86 box(svn_80): http://www.flickr.com/photos/39375616@N00/2293711728/. But nothing happen no matter I click a button or choose a drop-down menu item, such as "Open a File". You can find the debugging output for the binary here: http://iann.pastebin.com/m5e78f628.

1. Check out the XULRunnder trunk(2008-02-21) source code:
cvs co mozilla/client.mk
cd mozilla
gmake -f client.mk checkout MOZ_CO_PROJECT=xulrunner

2. Build XULRunner trunk with the mozconfig below:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build
ac_add_options --enable-application=xulrunner
ac_add_options --with-xulrunner-stub-name=songbird
ac_add_options --disable-optimize
ac_add_options --disable-tests
ac_add_options --enable-debug
ac_add_options --disable-static
ac_add_options --enable-shared
ac_add_options --disable-auto-deps
ac_add_options --disable-crashreporter

3. Check out the SongBird source code.
svn co https://publicsvn.songbirdnest.com/songbird/client/trunk sbird

4. Hack around the code for Solaris, with patch here: http://iann.pastebin.com/m2a2ffe68. I just ignore some breakpad(crash reporting) requirements due to it's still under development: https://bugzilla.mozilla.org/show_bug.cgi?id=391361 and http://code.google.com/p/google-breakpad/issues/detail?id=22....

5. Get the new command sets for "cp" and "find"(/usr/local/): coreutils-6.9 and findutils-4.2.33. This can help bypass some incompatibility issues.

6. Packaging XULRunner to build SongBird: http://publicsvn.songbirdnest.com/wiki/PackagingXulRunner.

7. Build vendor binaries(gettext id3lib libgpod libiconv libogg libtool taglib zlib) by running the build script in every directories.

8. Build SongBird. In the source root directory, run "gmake -f songbird.mk debug".

9. Goto compiled/dist and run ./songbird.

10. Get an empty dialog: http://www.flickr.com/photos/39375616@N00/2293710390, have to click "yes" to proceed. It seems that a new profile is created and the same dialog pops up again. Then choose "cancel" to proceed.

11. Get an dialog for "internal playback core error": http://www.flickr.com/photos/39375616@N00/2293710392/. Click "more info" won't pop up any info window... Proceed by "more info" and "continue".

12. Accept the license agreement(http://www.flickr.com/photos/39375616@N00/2293710394/) and get to "Setup options"(http://www.flickr.com/photos/39375616@N00/2293710396/). The network connection option can be set here(http://www.flickr.com/photos/39375616@N00/2293710400/). Choose "OK" will bring me to the main window finally: http://www.flickr.com/photos/39375616@N00/2293710404/.

The error message
"
JavaScript error: , line 0: uncaught exception: [Exception... "'Component not initialized' when calling method: [sbIPlaylistPlayback::getSupportedFileExtensions]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: chrome://songbird/content/scripts/playerOpen.js :: SBFileOpen :: line 65" data: no]
"
in the log shows that there are something wrong with the component initialization for "@songbirdnest.com/Songbird/PlaylistPlayback;1" when I choose the menu item "Open a File".

var PPS = Components.classes["@songbirdnest.com/SongbirdPlaylistPlayback;1"].getService(Components.interfaces.sbIPlaylistPlayback);
......
var eExtensions = PPS.getSupportedFileExtensions();

The javascript file is already there in compiled/dist/components/sbPlaylistPlayback.js, and the debugging output shows that the registration has succeeded:

# *** registering sbMediaContentListener.js: [ sbMediaContentListener ]
# *** registering sbPlaylistPlayback.js: [ Songbird Playlist Playback Interface ]

Also notice that some SongBird related components have been registered successfully:

*** Registering components in: SongbirdMetadataManagerComponent
*** Registering components in: SongbirdMetadataHandlerTaglibComponent
*** Registering components in: sbGStreamerModule
*** Registering components in: SongbirdDeviceManagerModule
*** Registering components in: SongbirdDownloadDeviceComponent

Any suggestions for this problem?

Thanks,
-Alfred

alfred Says:   

Also, if I follow the steps below:
1. File -> Open From URL (a little popup screen appears and asks for the URL)
2. Enter "chrome://songbird/content/scripts/playerOpen.js"

I got the following error message in the terminal:
JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: file:///export/home/alfred/svn/sbird20080221/trunk/compiled.bak/Songbird_20080221/jsmodules/sbLibraryUtils.jsm :: anonymous :: line 58" data: no]

I check a little bit in the "about:config" entries. No entry with name "songbird.library.web" in it, which does exist in the Linux build.

mig Says:   

Heh, "Open From URL" is supposed to be for media files, not .js files, ya?

You can just put the chrome url into the address bar and it will show it.

mig Says:   

Oh, and for the larger problem, you don't have any working media cores for playback.

Neither gst nor vlc are likely to work properly out of the box for you, though you'll probably have better luck trying to bring the gst core up to speed.

alfred Says:   

"Open a File" can bring up a dialog to select files now. The updated patch is here: http://pastebin.mozilla.org/352847.

But when I choose a media file to open, still got error:
JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [sbILibraryManager.mainLibrary]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://songbird/content/scripts/playerOpen.js :: SBImportURLIntoMainLibrary :: line 769" data: no]
Seems to be something wrong with the library manager component.

Thanks for Mook's help.

mig Says:   

UNEXPECTED in sbILibraryManager.mainLibrary usually means the database is corrupted.

try making a new profile and starting over again.

if you're working off the trunk code, it should put up an error dialog if it initializes onto a corrupt database (allows you to delete the bad files from there).

alfred Says:   

mig, thanks for the reply.

I did have a dialog like this now: http://www.flickr.com/photos/39375616@N00/2316465068/, which shows that the library is corrupted. If I choose "Delete Library and Restart", the same dialog will pop up again. I had to choose "Continue Anyway" to proceed.

I tried to debug into the code: http://publicsvn.songbirdnest.com/browser/trunk/components/l.... The preference key "songbird.library.main" doesn't exist in the config entries and causes some failure.

Do you have any idea on where in the code the preference value for "songbird.library.main"/"songbird.library.web"... are set?

alfred Says:   

In case some guys here feel interested in making their own builds on Solaris, post this here for your reference: http://blogs.sun.com/pengyang/entry/porting_songbird_to_sola...

alfred Says:   

With the patch http://bugzilla.songbirdnest.com/attachment.cgi?id=4847 to fix the sql query warning, the Library/Downloads/Web Media History views can display correctly: http://www.flickr.com/photos/39375616@N00/2323263723/. Also I can create a "New Playlist" now.

But when I tried to open an mp3 file, still got the following error:
JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [sbIMediaListView.getIndexForItem]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: chrome://songbird/content/scripts/playerOpen.js :: SBFileOpen :: line 126" data: no]
###!!! ASSERTION: Resetting a query that is not complete!!!!!: 'm_QueryHasCompleted', file /export/home/alfred/packages/BUILD/SFEsongbird-trunk/sbird20080305/components/dbengine/src/DatabaseQuery.cpp, line 522

Any idea for this issue?

mig Says:   

http://publicsvn.songbirdnest.com/browser/trunk/app/content/...

So, from looking at the code, the view you have does not contain the item requested for playback.

I'll bet "SBImportURLIntoMainLibrary(uri)" is what failed and the local "var item" is not valid when passed to the method.

alfred Says:   

Yes, no items in the playback list even I try to open some local media files.

I did some debugging into the code. The root cause is here: http://dingo.songbirdnest.com:8080/source/xref/components/li... where mCache.Length() == mLength == 0. I guess that mLength shouldn't be zero after UpdateLength in Initialize somewhere.

Anyone familiar with this part of the code? Or any hints from you guys?

steve Says:   

Hey alfred, I don't know if this has anything to do with the mCache.Length() problem you reported above, but I took a quick look at the patch you linked in your original post as saw something that could cause problems:

Index: components/library/base/src/sbLibraryConstraints.cpp
===================================================================
--- components/library/base/src/sbLibraryConstraints.cpp (revision 8295)
+++ components/library/base/src/sbLibraryConstraints.cpp (working copy)
-553,7 +553,7 @@
new sbTArrayStringEnumerator(&array);
NS_ENSURE_TRUE(enumerator, NS_ERROR_OUT_OF_MEMORY);

- enumerator.forget(aProperties);
+ enumerator.forget();

return NS_OK;
}
-574,7 +574,7 @@
new sbTArrayStringEnumerator(array);
NS_ENSURE_TRUE(enumerator, NS_ERROR_OUT_OF_MEMORY);

- enumerator.forget(_retval);
+ enumerator.forget();

return NS_OK;
}

The .forget() call transfers ownership of the object from the enumerator to the out param in both cases. Without it, the methods will not return anything :) If you are having trouble getting it to compile, you can change the first one to:

NS_ADDREF(*aProperties = enumerator);

...and the second one to:

NS_ADDREF(*_retval = enumerator);

Also, would you mind opening a bug in bugzilla for your solaris work and attaching your patches there?

alfred Says:   

Steve, thanks for the suggestion. The issue mentioned above has been fixed in the latest patch: http://bugzilla.songbirdnest.com/attachment.cgi?id=4925. A bug has been created for OpenSolaris support here: http://bugzilla.songbirdnest.com/show_bug.cgi?id=7800.

alfred Says:   

Try to get some TRACE LOG by "export NSPR_LOG_MODULES=ALL:5". The output is here: http://pastebin.mozilla.org/369238.

Is the Javascript Error related to the sql: "select count(1) from media_items as _mi join resource_properties as _p0 on _mi.guid = _p0.guid join resource_properties as _getnotnull on _mi.guid = _getnotnull.guid where _mi.media_list_type_id is null and _p0.property_id = -7 and _p0.obj_sortable in ('+0000000000000000000') and _getnotnull.property_id = -2", which returns 0?

steve Says:   

I replied to your last comment in the bug:

http://bugzilla.songbirdnest.com/show_bug.cgi?id=7800#c8

Can we continue the discussion there?

alfred Says:   

Just give some updates.

Songbird can be launched on my Solaris box successfully and playback view is correctly shown: http://www.flickr.com/photos/39375616@N00/2342353875/. The mp3 files can be played in it. If you're interested in playing with it on Solaris, feel free to have a try: http://releases.mozilla.com/sun/Songbird-Solaris/songbird-20....

This was built on Solaris Nevada 80 box with Sun Studio 11. It's based on the snapshot of XULRunner 2008-02-21/Songbird 2008-03-05
and could be buggy. Just extract it and run "./songbird" should be fine.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

User login

Download a Nightly Build

Keep me posted!

Sign up to be notified of new releases & important updates.


Get a Songbird Tshirt

Songbird Buttons


Get Songbird
Get Songbird
Get Songbird
Get Songbird


More buttons for your blog...