| View previous topic :: View next topic |
| Author |
Message |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Sat Apr 28, 2012 7:19 pm Post subject: Can't stop device because a program is still using it |
|
|
Hello,
I have been away for a while and came back to see that Henry is still updating WiRNS 2.1, so I was wondering if a small problem I am having can be looked at...
I have a portable USB hard drive that I use to archive TV shows from the Replay. I normally have this drive disconnected from my laptop, but will connected it and go to "Configuration -> WiRNS Show Paths" and put a check mark next to the folder that has the shows on the external drive when I need to access them or save new ones.
This all works fine (although it takes a while to load all the show info, since I have hundreds of shows).
Anyway, the problem comes when I am trying to unmount the drive.
I go to "Configuration -> WiRNS Show Paths" and uncheck the path and press "Save". I then go to the "Safely Remove Hardware" icon and tell it to "Safely Remove Hardware" to properly unmount the hard drive. This is when it gives me the error "Can't stop device because a program is still using it".
I currently use "WiRNSMon->Restart" to free up my external drive so that it can be safely unmounted. So, I was wondering if a fix could be made so that WiRNS completely frees up a drive once the path is unchecked so that I do not have to restart WiRNS every time.
Thanks for your time! |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Sat Apr 28, 2012 9:53 pm Post subject: |
|
|
First, I am not really updating WiRNS 2, it just so happens that every once in awhile I test a fix in WiRNS 2 before I put it into WiRNS 3 so it doen't hurt as large of a population. As far as new fixes and features, they are going into WiRNS 3 only...
Second, WiRNS doesn't "use" the paths that aren't enabled, but it could be that maybe .Net is keeping them open for some reason. I'm not sure how restarting WiRNS frees up the drive access, but maybe Glenn would know something more about how to get WiRNS to completely quit using them...
Quite honestly, I'm not sure what it would hurt for you to just unplug the USB hard drive after attempting to unmount it. If you're not accessing it at the time, then it's unlikely that there's any unflushed data to lose. So, I would just unplug it anyways and see how that works out...
FYI, just looking at the code, the only thing that stands out at me at first glance is the automatic guide refresh mechanism. If you want to see if it makes a difference, when you go into WiRNS Show Paths, in addition to unchecking the path enable, also uncheck "Automatic Guide Refresh" and save it that way and see if then you are able to unmount the drive.
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
The Robman Moderator

