GNOME Bugzilla – Bug 520370
"resource busy" and "state change failed": two error dialogs
Last modified: 2021-05-17 15:59:54 UTC
I played a CD successfully today, but after ejecting it and trying another (or even the same one), I get two pop-ups: - Error playing CD. Reason: Resource busy or not available. ... followed by: - Error playing CD. Reason: Internal GStreamer error: state change failed. Please file a bug.... I use Ubuntu Gutsy Gibbon. Gnome 2.20.1 GStreamer 2.20.1
I've got a workaround: hit 'eject'. It looks like if I just remove the CD without explicitly hitting 'eject' in Sound Juicer then this problem happens. So this may not be a GStreamer problem.
The first error tells you what's happening: the sound card is in use by another application (this shouldn't really happen if your sound output is configured correctly to use either alsa dmix or pulseaudio - check your Movie/Music settings in System => Preferences => Sound). Now, you shouldn't really get a second error dialog here (even less so with the generic error message). This is a bug in sound-juicer though (well, two bugs, actually).
Created attachment 107052 [details] [review] proposed fix This fixes two problems: - in cb_error() the playback pipeline should be set to NULL state after the first error message has been processed. This makes sure that any other (more generic) error messages on the pipeline's bus are flushed. This fixes the problem with the generic error message showing up as second error dialog (now there are still two error dialogs, but both show the first error message). - select_track() should return FALSE if the state change to PAUSED fails. This makes sure that the caller does not call play() again, which causes the second error dialog. The patch also fixes a problem with the seek code here (the state change to PAUSED will be done async, and you can only seek in paused or playing state, so in most cases the _seek will fail here; I've also converted the code to use _seek_simple() instead, for which you'd need to bump the requirements to GStreamer 0.10.7).
I have committed this now (without the gst_element_seek_simple()), but on further testing there still seems to be a case where this is triggered, so leaving the bug open for further investigation.
-- 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/sound-juicer/-/issues/84.