After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 327153 - Add support for NJB-based devices
Add support for NJB-based devices
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: Removable Media
HEAD
Other Linux
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks: 76528
 
 
Reported: 2006-01-16 02:03 UTC by James "Doc" Livingston
Modified: 2018-05-24 11:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
start of a patch (27.34 KB, patch)
2006-01-16 02:10 UTC, James "Doc" Livingston
none Details | Review
patch (24.54 KB, patch)
2006-12-07 12:38 UTC, James "Doc" Livingston
none Details | Review
fixed patch (24.54 KB, patch)
2006-12-07 12:40 UTC, James "Doc" Livingston
none Details | Review
updated for svn (24.68 KB, patch)
2007-03-25 12:35 UTC, James "Doc" Livingston
none Details | Review
Crash report (35.42 KB, text/plain)
2007-03-25 14:10 UTC, Tom Kirby
  Details
New crash-report (35.43 KB, text/plain)
2007-03-26 07:47 UTC, Tom Kirby
  Details
fixed patch (24.69 KB, patch)
2007-03-26 11:38 UTC, James "Doc" Livingston
none Details | Review
modified patch to add njb support (24.72 KB, patch)
2007-04-16 13:32 UTC, Tom Kirby
needs-work Details | Review
debug session pertainent to patch above (3.18 KB, text/plain)
2007-04-16 13:34 UTC, Tom Kirby
  Details
Backtrace from rhythmbox (3.26 KB, text/plain)
2007-04-30 00:05 UTC, Chris Budden
  Details

Description James "Doc" Livingston 2006-01-16 02:03:39 UTC
It would be nice to support NJB-based devices, using libnjb (http://libnjb.sourceforge.net). libnomad (http://neutrino.soureforge.net) also provides a gobject based interface on top of libnjb.
Comment 1 James "Doc" Livingston 2006-01-16 02:10:56 UTC
Created attachment 57446 [details] [review]
start of a patch

This is the start of a patch to add support for NJB-based devices. It only performs detection at the moment, and doesn't do track loading. As I don't have a NJB device, I'm not actually sure if works.


It also includes some changes to RBRemovableMediaManager to deal with things that aren't mountable by gnome-vfs. It is a bit messy because some things will be reported by gnome-vfs and hal (most things), hal only (NJB devices), or gnome-vfs only (if it wasn't compiled with HAL support). I haven't though of a better way of doing this yet.

There will probably be funky issues caused by handling detection events from both HAL and gnome-vfs, so sources should only respond to one of gnome-vfs (volume != NULL) or HAL (volume == NULL).
Comment 2 Cameron Harris 2006-03-04 22:54:28 UTC
I've started to work on this bug. Currently trying to make libnjb work nice with HAL (it's being quite strangely behaved). Maybe the fdi's should be patched so that HAL knows about the NJB devices.. Following from the iPod's example, maybe something like:

info.capabilities: append portable_audio_player"
portable_audio_player.output_formats: append "audio/mpeg"
portable_audio_player.output_formats: append "audio/x-ms-wma"
portable_audio_player.type = "njb"
portable_audio_player.access_method = "user"