Joined: 27 Apr 2004 Posts: 51
|
Posted: Sun Apr 29, 2012 7:33 am Post subject: |
|
|
It might be totally unrelated to WiRNS also, I was transferring files between computers yesterday using an external drive and even after I'd closed every program on the computer it still wouldn't release it. _________________ Later, Rob
http://www.hifi-remote.com |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Mon Apr 30, 2012 4:54 pm Post subject: |
|
|
| hdonzis wrote: | ...
FYI, just looking at the code, the only thing that stands out at me at first glance is the automatic guide refresh mechanism. If you want to see if it makes a difference, when you go into WiRNS Show Paths, in addition to unchecking the path enable, also uncheck "Automatic Guide Refresh" and save it that way and see if then you are able to unmount the drive.
Henry | That did the trick! Unchecking "Automatic guide refresh" allows me to unmount the drive wihtout having to restart WiRNS!
Thanks Henry!
Does this mean that WiRNS is not removing disabled paths from the automatic refresh list? |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Mon Apr 30, 2012 6:02 pm Post subject: |
|
|
| Space wrote: | | Does this mean that WiRNS is not removing disabled paths from the automatic refresh list? |
It is, but they were getting lost. Turning it off made them all get removed from the list. Try turning it back on and see if it's any better...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Sun May 06, 2012 8:45 pm Post subject: |
|
|
I turned it back on with the external mounted, and then unchecked that path in WiRNS, and it would not let me safely unmount the drive.
I then unchecked "automatic guide refresh" (apply) and it still would not let me unmount it.
I then rechecked "enabled" next to the path (apply) and unchecked it (apply) and still would not let me unmount.
I had to restart WiRNS to allow it to unmount.
After restart, I was able to mount and unmount without a problem (I suppose because I never turned on "automatic guide refresh" while the path was mounted since the restart.)
So it appears that if I have "automatic guide refresh" enabled at the same time as I have a path that is on the external drive enabled, it will not let me unmount the drive unless I restart WiRNS. |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Sun May 06, 2012 9:27 pm Post subject: |
|
|
It loses the watched paths if you ever update the show paths without unchecking the "Automatic Guide Refresh" first, so you have to be careful the order you do things in. If you have the external mounted path enabled and you click Save without unchecking "Automatic Guide Refresh" first, then the external mounted path watcher is going to get lost. So, you'd have to first turn on "Automatic Guide Refresh" and then enable the external mounted path, and then turn off "Automatic Guide Refresh" and then disable the external mounted path...
What version of ServerManagement.dll are you running?
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Sun May 06, 2012 9:35 pm Post subject: |
|
|
| hdonzis wrote: | ...
What version of ServerManagement.dll are you running?
... | 2.1.4475.26644 |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Sun May 06, 2012 9:48 pm Post subject: |
|
|
| Space wrote: | | hdonzis wrote: | ...
What version of ServerManagement.dll are you running?
... | 2.1.4475.26644 |
Well, then maybe there's something else going on. I was just guessing in the first place. You can try playing with my order of changing things and see if that works reliably or not. Maybe there's something else going on. If you can figure out what it is, like that you enable the path and then you download a show and then you disable automatic refresh and disable the path, that it still can't unmount, then maybe I can figure out what the problem is...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Sun May 06, 2012 10:45 pm Post subject: |
|
|
OK, well all the testing I do is without accessing any shows on the external drive, so that is not a factor. I am just plugging in the USB cable, then putting a check mark in the "enabled" column for the corresponding path and pressing "save".
I then uncheck it and press "save" again.
I then select the "Safely remove drive" option from the "Safely remove hardware" icon in the system tray
If I do this with "automatic guide refresh" unchecked, all works fine, the drive is unmounted.
If I do it with that option enabled, it is unable to unmount it.
If I enable and disable both options (the path and the autorefresh) at the same time, then it appears to also work fine.
So as long as I disable the autorefresh whenever I disable the external drive path, it appears that it works.
However this does not work:
- Enable autorefresh (save).
- Enable external path (save).
- Disable external path (save).
- Disable autorefresh (save).
At this point you are not able to unmount the drive safely without restarting WiRNS. It seems that nothing I attempt (other than restart) after it gets in to this state will allow the drive to be released. There is probably a file pointer left open that should not be when you disable autorefresh while having a disabled path that was previously enabled (and was being monitored).
Here is one more test:
- Enable autorefresh (save).
- Enable external path (save).
- Disable autorefresh (save). (these two last steps reversed from previous test)
- Disable external path (save).
This works, the drive can be safely unmounted. |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Mon May 07, 2012 6:34 am Post subject: |
|
|
| Space wrote: | | OK, well all the testing I do is without accessing any shows on the external drive, so that is not a factor. I am just plugging in the USB cable, then putting a check mark in the "enabled" column for the corresponding path and pressing "save". |
Then, what is the purpose of connecting the external drive? I was asking you to perform "life like" operations to see if there's something else in WiRNS going on...
| Space wrote: | However this does not work:
- Enable autorefresh (save).
- Enable external path (save).
- Disable external path (save).
- Disable autorefresh (save).
At this point you are not able to unmount the drive safely without restarting WiRNS. It seems that nothing I attempt (other than restart) after it gets in to this state will allow the drive to be released. There is probably a file pointer left open that should not be when you disable autorefresh while having a disabled path that was previously enabled (and was being monitored).
Here is one more test:
- Enable autorefresh (save).
- Enable external path (save).
- Disable autorefresh (save). (these two last steps reversed from previous test)
- Disable external path (save).
This works, the drive can be safely unmounted. |
Maybe you didn't read my instructions very well because that's exactly what I said would happen...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Mon May 07, 2012 12:31 pm Post subject: |
|
|
Those were life-like operations with regards to actual WiRNS activity. I was using it to get a consolidated list of all my shows (I do an SQL query (sorted by show name, then show start time) while all shows from the Replays, external and internal drives are in the Replay Guide).
I then have a single complete saved list of all shows/episodes that I have on all Replays, the internal drive, and the external drive, without having to hook up the external drive every time I want to look at this complete list.
Since I may record a season of episodes on multiple Replays, and may have some stored on the external or internal drive (or any of the three other Replays), this helps immensely by having a nice ordered list of all the episodes in one place to act as an index to where to find them.
Here is the query in case anyone is interested (use sqlite3 to run it) | Code: | SELECT R2.name,R1.recordtime,R1.duration,R1.program,R1.episode,R1.description
FROM replayguide R1,replays R2
WHERE R1.serialnumber=R2.serialnumber
ORDER BY R1.program,R1.startTimeGMT; |
| Code: | | \WiRNS\sqlite3.exe -header \WiRNS\wirns.db < \WiRNS\consolidated-replayguide.sql > \WiRNS\consolidated-replayguide.txt | I also have a .css and and some javascript to make it create this report in the background as an html file after each update for easy viewing in a web browser.
As for the testing I did, I thought you were still trying to figure out what was going on, because you said "Well, then maybe there's something else going on." (twice, in fact), and also "then maybe I can figure out what the problem is... ". It was not clear to me that you understood why this was happening, so I was trying to test different scenarios to help.
Anyway, if you don't feel like fixing this problem, no big deal, I don't really use the auto guide refresh anyway, so I can just leave it disabled. |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Mon May 07, 2012 12:44 pm Post subject: |
|
|
| Space wrote: | As for the testing I did, I thought you were still trying to figure out what was going on, because you said "Well, then maybe there's something else going on." (twice, in fact), and also "then maybe I can figure out what the problem is... ". It was not clear to me that you understood why this was happening, so I was trying to test different scenarios to help.
Anyway, if you don't feel like fixing this problem, no big deal, I don't really use the auto guide refresh anyway, so I can just leave it disabled. |
You said you did things is a certain order that sounded contrary to how I said it should work, so I thought maybe something else was going on. In the last set of experiments you posted, it worked exactly as I said. So, it's hard for me to tell if I understand the problem or not because in the last case it worked exactly as I expected, but what you posted before that didn't follow how I thought it would work...
I thought I had fixed it, but you said it was still broken. If it was the auto refresh causing the problem, then it should have been fixed. So, that implied that wasn't really the root of the problem. However, you can see if it is any better with the latest update...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Mon May 07, 2012 3:16 pm Post subject: |
|
|
Oh! You posted an update before? I didn't realize that. I did not test any updates. The DLL version I posted was not an updated version was it?
That is probably where our misunderstanding was.
I just updated now (to 2.1.4509.42716) and it seems to be fixed, so thanks! |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Mon May 07, 2012 7:33 pm Post subject: |
|
|
The DLL version you were using before matched my version, so I thought that meant you had the "fixed" version and it still wasn't working correctly. It's possible that I didn't have the updated version either, so maybe it was my mistake. Since I fixed the problem of the order of doing things, when you said it didn't work, then I assumed the problem must be deeper, which is why I asked what else you were doing...
I thought you used automatic updates on WiRNS, so I thought if my first fix had been correct, then you would have noticed that pretty quickly. I guess you can look at the previous version in your backup directory and see what the date is. If it's around then end of April, then it should have been my first attempt at fixing the problem...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Mon May 07, 2012 9:46 pm Post subject: |
|
|
The previous version had a file date of April 2nd, so it was not the new one.
I wasn't updating for a long time because I didn't think any changes were being made to the 2.1 version, plus I have been very busy working on other things lately, so didn't want to have to spend time dealing with any issues that might occur after an update, because when I finally did update (it was the update that changed the ToDo icons) it totally screwed my ToDo list icons until I realized I had to un-check "Enable Custom ToDo Graphics" in the settings. So now that I am thinking about it, you may want to see why having that item checked causes issues (although I don't know why it was checked in the first place).
Anyway, thanks again! |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Mon May 07, 2012 9:55 pm Post subject: |
|
|
| Space wrote: | | The previous version had a file date of April 2nd, so it was not the new one. |
Ah! Well, I guess I didn't update my system either, then, probably because it was an experiment. I just assumed you had done an automatic update, and since your version matched mine, I assumed it was the experimental version. When it didn't work, then I thought I was on the wrong track...
So, glad that took care of it!
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Mon May 07, 2012 10:02 pm Post subject: |
|
|
| Space wrote: | | because when I finally did update (it was the update that changed the ToDo icons) it totally screwed my ToDo list icons until I realized I had to un-check "Enable Custom ToDo Graphics" in the settings. So now that I am thinking about it, you may want to see why having that item checked causes issues (although I don't know why it was checked in the first place). |
Hmmm... I doubt I will bother with that. That is a perfect example of my using WiRNS 2 as an experiment when Glenn and I were working on the new icons. I knew it would harm the least amount of people for us to use WiRNS 2 to experiment with that (especially since it was a very big change). In the end the feature got added to WiRNS 3 and I never bothered to finish WiRNS 2. As long as you continue to use WiRNS 2, you will end up running experimental code that I am using to test things so as to not harm the population at large...
And, new features, like the stop downloads feature, for example, are only going into WiRNS 3 if I don't have to experiment first. So, WiRNS 3 will always be finshed code, whereas WiRNS 2 will be experimental code...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Wed May 09, 2012 2:26 pm Post subject: |
|
|
| Space wrote: | | I wasn't updating for a long time because I didn't think any changes were being made to the 2.1 version, plus I have been very busy working on other things lately, so didn't want to have to spend time dealing with any issues that might occur after an update, because when I finally did update (it was the update that changed the ToDo icons) it totally screwed my ToDo list icons until I realized I had to un-check "Enable Custom ToDo Graphics" in the settings. So now that I am thinking about it, you may want to see why having that item checked causes issues (although I don't know why it was checked in the first place). |
Well, turned out this was a problem for all of the versions of WiRNS, so I have fixed it...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Wed May 09, 2012 2:55 pm Post subject: |
|
|
| hdonzis wrote: | | Well, turned out this was a problem for all of the versions of WiRNS, so I have fixed it... | Now I remember why I had this option checked in the first place. I had changed the green "Already Recorded" strike-through icon to a lighter shade.
Is it possible to also have the associated text take on this new color? Currently, if you change the color, only the icon color changes, not the text color (using the above as an example, the text for "Already Recorded" shows on the ToDo list remains the same default green color, as does the legend at the top).
Also, how many versions or WiRNS are there, more than two??
Thanks. |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Wed May 09, 2012 3:02 pm Post subject: |
|
|
| Space wrote: | | Is it possible to also have the associated text take on this new color? Currently, if you change the color, only the icon color changes, not the text color (using the above as an example, the text for "Already Recorded" shows on the ToDo list remains the same default green color, as does the legend at the top). |
When I tried it, the text changed as well. Maybe you can't tell because it's only a slight shade change...
Actually, I just checked again, and in the cases where the text is the color of the strike through, the text color changes regardless of the enable check box being checked...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
Space Replay elitist

