[fixed] [JIRA MP1-2469] - DetectDrive method obsolete ? (2 Viewers)

Deda

Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Ok, pushed fixes for not disappearing drive from drive list after eject and "Eject successful" message when drive is in use.
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Actually, this all is not easy as it is impossible to detect if USB device is one piece of hardware with media (like USB thumbs, HDDs) or does it supports inserting/removing media (like card readers) so now there is two EJECT methods, one is old MP one (EJECT DEVICE) for all "One piece USB device" like HDDs or Thumbs, and second (EJECT MEDIA) for devices like card readers.

    Does it will work for all living USB hardware devices with right EJECT method, don't have a clue. I tried with what I have successfully.

    Anyway, both EJECT functions do what they need to do, but EJECT MEDIA on devices like USB HDDs puts HDD to standby but it is still available if user access it.
    So, if MP device detection method do not recognize some strange "One piece device" it will be ejected with EJECT MEDIA and put to sleep and will be visible in drive list until it is unplugged from USB port, or can be accessed again if user needs to.
     
    Last edited:

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    Anyway, both EJECT functions do what they need to do, but EJECT MEDIA on devices like USB HDDs puts HDD to standby but it is still available if user access it.
    So, if MP device detection method do not recognize some strange "One piece device" it will be ejected with EJECT MEDIA and put to sleep and will be visible in drive list until it is unplugged from USB port, or can be accessed again if user needs to.
    So sleep mode, we can unplug the device, without destroy the device ?

    Now, i need to re-test your last commit, and as always back here, for write few comments ( for changing ! )
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    YEAAAAAAHHHHHHHHHHHH Deda,
    seems working really fine.

    i have tested lot of your change.
    - Eject Media removable : Working fine, Card reader is always detected, and only Media Flash is removed.
    - USB HDD is ejected correctly, not only sleeped.
    - Dialog show the good text when device is in use and can't eject it.
    - Optical Drive eject fine the media.
    - Virtual Drive (tested with Virtual Clone CD) eject the media.

    1 or 2 thing ( as i have say before ), but is not related to you
    - it's missing the eject function for Optical drive, MyPicture Plugin. ( this is very needed )
    - Add the Close tray function for Optical Drive ( not Virtual drive ) ( this is very NOT needed, if hard to do )

    Thanks a lot Deda ( yet )

    i hope to have tested eveything !

    SO FOR ME READY FOR 1.6
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    Oh , too late for 1.6 pre,for this i'm agree
    But you think it's also too late for 1.6 final ?
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    - it's missing the eject function for Optical drive, MyPicture Plugin. ( this is very needed )

    Ok, added and pushed in branch

    - Add the Close tray function for Optical Drive ( not Virtual drive ) ( this is very NOT needed, if hard to do )

    I will check that now, close drive command is not a problem, but detection of open tray door.
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    OK, pushed test version for Load media for CD/DVD/BD devices (I can't fully test LOAD because I have laptop CD/DVD which must be loaded by pushing inside manually :))

    Note:
    As there is no existing NET method to detect Opened/Closed CD/DVD tray but only using raw SCSI commands (which leads to security problems bla bla...) and not to complicate this to spaghetti code and exceptions, I went to easy way which work like this (what will be in F9 menu):

    1. Media is inside device,tray is closed
    * Eject

    2. Media is not inside, tray is closed
    *Load
    *Eject

    3. Tray is opened, media is irrelevant
    *Load
    *Eject

    This is because we have two variables:
    X->Tray status (we don't know that)
    Y->Loaded media status (we know that)

    So only clear state we can show in F9 menu is when media is loaded (EJECT)

    So I think, for users this will not be ambiguous, if user puts media in tray I hope it will use LOAD :),
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom

    Users who are viewing this thread

    Top Bottom