[BUG] No dvd drive present = DRIVE_NOT_READY causing various issues
#1
Currently the dvd detection code treats a media center where there is no DVD Drive as one that has one and is just currently unvaliable.

Once the DRIVE_NOT_READY is returned to CDetectDVDMedia::UpdateDvdrom() it then sends a message:

CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);

which causes it to update all the sources.

This was causing a video slow down but a bit of code was added to ensure that source updates only happened while the library was active was added. This fixed the video slow down.

There are 3 remaining issues with this that I'm aware of. The DVD Polling stuff happens about 2-3 times a second causing sources to update 2-3 times a second.

1. If you have debug logging on your log is constantly spammed with the Update Sources code while the library is active.
2. Some skins have what seems to be certain animation elements which are replayed every time the view is updated do to UPDATE_SOURCES. This is highly annoying.. it looks like a bit of flashing of certain elements is the best way i can describe it.
3. You can not select the Parent Directory "..' element in any view as sources upate causing the view to redraw and putting you on the first element in a directory if you have .. selected.

I am sure those 3 issues are cause by this behavior as if you comment out the lines which send the GUI_MSG_UPDATE_SOURCES (lines 138 and 139 in DetectDVDType.cpp) Then all those problems go away. These lines:

CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);
m_gWindowManager.SendThreadMessage( msg );

I'm not sure exactly why you would want to update sources if the drive is not ready. I can't see any real value in Updating Sources 3 times a second even if there is a drive in the machine that is busy. I don't know if there would be any more implications to not updating while a drive is busy though.

Thoughts?


Also as a side note - the fix I applied above has significantly improved responsiveness of the library mode. I guess since it's not hitting the DB 2-3 times a second.
Reply
#2
First off, it shouldn't be sending any messages at all (in fact shouldn't even be running the detectdvd code past the initial detection) in the case where you don't have a dvd drive.

If there is a dvd drive and it still spams the message (it shouldn't do) then this needs remedying as well. I suspect it won't though - the "not ready" signal I believe implies the drive is opening or closing or we're waiting for media to be read (thus the updating of sources as the drive state has changed).

IMO the problem here, though, is that the same message sent for the DVD drive is also sent by the passworded shares stuff. If these messages were split up, then it wouldn't matter if the dvd stuff was screwing up as that shouldn't affect the library views in any way at all.

For the person looking to fix this, my advice is therefore:

1. Create a new message for the dvd drive updates and check for it where appropriate.
2. Fix the root cause by not running the dvd detection stuff when there's no drive present.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
The DVDDetection is now disabled when no drive is present, it just exits the polling loop. http://forum.xbmc.org/showthread.php?tid=32293
IIRC the other part should be fine as it should be going into the case DRIVE_READY: When the drive's last state == current state.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#4
Topfs2 Wrote:The DVDDetection is now disabled when no drive is present, it just exits the polling loop. http://forum.xbmc.org/showthread.php?tid=32293
IIRC the other part should be fine as it should be going into the case DRIVE_READY: When the drive's last state == current state.


I'll give it a test once I get my media center set back up. I recently had to move and once I get ethernet wired around here I'll set it up and let you know.
Reply
#5
bripeace Wrote:Currently the dvd detection code treats a media center where there is no DVD Drive as one that has one and is just currently unvaliable.

Once the DRIVE_NOT_READY is returned to CDetectDVDMedia::UpdateDvdrom() it then sends a message:

CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);

which causes it to update all the sources.

This was causing a video slow down but a bit of code was added to ensure that source updates only happened while the library was active was added. This fixed the video slow down.

There are 3 remaining issues with this that I'm aware of. The DVD Polling stuff happens about 2-3 times a second causing sources to update 2-3 times a second.

1. If you have debug logging on your log is constantly spammed with the Update Sources code while the library is active.
2. Some skins have what seems to be certain animation elements which are replayed every time the view is updated do to UPDATE_SOURCES. This is highly annoying.. it looks like a bit of flashing of certain elements is the best way i can describe it.
3. You can not select the Parent Directory "..' element in any view as sources upate causing the view to redraw and putting you on the first element in a directory if you have .. selected.

I am sure those 3 issues are cause by this behavior as if you comment out the lines which send the GUI_MSG_UPDATE_SOURCES (lines 138 and 139 in DetectDVDType.cpp) Then all those problems go away. These lines:

CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_SOURCES, 0, NULL);
m_gWindowManager.SendThreadMessage( msg );

I'm not sure exactly why you would want to update sources if the drive is not ready. I can't see any real value in Updating Sources 3 times a second even if there is a drive in the machine that is busy. I don't know if there would be any more implications to not updating while a drive is busy though.

Thoughts?


Also as a side note - the fix I applied above has significantly improved responsiveness of the library mode. I guess since it's not hitting the DB 2-3 times a second.

I am having this problem as well. I am running XBMC on an old xbox and can not find where detectdvd.cpp is! Can someone please help me or otherwise find another work around to disable the dvd drive or dvd drive detection?

Thank you!

-T
Reply
#6
Hi, I have absolutely no idea whether the xbox branch is the same as the linux one with regard to dvd IO. but I had the same problem for linux.

Apparently, the library used by xbmc (libcdio) had a buggy. You have to compile against the very latest version to solve it.
http://www.gnu.org/software/libcdio/

Quoting myself: http://forums.opensuse.org/get-help-here...bmc-2.html
Quote:Finally found the problem.
The problem was with libcdio (stack trace led me to it).

Apparently versions <=0.81.2 hangs when no optical drives are present.

discussion:
Nabble - Mandriva - bugs - [Bug 49636] lxmusic, NEW: Cannot run lxmusic.
commit: Savannah Git Hosting - libcdio.git/commitdiff

So the solution is to use 0.81.3 or higher. Opensuse only provides 0.81.2 but I found 0.82 on libcdio's site.
GNU Compact Disc Input and Control Library (libcdio)

Compiled it and installed it. Requires a reconfigure/recompile of xbmc though. but it works...

ps: I took the effort to register especially for you :-)
Reply
#7
thank you for the post. i'll be honest, i am completely unfamiliar with the linux xbmc haha. Can you tell me where i would find the lines of code you are referring to on an xbox version?
Reply

Logout Mark Read Team Forum Stats Members Help
[BUG] No dvd drive present = DRIVE_NOT_READY causing various issues0