Comment 3 James "Doc" Livingston 2006-03-05 04:42:20 UTC
Currently the removable-media-manager isn't really set up to handle things that don't get mounted by gnome-vfs. What would be best is having a gnome-vfs module for NJB access, which was started by the author of Neutrino (at http://neutrino.sourceforge.net), however I think he was having some issues which is why it wasn't finished.

If a gnome-vfs module isn't available, several things become harder:
* someone will have to write a gstreamer source element, if you want to be able to play tracks on the player.
* RBRemovableMediaManager will need to be modified to handle non-GnomeVFS stuff
Comment 4 Cameron Harris 2006-03-05 15:39:43 UTC
The GStreamer source element wouldn't be greatly difficult, but I don't know about the RBRemovableMediaManager modification... 

A Gnome-VFS module would seem like a nicer solution since other applications would be able to use it quite easily, but I'm not sure how you could implement things like adjusting the player settings through Rhythmbox (changing owner, automatic time sync, etc.), since gnome-vfs-daemon would have the usb device open... maybe an njb-daemon and other things using DBUS?
There are still a couple of issues with this I can think of.. particularly Gnome-VFS's handling of metadata (is it still non-existant?). 

Having it Gnome-VFS mountable would have nice properties too, since if you weren't writing music to it, the module would be able to write to the file storage. Kind of sucks how Creative decided to use their own filesystem and way of accessing it for the NJB series -- and it also skips music like on a CD sometimes... quite strange.

Not sure if you've seen this, though: http://www.figuiere.net/hub/blog/?2006/03/03/385-digital-audio-player-access-take-2

In theory it could be part of Gnome-VFS, but Gnome-VFS would need to have some modifications to support that type of task.
Comment 5 pavel 2006-03-09 22:08:47 UTC
according to http://live.gnome.org/GnomeVfsPlans
a FUSE module would be more future-proof that a gnomevfs-module...
Comment 6 James "Doc" Livingston 2006-03-10 11:48:10 UTC
Whether it is implemented as a Gnome-VFS module or a FUSE module doesn't really matter. As long as it is accessable via Gnome-VFS (which it will be if done as a FUSE module), playback will work.

Regarding metadata et al, we would still need to use the library to access that (we use libgpod to access the db on ipods). The plan for the stuff on the Neutrino site (in my comment above) was to have a daemon which accessed the device, and the gnome-vfs module would talk to it over dbus. That would deal with the fact that only one process can use the device at once.


It would be possible to do without a GnomeVFS/FUSE module, however:
a) it will probably be more difficult to get RB to support it well, and
b) a module will make it easier to add NJB support to other programs (Banshee et al)
Comment 7 Tom Kirby 2006-08-18 15:17:08 UTC
Did you apply that patch, James? When I plug in my Creative NJB Zen Touch, RB gets un-minimized, in a rather psychic kind of way. I can't get it to do anything more than that, and the HAL device manager doesn't seem to recognise the thing as an MP3 player.

I'd really like to get my player working with RB, but I feel a bit lost as to anything I could do. I don't have the time or skills to actually do any coding, but I wonder if there's anything else I could do that would be at all useful...
Comment 8 Jonathan Matthew 2006-08-20 02:52:06 UTC
The patch hasn't been applied.  Perhaps you have gnome-volume-manager (or something similar) configured to run rhythmbox when a music player is connected?
Comment 9 Tom Kirby 2006-08-20 11:16:40 UTC
Well, I'm running Ubuntu 6.06 LTS with CVS HEAD of RB. No idea whether Ubuntu does anything like that, but perhaps it ought to be filed against the Ubuntu bugzilla, as it could confuse a user into thinking that Rhythmbox can handle their NJB.
Comment 10 James "Doc" Livingston 2006-12-07 12:38:48 UTC
Created attachment 77883 [details] [review]
patch

Finally updated and some more work done on it. As I don't have a NJB device, I can't actually test this.
Comment 11 James "Doc" Livingston 2006-12-07 12:40:18 UTC
Created attachment 77885 [details] [review]
fixed patch

Oops, patch that will actually apply.
Comment 12 Matt N 2007-01-14 23:32:41 UTC
With the latest svn and patch from this thread, I get this when I start RB with my Zen Micro plugged in:

$ rhythmbox -D njb
(18:31:25) [0x80ed030] [register_rb_plugin] rb-njb-plugin.c:78: Registering plugin RBNjbPlugin
(18:31:25) [0x80ed030] [rb_njb_plugin_init] rb-njb-plugin.c:105: RBNjbPlugin initialising
(18:31:28) [0x80ed030] [rb_njb_source_set_property] rb-njb-source.c:186: NJB device captured


Backtrace was generated from '/usr/local/bin/rhythmbox'

Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1496791360 (LWP 31816)]
[New Thread -1497011280 (LWP 31818)]
0xa7f80410 in ?? ()

Comment 13 Matt N 2007-01-14 23:35:19 UTC
Sorry, I forgot to mention that RB segfaults after that debug output.  The same things happens if I plug the device in after RB is running.
Comment 14 Chris Budden 2007-03-16 15:18:03 UTC
After applying this patch, and running ./autogen.sh, I get the following error :

