Bugzilla – Bug 15741
media ejection SD and USB unreliable
Last modified: 2011-05-17 16:32:04 UTC
fw 8524 When ejecting the SD card I get one of two messages. 1. Ejecting SD card followed by "device ejected it is now safe to remove your card". This is normal and a good result. 2.I get a short almost unnoticeable flash of the (Ejecting SD card) message message followed by, Connecting to player name (SD card) this results in a second message "there is a problem connecting to mysqueezebox.com, with options to Try again, Switch library, go home Selecting try again repeats the same result. Select go home and then try to eject the SD card again gives no result. You are stuck unable to eject the card safely except by powering down the system. I have also seen the same problem with the USB, but have mostly exercised the SD card. I have had this problem repeat up to four times 4 time in a row and also had it work successfully 5,6 or more times before messing up again. I have tried various combination's of playing music from the SD card or internet radio or services before ejecting the SD card to see if something would cause it to repeat consistently. This seemed to be working better before the last update
*** Bug 15742 has been marked as a duplicate of this bug. ***
Chris to run his test cases and add or replace this bug.
It seems uncommon to see this problem with a USB drive, from my testing. However the remaining bugs still exists with the SD card. Basically, ejecting the SD card doesn't work 1/3 of the time. My steps to reproduce: 1) Start from a reboot (power off/on, or reset button) 2) Put in an SD card with some music files 3) Watch the 'Starting Squeezebox Server' fullscreen spinny 4) Press 'Squeezebox Server Status' 5) Wait until 'Discovering Files: Complete' is shown 6) Hold down the back arrow in the upper left to return to the home menu 7) Click 'My Music' and browse to some music, play it. 8) Hold down the back arrow in the upper left to return to the home menu 9) Press Eject SD Card 10) "Connecting to... Mysqueezebox.com (fullscreen spinny)" 11) "There is a problem connecting to mysqueezebox.com Try Again -> Switch Library-> Go home->" 12) After this, all further attempts to 'Eject SD Card' will fail. Going to the Eject SD card menu, you get options for 'Cancel ->' and 'Eject SD Card ->'. Eject SD card beeps and highlights briefly, but stays on that screen. This happened to me 2 times out of 6 attempts. I know Ben said we can never be perfect at this, but 1/3 of the time is not good, and the failure mode is also ugly (impossible to eject SD card) Felix, is this something you could look at?
Michael - What is the reason that TinySC is stopped in case an SD card but not when an USB drive is ejected? SqueezeCenter.lua - _unmountAction() if item.SCDrive then self:_stopServer(silent) else log:debug('This is not the SCDrive, so ') end
item.SCDrive shouldn't be limited to either of these, but should hold whatever drive is being used. Or do I not understand the question?
Yeah, sorry, never mind, I've somehow read SDDrive. But I guess this check is to distinguish between a drive used for SC or something else like image viewer.
It looks like sometimes when TinySC is stopped via ejecting SD card / USB drive a (re-)connection spinny comes up and kills the ejection spinny preventing the eject process to finish properly. Making sure the ejection spinny cannot be interrupted and let it finish either when the SD card / USB drive is successfully ejected or a timeout has occured, fixes the issue reported.
Created attachment 6660 [details] Proposed patch to prevent eject spinny from being killed
Michael, since you're already cc'ed on the bug, could you review Felix's change? I would like to commit it sooner rather than later for maximal testing. Thanks!
I think this is fine - though I'm no expert in that field at all...
that patch is fine, presuming of course that the popup will timeout in a reasonable amount of time on failure. I did exactly the same code change for the "attaching" spinny, and also brought the attach timeout from 30 to 20 seconds so a failure wouldn't take as long.
The unmount timeout is currently set to 10 seconds.
== Auto-comment from SVN commit #8657 to the jive repo by fmueller == == https://svn.slimdevices.com/jive?view=revision&revision=8657 == Bug: 15741 Description: Make sure eject spinny cannot be terminated before it has done its task.
Thanks everyone!
Fw 8660 There is still a problem here I have received a problem disconnecting SD card message 1 out of 4 times. However; I have on one occasion received the “It is now safe to remove your SD card” message just after receiving the first problem message. It is better than it was. It does eventually un-mount. Just sometimes it takes an extra attempt. Since bug 15742 was made a duplicate of this one, I will report I am still having difficulty when the SD card is installed as well. When you go to play music from it I keep getting messages to switch library. The way I have been most successful has been to install the SD check the Squeezebox server status then wait an additional minute before attempting to play any music files. Even then when I get to where I see the album and select it the display jumps to a switch library prompt.
Alan - any idea what Ryan might be seeing here when he reports that he was repeatedly getting the 'switch library' message? (Second paragraph of comment 15)
I think that the problem is that, after completing the initial scan, TinySC sets up the mechanism that watches for changes to the library filesystem. Although this runs in other threads, I think that it hits the filesystem so hard that TinySC stops responding (just does not get enough CPU cycles) and so Squeezeplay times out the connection and offers Switch Library as the only option in My Music while it is trying to re-establish a connection. I find that simply waiting a little logger is sufficient. This is only a theory based on a variety of observations and I do not have specific, causal evidence.
Chris to review Ryan's remaining symptom and target the remaining work, if any.
Fw 8665 Ejecting SD card media has worked correctly for on the first try for 6 times in a row. Installing SD card not so good, if the library path is unchanged it does okay. If you were accessing TinySC on the SD card then ejected it. Then insert the SD card again. It finds it okay. But if you have to switch from another library or MSB.com to access Tiny SC . Then you MAY run into the repetitive switch library prompt as mentioned in comment 15 paragraph 2. Once the SD card has been successfully selected switching between libraries performs okay as long at they are available and you do not eject and reinstall the SD card. In general this is working much better than it was.
Chris to re-evaluate after SD UI changes
I recently had an issue with USB connectivity. My Touch had been left powered for a couple of days with a USB HDD attached. My Touch is used standalone, with no server/PC based slimserver running. On checking the Touch today, I found that it wasn't running TinySS and that it would not eject the connection to my USB HDD. I did try rebooting the Touch and also powering up SS on my PC. These did not resolve the issue. I then rebooted my USB HDD (power on and off), at which point the Touch gave me the usual warning message, rebooted TinySS and worked fine.
Hi Mike, That seems outside the scope of 'media ejection unreliable'. Could I trouble you to file a new bug? Thanks!
== Auto-comment from SVN commit #9301 to the jive repo by fmueller == == http://svn.slimdevices.com/jive?view=revision&revision=9301 == Bug: 15741 Description: Fix media eject (SD and USB) by allowing iterator to finish - this closes the directory actively.
== Auto-comment from SVN commit #9359 to the jive repo by fmueller == == http://svn.slimdevices.com/jive?view=revision&revision=9359 == Bug: 15741 Description: Automatically hide eject success window when SD card / USB device is removed.
Ben reports that the behavior is much better and my own additional test showed the same.
Ejection of USB and SD cards is working now --7.6.0.32427