GNOME Bugzilla – Bug 76519
Add a Visualizer (including volume meter) plugin
Last modified: 2008-02-09 18:20:30 UTC
Add Visualizer support to MonkeySound
Just wanted to say that this has to be the most unusefull thing I've ever seen, it should be added LAST when EVERYTHING else WORKS. Right now Rhythmbox is a good musicplayer but this visualisation crap can wait. Fix the bugs and such instead. This could wait until 0.9.0 so it'll be finished in good time for 1.0.0 Just felt it needed to be said. Don't take it too hard.
I would personally like to see this feature. I enjoy visualizations on my other monitor while I work.
Monkey Media has been removed from the 0.9.x series AFAIK, changing component to "User Interface".
Probably should be a plugin now, retitling to remove MonkeySound reference.
*** Bug 76523 has been marked as a duplicate of this bug. ***
From bug #76523: > Add volume meter support [...] (maybe this should be handled > through the same mechanism as visualization? its just another form of > visualization really)
Created attachment 74949 [details] [review] well, yeah Mostly-working visualization plugin. UI is still a bit ungood. If you have libvisual 0.4, you probably need gst-plugins-base CVS for this to do anything interesting (see bug 357800). Or you can just use the goom element.
plugins/Makefile.am needs to add "visualizer" to SUBDIRS, visualizer-ui.xml is missing and totem_display_is_local should be marked static. Also, rather than using RB_IS_PLAYER_GST in impl_activate, we could check whether it has a "playbin" property instead, with 'if (g_object_class_find_property (G_OBJECT_GET_CLASS (player), "playbin"))'.
Created attachment 74981 [details] [review] slightly better now actually works, even when installed.
Builds and installs OK, UI is enabled but I just get a black screen where the browser/entry list is even using the GOOM element as suggested in comment #7. I am using gstreamer-plugins-base-0.10.10 not CVS -base as suggested, but comment #7 implies that GOOM may work with the released version. I do the following warning on the command-line: (rhythmbox:11953): Rhythmbox-WARNING **: sink and/or vis plugin already set on playbin
Works now, but I get a crashes on shutdown: (gdb) thread apply all bt
+ Trace 77101
Thread 25 (Thread -1339896928 (LWP 12968))
Thread 24 (Thread -1321370720 (LWP 12967))
Thread 17 (Thread -1339896928 (LWP 12959))
Thread 12 (Thread -1321370720 (LWP 12952))
Thread 11 (Thread -1321370720 (LWP 12950))
Thread 1 (Thread -1211631920 (LWP 12914))
Here are the last few debug entries before the crash using "rhythmbox -d": (02:34:27) [0xa0451f0] [disable_visualization] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c:538: disabling visualization (02:34:27) [0xa0451f0] [fixate_vis_caps] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c:334: setting fixed caps on capsfilter: video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)60, height=(int)60, framerate=(fraction)1/1 (02:34:27) [0xa0451f0] [update_visualizer] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c:410: setting window id 77601899 (02:34:27) [0xa0451f0] [rb_plugin_info_free] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/rb-plugins-engine.c:364: Unref plugin Visualization (02:34:27) [0xa0451f0] [rb_visualizer_plugin_dispose] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c:207: RBVisualizerPlugin disposing sys:1: Warning: instance of invalid non-instantiatable type `(null)' sys:1: Warning: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed sys:1: Warning: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (02:34:27) [0xa0451f0] [rb_visualizer_plugin_finalize] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c:230: RBVisualizerPlugin finalising (02:34:27) [0xa0451f0] [impl_deactivate] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/lirc/rb-lirc-plugin.c:209: Deactivating lirc plugin (02:34:27) [0xa0451f0] [rb_plugin_info_free] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/rb-plugins-engine.c:364: Unref plugin LIRC (02:34:27) [0xa0451f0] [rb_plugin_info_free] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/rb-plugins-engine.c:364: Unref plugin Power Manager (02:34:27) [0xa0451f0] [rb_plugin_info_free] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/rb-plugins-engine.c:364: Unref plugin Artist/Album Browser(02:34:27) [0xa0451f0] [rb_python_object_finalize] /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/rb-python-plugin.c:202: Finalizing python plugin instance /home/alex/bin/rhythmbox: line 2: 11125 Segmentation fault GST_PLUGIN_PATH=/usr/local/lib/gstreamer-0.10 /usr/local/bin/rhythmbox "$@"
Created attachment 75008 [details] [review] fix refcounts hopefully it won't crash on shutdown any more..
Created attachment 75125 [details] [review] more stuff now hides the source header when visualization is active, the controls hide themselves after a few seconds with no mouse activity, and I've started on a fullscreen visualization mode. also added gconf schemas.
Works for me, the control hiding is nice. How do you enable full screen? I still get crashes when double-clicking sources, but I think I've narrowed it down. It seems to happen if double-clicking the source is the first thing you do before you've played a single track. If you get visualisations running then start double-clicking (say) playlists, then it seems to work fine. I seem to be also having some synchronisation issues with toggling the mode on and off. It doesn't always "stick" and sometimes the menu tick/check mark isn't synchronised with the actual state of the visualisation.
double-clicking sources works for me.
(In reply to comment #16) > double-clicking sources works for me. Even if double-clicking a source is the *very first* thing you do after a restart?
Created attachment 75304 [details] [review] yet more stuff - mostly working fullscreen (messes up the main window and causes gtk criticals, but otherwise seems to work properly) - stub of a dbus interface to make it scribble in someone else's window - main window should resize better
Works pretty well here. One issue I noticed is if you make RB's window sticky (i.e. shown on all workspaces) and then switch workspaces, the visualisation remains on the old workspace. It also detects my dual-head system as one screen (so not showing the options), but that might be NVidia Twinview reporting something strangely. Also, having some playback controls show up after motion in fullscreen (maybe at the top?) might be useful.
For me, it goes into fullscreen mode fine, but I get a crash on attempting to leave fullscreen mode (clicking the "Exit fullscreen"): sys:1: GtkWarning: gtk_widget_get_toplevel: assertion `GTK_IS_WIDGET (widget)' failed sys:1: GtkWarning: gtk_widget_event: assertion `GTK_IS_WIDGET (widget)' failed sys:1: GtkWarning: gtk_widget_send_expose: assertion `GTK_IS_WIDGET (widget)' failed The program 'rhythmbox' received an X Window System error. This probably reflects a bug in the program. The error was 'BadGC (invalid GC parameter)'. (Details: serial 459 error_code 13 request_code 140 minor_code 19) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) Program exited with code 01. (gdb) bt
There is no stack in this backtrace, not sure which program I'm give the program a --sync command option. gdb doesn't have a --sync option.
Running "rhythmbox --sync" makes the problem go away (i.e no crash). Hmmm.
I see that every now and then. --sync hides it for me too, which makes it sort of difficult to track down. I suspect it's related to how/when we set the target window ID for the image sink.
Created attachment 75480 [details] [review] fix output window disposal Fixes the gtk criticals and stops it puking all over the main window. There still seem to be some race conditions in there, as it locks up occasionally and still gives BadGC errors every now and then.
Yes, it does seem to be improved, thanks. I can still get BadGC errors, but they don't happen every time I try to leave Fullscreen mode, only once every three attempts... Although --sync can prevent the error occuring at all, it sometimes leads to a crash later on that doesn't involve visualisation. I did notice that sometimes the browser widget looked a bit weird after a while of toggle visualisations on and off when using --sync.
Created attachment 75505 [details] [review] better xinerama support This adds a few changes to better support the multi-screen bits, especially those using Xinerama, by allowing the choice of monitors within a screen.
(In reply to comment #26) > This adds a few changes to better support the multi-screen bits, especially > those using Xinerama, by allowing the choice of monitors within a screen. This patch fails to compile this on FC-5 with gtk2-2.8.20-1: /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c: In function 'impl_activate': /home/alex/src/remote-cvs/gnome.org/rhythmbox/plugins/visualizer/rb-visualizer-plugin.c:919: error: too few arguments to function 'gtk_window_set_skip_taskbar_hint' Changing the line to: gtk_window_set_skip_taskbar_hint (GTK_WINDOW (pi->vis_window), TRUE); made it compile for me. Another API change with gtk2? Haven't yet been able to setup my other head to test the actual functionality, but the drop-down menu appears when I run with xinerama engaged (but without an actual monitor plugged in).
This patch seems to have problems with current CVS. The "Visualisation" option in the menu doesn't appear any more (although the plugin item appears to be in the plugin dialog) so can't enable visualisations, here are some warning messages: Rhythmbox: could not connect to socket Rhythmbox: No such file or directory sys:1: Warning: g_file_get_contents: assertion `filename != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_construct: assertion `fname != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed (rhythmbox:27819): libglade-CRITICAL **: glade_xml_get_widget: assertion `self != NULL' failed sys:1: GtkWarning: gtk_cell_layout_pack_start: assertion `GTK_IS_CELL_LAYOUT (cell_layout)' failed sys:1: GtkWarning: gtk_cell_layout_set_cell_data_func: assertion `GTK_IS_CELL_LAYOUT (cell_layout)' failed sys:1: GtkWarning: gtk_combo_box_set_model: assertion `GTK_IS_COMBO_BOX (combo_box)' failed sys:1: GtkWarning: gtk_combo_box_set_active: assertion `GTK_IS_COMBO_BOX (combo_box)' failed sys:1: Warning: invalid (NULL) pointer instance sys:1: Warning: g_signal_connect_object: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed sys:1: Warning: g_object_ref: assertion `G_IS_OBJECT (object)' failed sys:1: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed sys:1: GtkWarning: gtk_box_pack_end: assertion `GTK_IS_WIDGET (child)' failed sys:1: Warning: g_date_set_julian: assertion `g_date_valid_julian (j)' failed sys:1: Warning: g_date_get_year: assertion `g_date_valid (d)' failed sys:1: Warning: g_date_set_dmy: assertion `g_date_valid_dmy (day, m, y)' failed sys:1: Warning: g_date_get_julian: assertion `g_date_valid (d)' failed sys:1: GtkWarning: gtk_container_remove: assertion `GTK_IS_TOOLBAR (container) || widget->parent == GTK_WIDGET (container)' failed sys:1: GtkWarning: gtk_box_pack_start: assertion `child->parent == NULL' failed
Problem appeared to be that the glade and XML files weren't installed in <prefix>/lib/rhythmbox/plugins/visualizer/ Odd, they seemed to be being installed before. Was there an automake/autoconf change?
Created attachment 76561 [details] [review] hopefully fixed BadGC errors
With this version, when switching to fullscreen, it goes to fullscreen but the visualisation freezes and I see this message: (rhythmbox:13871): Rhythmbox-WARNING **: Couldn't find an x overlay I can sometimes re-enable it by switching it on and off again, by switching to another source and then back again.
Setting your video sink in gstreamer-properties to ximagesink or xvimagesink (rather than 'autodetect') should work around that problem.
Created attachment 76682 [details] [review] handle video sink changes less stupidly Should work properly with autovideosink now.
Works much better now, thanks. Fullscreen toggling is pretty solid. I still have the problem that the first time I enable the plugin, I get the message: (rhythmbox:24899): Rhythmbox-WARNING **: sink and/or vis plugin already set on playbin and the visualisation doesn't launch at all. If I then restart rhythmbox with the plugin enabled, all is well, but I always need to restart it once after enabling.
I've got a fix for that that seems to need a tiny bit more work.
Seems like it's solid enough to check into CVS though, to enable wider testing. Especially since it can easily be completely disabled with no apparent side effects that I can see.
Created attachment 76875 [details] [review] more stuff adds simple play controls for fullscreen mode, fixes problem from comment 34.
Created attachment 77563 [details] [review] even more stuff updated for some recent changes. fixes display sync (BadGC) problems properly. adds silly root window mode (only if you're not running nautilus).
I'd propose checking this in if we weren't apparently going to do a release soon. It's certainly ready for wider testing, but not that much wider.
Hmm, Things seem to have gone backwards a bit for me. Now I can enable/disable it easily (without the "sink and/or vis plugin already set on playbin" error) but fullscreen is very wobbly. It enables but when the pop-ups are active the screen is black, when the pops-up disappear there are sections of the underlying desktop that appear through the full screen. Here are the terminal warnings I get: sys:1: Warning: g_date_set_julian: assertion `g_date_valid_julian (j)' failed sys:1: Warning: g_date_get_year: assertion `g_date_valid (d)' failed sys:1: Warning: g_date_set_dmy: assertion `g_date_valid_dmy (day, m, y)' failed sys:1: Warning: g_date_get_julian: assertion `g_date_valid (d)' failed sys:1: GtkWarning: gtk_tree_row_reference_get_path: assertion `reference != NULL' failed sys:1: GtkWarning: GdkWindow 0x4802076 unexpectedly destroyed sys:1: Warning: invalid uninstantiatable type `(null)' in cast to `GtkToggleButton' sys:1: GtkWarning: gtk_toggle_button_set_active: assertion `GTK_IS_TOGGLE_BUTTON (toggle_button)' failed sys:1: GtkWarning: gtk_widget_hide: assertion `GTK_IS_WIDGET (widget)' failed sys:1: Warning: g_object_ref: assertion `G_IS_OBJECT (object)' failed sys:1: GtkWarning: gtk_widget_queue_resize: assertion `GTK_IS_WIDGET (widget)' failed sys:1: Warning: instance of invalid non-instantiatable type `(null)' sys:1: Warning: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed sys:1: Warning: g_object_notify: assertion `G_IS_OBJECT (object)' failed sys:1: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed sys:1: Warning: invalid uninstantiatable type `(null)' in cast to `GtkLabel' sys:1: GtkWarning: gtk_label_set_markup: assertion `GTK_IS_LABEL (label)' failed
I did have a slightly bad patch install before, but now that I've fixed it, I still get the "sys:1: GtkWarning: GdkWindow 0x4802076 unexpectedly destroyed" and problems similar to those in comment #40. I don't get the other warnings, however.
For me, the plugin crashes if I disable it (in Edit > Plugins) and then re-enable it immediately afterwards without restarting RB in between. I'll get back with a stack trace and/or other information if needed. I have some other patches applied to the source tree, though, and I haven't tried with a 'clean' checkout from CVS yet.
I know the plugin misbehaves when disabled and re-enabled in the same session. It's not something I've made any attempt to fix yet. I'll get to it eventually.
The issues I reported in comment #40 mostly appear to happen only with a compositing window manager like compiz or beryl, switching back to metacity improves things considerably, e.g. no show-through of the background in fullscreen. However I still occasionally get a blank entry view when switching out of fullscreen and/or warning messages like comment #41.
Created attachment 78020 [details] [review] updated yet again This fixes the 'window unexpectedly destroyed' warnings for me (replacing them with something else; see bug 384008). Also lets you exit fullscreen mode by hitting escape, and stops it crashing when combined with the crossfade/gapless playback patch. Still won't do anything useful with it, but shouldn't crash.
Created attachment 78063 [details] [review] fix bug 384253
Looks pretty good to me, I see a few issue when moving between heads (xinerama, nvidia twinview) though: If I change the target head while in fullscreen mode, the output doesn't get drawn and it remains the widget background colour. Switching out of fullscreen and back into it fixes it. The other is a GTK critical warning that occasionally gets emitted, where the widget in question is pi->vis_widget. 1. Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed 2. 3. 4. #0 0xffffe410 in __kernel_vsyscall () 5. #1 0xb6ea4770 in raise () from /lib/tls/i686/cmov/libc.so.6 6. #2 0xb6ea5ef3 in abort () from /lib/tls/i686/cmov/libc.so.6 7. #3 0xb7027122 in IA__g_logv (log_domain=<value optimized out>, log_level=G_LOG_LEVEL_CRITICAL, format=0xb70517bb "%s: assertion `%s' failed", 8. args1=0xbff6494c "=A\226�d'\226�@\r��\001") at gmessages.c:497 9. #4 0xb7027159 in IA__g_log (log_domain=0xb78afec1 "Gtk", log_level=G_LOG_LEVEL_CRITICAL, format=0xb70517bb "%s: assertion `%s' failed") at gmessages.c:517 10. #5 0xb702723b in IA__g_return_if_fail_warning (log_domain=0xb78afec1 "Gtk", pretty_function=0xb796413d "gtk_widget_event", 11. expression=0xb7962764 "WIDGET_REALIZED_FOR_EVENT (widget, event)") at gmessages.c:532 12. #6 0xb7877ab5 in IA__gtk_widget_event (widget=0x8db1db8, event=0x8a31900) at gtkwidget.c:3707 13. #7 0xb7883677 in IA__gtk_window_propagate_key_event (window=0x862c2a0, event=0x8a31900) at gtkwindow.c:4671 14. #8 0xb78866dc in gtk_window_key_press_event (widget=0x862c2a0, event=0x8a31900) at gtkwindow.c:4701 15. #9 0xb775fb00 in _gtk_marshal_BOOLEAN__BOXED (closure=0x8237158, return_value=0xbff64b60, n_param_values=2, param_values=0xbff64c3c, 16. invocation_hint=0xbff64b4c, marshal_data=0xb7886690) at gtkmarshalers.c:84 17. #10 0xb71b3fb9 in g_type_class_meta_marshal (closure=0x8237158, return_value=0xbff64b60, n_param_values=2, param_values=0xbff64c3c, 18. invocation_hint=0xbff64b4c, marshal_data=0xcc) at gclosure.c:567 19. #11 0xb71b579b in IA__g_closure_invoke (closure=0x8237158, return_value=0xbff64b60, n_param_values=2, param_values=0xbff64c3c, invocation_hint=0xbff64b4c) 20. at gclosure.c:490 21. #12 0xb71c61e3 in signal_emit_unlocked_R (node=0x8237228, detail=0, instance=0x862c2a0, emission_return=0xbff64dfc, instance_and_params=0xbff64c3c) 22. at gsignal.c:2478 23. #13 0xb71c6e7f in IA__g_signal_emit_valist (instance=0x862c2a0, signal_id=94, detail=0, var_args=<value optimized out>) at gsignal.c:2209 24. #14 0xb71c7279 in IA__g_signal_emit (instance=0x862c2a0, signal_id=94, detail=0) at gsignal.c:2243 25. #15 0xb78735f8 in gtk_widget_event_internal (widget=0x862c2a0, event=0x8a31900) at gtkwidget.c:3911 26. #16 0xb7758f2a in IA__gtk_propagate_event (widget=0x862c2a0, event=0x8a31900) at gtkmain.c:2185 27. #17 0xb775a0f7 in IA__gtk_main_do_event (event=0x8a31900) at gtkmain.c:1445 28. #18 0xb75e37ea in gdk_event_dispatch (source=0x820eca0, callback=0, user_data=0x0) at gdkevents-x11.c:2320 29. #19 0xb701e802 in IA__g_main_context_dispatch (context=0x820ece8) at gmain.c:2045 30. #20 0xb70217df in g_main_context_iterate (context=0x820ece8, block=1, dispatch=1, self=0x8159018) at gmain.c:2677 31. #21 0xb7021b89 in IA__g_main_loop_run (loop=0x842fa30) at gmain.c:2881 32. #22 0xb775a574 in IA__gtk_main () at gtkmain.c:1024 33. #23 0x0806aae3 in main (argc=2, argv=0xbff651b4) at main.c:382
It looks pretty solid, and hopefully will be included into CVS soon. A few things come to mind it terms of the user interface. A hotkey for toggling the visualization would be a great improvement. Another idea that you can play with is to put the visualization set of widgets inside a vertical paned, where the browser is in the upper paned part. That way, you can open the browser without stopping the visualization (althought this might be a moot point once a hotkey is added)
Created attachment 78784 [details] [review] final patch Now handles being disabled and re-enabled properly. I'm about to commit this version of the patch to CVS.
Committed to CVS. Please open new bugs for visualisation problems and UI suggestions.
Have a problem on radeon 9600 - even when the visualisation is not active (but the plugin is enabled), rhythmbox occupies the videooverlay and if i try to watch some video with rhythmbox on the background, i get an error about occupied videooverlay and the video is played with NO antialiasing :(