GNOME Bugzilla – Bug 632266
"not enough space on the device" error when syncing (transcoding) flac files to removable device
Last modified: 2014-04-28 22:56:54 UTC
When I sync some flac files into my sansa clip, rhythmbox gives "not enough space on the device" error. The flac files would be transcoded into mp3, so they would take much less space, and they would actually fit in the device. So, if I disable the sync_has_enough_space in rb-media-player-source.c, the transfer files will transfer just fine. So, it seems that the sync_has_enough_space calculation might be done based on the size of the non-transcoded files instead of the estimated size of the mp3 files. Even if there would not be enough space on the device to sync all the files, I think it should be possible to sync as many files as possible. So, I made the following small patch to get around this problem. I don't have much experience writing C, so the quality of the code might be far from perfect, but it works for me personally: (sources got in ubuntu 10.10 by apt-get -b source rhythmbox) sjs@zen:[~/tmp] $ diff a/rhythmbox-0.13.1/sources/rb-media-player-source.c b/rhythmbox-0.13.1/sources/rb-media-player-source.c 64a65 > GtkWidget *sync_dialog_continue_button; 582a584 > gboolean enough_space = TRUE; 589c591,596 < can_continue = FALSE; --- > can_continue = TRUE; > enough_space = FALSE; > gtk_button_set_label(priv->sync_dialog_continue_button, > _("Sync anyway") > ); > 592a600,602 > gtk_button_set_label(priv->sync_dialog_continue_button, > _("Sync with the device") > ); 596c606 < gtk_widget_set_visible (priv->sync_dialog_error_box, !can_continue); --- > gtk_widget_set_visible (priv->sync_dialog_error_box, !(can_continue && enough_space) ); 647,650d656 < _("Sync with the device"), < GTK_RESPONSE_YES, < _("Don't sync"), < GTK_RESPONSE_CANCEL, 652a659,667 > > priv->sync_dialog_continue_button = > gtk_dialog_add_button(priv->sync_dialog, _("Sync with the device"), > GTK_RESPONSE_YES > ); > > gtk_dialog_add_button(priv->sync_dialog, > _("Don't sync"), > GTK_RESPONSE_CANCEL); My sansa clip actually can handle flac, although I would prefer to use lower bitrate format (mp3/ogg). So I needed to also hack rb-removable-media-source.c to force transcoding of flac to mp3: diff a/rhythmbox-0.13.1/sources/rb-media-player-source.c b/rhythmbox-0.13.1/sources/rb-media-player-source.c 64a65 > GtkWidget *sync_dialog_continue_button; 582a584 > gboolean enough_space = TRUE; 589c591,596 < can_continue = FALSE; --- > can_continue = TRUE; > enough_space = FALSE; > gtk_button_set_label(priv->sync_dialog_continue_button, > _("Sync anyway") > ); > 592a600,602 > gtk_button_set_label(priv->sync_dialog_continue_button, > _("Sync with the device") > ); 596c606 < gtk_widget_set_visible (priv->sync_dialog_error_box, !can_continue); --- > gtk_widget_set_visible (priv->sync_dialog_error_box, !(can_continue && enough_space) ); 647,650d656 < _("Sync with the device"), < GTK_RESPONSE_YES, < _("Don't sync"), < GTK_RESPONSE_CANCEL, 652a659,667 > > priv->sync_dialog_continue_button = > gtk_dialog_add_button(priv->sync_dialog, _("Sync with the device"), > GTK_RESPONSE_YES > ); > > gtk_dialog_add_button(priv->sync_dialog, > _("Don't sync"), > GTK_RESPONSE_CANCEL);
Created attachment 172468 [details] [review] the has_enough_space -patch
Please use 'diff -u' to generate patches. Other diff formats are harder to read and don't work with the patch review tool.
Created attachment 172470 [details] [review] diff -ur style patch
Review of attachment 172470 [details] [review]: ::: rhythmbox-0.13.1/sources/rb-media-player-source.c @@ +582,3 @@ RBMediaPlayerSourcePrivate *priv = MEDIA_PLAYER_SOURCE_GET_PRIVATE (source); gboolean can_continue; + gboolean enough_space = TRUE; probably better to call this 'show_error' and use it to control whether the error box is shown, rather than deriving that from the combination of other conditions. @@ +592,3 @@ + enough_space = FALSE; + gtk_button_set_label(priv->sync_dialog_continue_button, + _("Sync anyway") I'm not sure we need a different label for the button in this case. What does this communicate that "sync with the device" doesn't? @@ +600,3 @@ + gtk_button_set_label(priv->sync_dialog_continue_button, + _("Sync with the device") + ); set tab size/shift width to 8, please
*** Bug 633143 has been marked as a duplicate of this bug. ***
*** Bug 646767 has been marked as a duplicate of this bug. ***
Created attachment 273600 [details] [review] Make the sync button appear even when there's not enough space Patch against master (commit 1266990), based on sjs's one, including Jonathan's remarks.
This bug has been an immense PAIN. Is there a way to know what version of Rhythmbox will carry the fix? Thanks for fixing it, finally looking forward to the relief of pressing on a working sync-button soon.
You can apply the patch to the version you're running any time you like.
Review of attachment 273600 [details] [review]: pushed as commit 26d0551; thanks for taking the time to update this