Running aclocal-1.9...

/usr/share/aclocal/libxosd.m4:9: warning: underquoted definition of AM_PATH_LIBXOSD
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
aclocal:configure.ac:938: warning: macro `AM_PATH_CHECK' not found in library

Running autoconf...

configure.ac:938: error: possibly undefined macro: AM_PATH_CHECK
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.


What can I do to fix this?

Comment 15 Bastien Nocera 2007-03-16 15:39:20 UTC
(In reply to comment #14)
> After applying this patch, and running ./autogen.sh, I get the following error
> :
> 
> Running aclocal-1.9...
> 
> /usr/share/aclocal/libxosd.m4:9: warning: underquoted definition of
> AM_PATH_LIBXOSD
>   run info '(automake)Extending aclocal'
>   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
> aclocal:configure.ac:938: warning: macro `AM_PATH_CHECK' not found in library

Install the "check" package.
Comment 16 Chris Budden 2007-03-16 15:55:08 UTC
Installing the check package worked fine, but when I go to enable the plugin, rhythmbox crashes with a segfault:

rhythmbox
Segmentation fault (core dumped)
Comment 17 Chris Budden 2007-03-16 16:09:26 UTC
(In reply to comment #16)
> Installing the check package worked fine, but when I go to enable the plugin,
> rhythmbox crashes with a segfault:
> 
> rhythmbox
> Segmentation fault (core dumped)
> 

Also, with running rhythmbox like this :

rhythmbox -D njb I get the following output:

 rhythmbox -D njb
(16:08:04) [0x80f3028] [register_rb_plugin] rb-njb-plugin.c:78: Registering plugin RBNjbPlugin
(16:08:04) [0x80f3028] [rb_njb_plugin_init] rb-njb-plugin.c:105: RBNjbPlugin initialising
Segmentation fault (core dumped)


Chris
Comment 18 James "Doc" Livingston 2007-03-20 12:10:00 UTC
The stack trace from comment #12 seems to be damaged. Chris: is there any chance you could get a bactrace from that crash?
Comment 19 Chris Budden 2007-03-20 12:18:55 UTC
Sure, how would I do that?
Comment 20 James "Doc" Livingston 2007-03-20 12:25:41 UTC
http://live.gnome.org/GettingTraces has information on how to get a backtrace.
Comment 21 shayne o'connor 2007-03-24 21:59:49 UTC
will the patch from comment #11 apply to current SVN? i have a creative zen touch that i'm not too keen to update to an MTP device yet, and would love to get it working with rhythmbox ... been waiting for a patch like this for ages, so i will help testing.
Comment 22 James "Doc" Livingston 2007-03-25 06:52:07 UTC
It applies fine to SVN for me.

In it's current form it should detect the device and hopefully list the tracks. Not sure if it can actually do that without crashing, as the code has never been run by someone with an NJB device.
Comment 23 Tom Kirby 2007-03-25 10:10:43 UTC
I can apply the patch fine, but RB won't build once I've applied it. I get this output:

 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DGNOMELOCALEDIR=\"/usr/local/share/locale\" -DG_LOG_DOMAIN=\"Rhythmbox\" -I../.. -I../../lib -I../../metadata -I../../player -I../../rhythmdb -I../../widgets -I../../sources -I../../iradio -I../../podcast -I../../plugins -I../../shell -DPIXMAP_DIR=\"/usr/local/share/pixmaps\" -DSHARE_DIR=\"/usr/local/share/rhythmbox\" -DDATADIR=\"/usr/local/share\" -DORBIT2=1 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/gnome-keyring-1 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/libglade-2.0 -I/usr/include/gnome-vfs-module-2.0 -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -Wcomment -Wformat -Wnonnull -Wimplicit-int -Wimplicit -Wmain -Wmissing-braces -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function -Wunused-label -Wunused-value -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wall -Werror -std=gnu89 -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -D_XOPEN_SOURCE -D_BSD_SOURCE -ggdb -MT rb-njb-source.lo -MD -MP -MF .deps/rb-njb-source.Tpo -c rb-njb-source.c  -fPIC -DPIC -o .libs/rb-njb-source.o
rb-njb-source.c: In function 'rb_njb_source_new':
rb-njb-source.c:227: error: 'RB_SOURCELIST_GROUP_REMOVABLE' undeclared (first use in this function)
rb-njb-source.c:227: error: (Each undeclared identifier is reported only once
rb-njb-source.c:227: error: for each function it appears in.)
make[3]: *** [rb-njb-source.lo] Error 1
make[3]: Leaving directory `/home/tom/projects/gnomesvn/rhythmbox-njb/plugins/njb'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tom/projects/gnomesvn/rhythmbox-njb/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tom/projects/gnomesvn/rhythmbox-njb'
make: *** [all] Error 2
Comment 24 Chris Budden 2007-03-25 12:00:33 UTC
(In reply to comment #20)
> http://live.gnome.org/GettingTraces has information on how to get a backtrace.
> 

Hey.  I have managed to install the gtk debug stuff, but I am unable to find the rhythmbox dbg packages for ubuntu, and I am not getting any more output of crashing rhythmbox.
Comment 25 James "Doc" Livingston 2007-03-25 12:35:36 UTC
Created attachment 85257 [details] [review]
updated for svn
Comment 26 Tom Kirby 2007-03-25 14:09:57 UTC
RB builds OK with the new patch, but when I try to enable the plugin (even when my Zen Touch is disconnected), RB crashes and Bug Buddy takes over. I'll attach the output that Bug Buddy gives me.
Comment 27 Tom Kirby 2007-03-25 14:10:32 UTC
Created attachment 85260 [details]
Crash report
Comment 28 James "Doc" Livingston 2007-03-25 22:47:52 UTC
That means it can't find the "njb-ui.xml" file.

In plugins/njb/Makefile.am, the following is wrong:

	plugin_DATA = $(plugin_in_files:.rb-plugin.desktop.in=.rb-plugin)	\
		njb-ui.xml

	EXTRA_DIST = $(plugin_in_files)

it should be 

	plugin_DATA = $(plugin_in_files:.rb-plugin.desktop.in=.rb-plugin)

	uixmldir = $(plugindir)
	uixml_DATA = njb-ui.xml

	EXTRA_DIST = $(uixml_DATA) $(plugin_in_files)
Comment 29 Tom Kirby 2007-03-26 07:47:21 UTC
Created attachment 85299 [details]
New crash-report

I still seem to be getting a similar problem...
Comment 30 Tom Kirby 2007-03-26 07:48:00 UTC
BTW, this was after I made the change suggested by James above.
Comment 31 James "Doc" Livingston 2007-03-26 11:38:05 UTC
Created attachment 85316 [details] [review]
fixed patch

We were installing the file in the wrong directory, so it wouldn't be found if you were running installed. This should fix it.
Comment 32 Tom Kirby 2007-03-26 12:22:32 UTC
Thanks. Unfortunately, I won't be able to test this until Thursday at the earliest.
Comment 33 Tom Kirby 2007-03-29 15:43:38 UTC
OK. I have now successfully applied the plugin patch, tweaked a line in plugins/njb/rb-njb-plugin.c to make the device appear in the sourcelist, re-compiled, re-installed, run RB and turned on the plugin.

Now when I start RB with the NJB plugged in, I get this output:


sys:1: Warning: IA__g_object_new_valist: object class `RBNjbSource' has no property named `sourcelist-group'

(rhythmbox:27681): libgnomevfs-CRITICAL **: gnome_vfs_volume_get_drive: assertion `volume != NULL' failed

(rhythmbox:27681): libgnomevfs-CRITICAL **: gnome_vfs_volume_get_display_name: assertion `volume != NULL' failed

(rhythmbox:27681): libgnomevfs-CRITICAL **: gnome_vfs_volume_get_icon: assertion `volume != NULL' failed
sys:1: GtkWarning: gtk_icon_theme_load_icon: assertion `icon_name != NULL' failed
sys:1: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed


Any ideas?
Comment 34 Tom Kirby 2007-04-10 13:33:48 UTC
I have carried out the following steps with latest SVN:

1) apply rb-njb patch