Joined: 18 Nov 2010 Posts: 479
|
Posted: Wed May 09, 2012 4:13 pm Post subject: |
|
|
Hmmm, that was not my experience; the colors were significantly different shades, but I just pressed the "default colors" button and applied that, and then re-set my custom color and it seems to be working now.
It looks like if you enable custom, and change the color, apply. Then disable custom, it only disables the custom color for the icon, the text remains using the custom color.
Here you can see an example with two shades of green (I was wrong before about the change I made, I actually made it a DARKER shade of green from the default green):
So I was a little confused with my explanation before. It looks like if you have the custom option checked, it uses all the right colors. But if you have it unchecked, after having used a custom color previously, it will have the default color for the icon, but the text will still be using the custom color.
Also, to make it a little more confusing, after you make a change (such as unchecking the custom colors option) the page refresh does not show the change in colors properly, if you then reselect Configuration->WiRNS Styles it will then show the real colors it will use in the ToDo. |
|
| Back to top |
|
 |
hdonzis Moderator

Joined: 05 Jan 2005 Posts: 7830 Location: San Antonio, TX
|
Posted: Wed May 09, 2012 9:15 pm Post subject: |
|
|
| Space wrote: | | It looks like if you enable custom, and change the color, apply. Then disable custom, it only disables the custom color for the icon, the text remains using the custom color. |
I posted:
| hdonzis wrote: | | Actually, I just checked again, and in the cases where the text is the color of the strike through, the text color changes regardless of the enable check box being checked... |
So, I don't know why you're explaining that you see what I said that you'd see...
I don't really see the point in that small nusiance. If you are going to change the settings, then you should check the check box. If you don't check the check box, then don't change the settings. I'm not going to go through the code fixing every place to look for the check mark when all it does is change the color that you selected in the first place. After all, it is doing exactly what it says, namely "Enable Custom ToDo Graphics" is only enabling the graphics, it doesn't say anything about the text...
| Space wrote: | | Also, to make it a little more confusing, after you make a change (such as unchecking the custom colors option) the page refresh does not show the change in colors properly, if you then reselect Configuration->WiRNS Styles it will then show the real colors it will use in the ToDo. |
That's not my experience at all. In my case the automatic page refresh after pressing UPDATE results in the real colors it will use, the same as reselecting the page from the menu. Must be something wrong with your browser...
Henry _________________ Here's my Poop |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|