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 632266 - "not enough space on the device" error when syncing (transcoding) flac files to removable device
"not enough space on the device" error when syncing (transcoding) flac files ...
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Removable Media
0.13.x
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 633143 646767 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-10-15 23:44 UTC by sjs@kulma.net
Modified: 2014-04-28 22:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the has_enough_space -patch (3.50 KB, patch)
2010-10-15 23:54 UTC, sjs@kulma.net
none Details | Review
diff -ur style patch (2.36 KB, patch)
2010-10-16 00:03 UTC, sjs@kulma.net
needs-work Details | Review
Make the sync button appear even when there's not enough space (1.80 KB, patch)
2014-04-04 18:03 UTC, Marc Plano-Lesay
committed Details | Review

Description sjs@kulma.net 2010-10-15 23:44:39 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);
Comment 1 sjs@kulma.net 2010-10-15 23:54:24 UTC
Created attachment 172468 [details] [review]
the has_enough_space -patch
Comment 2 Jonathan Matthew 2010-10-15 23:58:12 UTC
Please use 'diff -u' to generate patches.  Other diff formats are harder to read and don't work with the patch review tool.
Comment 3 sjs@kulma.net 2010-10-16 00:03:49 UTC
Created attachment 172470 [details] [review]
diff -ur  style patch
Comment 4 Jonathan Matthew 2010-10-16 00:34:22 UTC
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
Comment 5 Jonathan Matthew 2010-10-25 22:23:16 UTC
*** Bug 633143 has been marked as a duplicate of this bug. ***
Comment 6 Jonathan Matthew 2011-04-05 01:35:52 UTC
*** Bug 646767 has been marked as a duplicate of this bug. ***
Comment 7 Marc Plano-Lesay 2014-04-04 18:03:00 UTC
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.
Comment 8 Robert Martinez 2014-04-17 11:47:23 UTC
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.
Comment 9 Jonathan Matthew 2014-04-28 22:24:26 UTC
You can apply the patch to the version you're running any time you like.
Comment 10 Jonathan Matthew 2014-04-28 22:56:39 UTC
Review of attachment 273600 [details] [review]:

pushed as commit 26d0551; thanks for taking the time to update this