2) in plugins/njb/rb-njb-plugin.c add "rb_shell_append_source (plugin->shell, RB_SOURCE (source), NULL);" after the line with g_hash_table_insert()

3) in plugins/njb/rb-njb-source.c change "sourcelist-group" on line 230 to "source-group" (suggested by teuf: doesn't seem to work)

When I then build and run Rhythmbox, no icon appears, and I get the same output as above. i.e. this still isn't fixed, and I'm still waiting patiently for a response so I can get on with testing this, on behalf of all those people out there with Creative NJB-based devices.
Comment 35 Christophe Fergeau 2007-04-10 14:24:34 UTC
You still get the 

sys:1: Warning: IA__g_object_new_valist: object class `RBNjbSource' has no
property named `sourcelist-group'

warning with the change I suggested?
Comment 36 Tom Kirby 2007-04-10 16:52:41 UTC
Yup. I get all the stuff I put down above; I just checked it again.
Comment 37 Tom Kirby 2007-04-16 13:32:31 UTC
Created attachment 86426 [details] [review]
modified patch to add njb support

This patch incorporates the changes above, but causes the segfault for which I have posted a GDB session below.
Comment 38 Tom Kirby 2007-04-16 13:34:15 UTC
Created attachment 86427 [details]
debug session pertainent to patch above

If I run RB and then plug my NJB in, I get a segfault. Here is a GDB session with a backtrace.
Comment 39 Christophe Fergeau 2007-04-16 13:41:47 UTC
Changing
+	g_object_get (source,
+		      "shell", &shell,
+		      "db", &db,
+		      "entry-type", &entry_type,
+		      NULL);

to 
+	g_object_get (source,
+		      "shell", &shell,
+		      "entry-type", &entry_type,
+		      NULL);
+	g_object_get (shell, "db", &db, NULL);

should get rid of the warning about
sys:1: Warning: IA__g_object_get_valist: object class `RBNjbSource' has no property named `db'

The warnings about "volume" being NULL are worrying though, they probably indicate that rb couldn't even locate your njb device.
Comment 40 Chris Budden 2007-04-30 00:05:25 UTC
Created attachment 87258 [details]
Backtrace from rhythmbox

Here is a backtrace from running rhythmbox, then plugging in my Zen
Comment 41 Chris Budden 2007-06-09 22:00:47 UTC
Has anyone made any progress on this patch?  

thanks

Chris
Comment 42 Peter Grundström 2007-06-16 14:25:16 UTC
The "(rhythmbox:27681): libgnomevfs-CRITICAL **: gnome_vfs_volume_get_drive:
assertion `volume != NULL' failed" warning (and crash) should be gone now, see bug #443367.

It might be earier to build njb support by modifying the mtp plugin since libmtp and libnjb are quite similar. 
Comment 43 Hew McLachlan 2008-05-31 04:43:05 UTC
It's been almost a year since the last update to this bug. Is this patch still being worked on? It would be great to see this in a rhythmbox release.
Comment 44 Darin 2008-06-29 18:04:31 UTC
I'm not sure that this will move any further. Creative no longer releases njb players, and hasn't for years. Players from 2005 onward are either UMS or MTP based. All previous players (as far back as the Zen Xtra in 2003) have MTP firmware upgrades available.

gnomad2 still supports these players quite well, but have moved on to MTP support. Banshee recently ditched their njb efforts. It seems focus should be on making MTP/UMS/iPod work better.

- Darin
Comment 45 Bastien Nocera 2008-06-29 22:49:56 UTC
I don't see anything wrong leaving this opened if there are still people with hardware that doesn't support anything but NJB devices. Peter, Chris, Tom?
Comment 46 Chris Budden 2008-06-30 06:16:04 UTC
My device just supports NJB, but I can appreciate that the majority of devices now are MTP or Apple devices and developers want to concentrate on them

On a personal note, I will be replacing my NJB player in a couple of weeks anyway.
Comment 47 GNOME Infrastructure Team 2018-05-24 11:07:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/121.