Skip to content

MMC commands stall for a long time on MT1959-based drive. #54

Description

@NeonMan

Description

Calling mmc_get_configuration on my MT1959-based drive (Slim drive, over USB with OmniDrive firmware) stalls for a very long time (way above timeout) on each call, it eventually returns successfuly. straceshows it stalling during an IOCTL query. A sample program to reproduce is provided.

Tested on:

  • OpenSUSE 15.6 / 16.0
  • libcdio (master) / libcdio (OS package)
  • Drive: HL-DT-ST BD-RE BU40N 1.00

How to Reproduce

Run the program below, change the BD_SG_PATH with the corresponding path to the drive sgX device.

#include <cdio/cdio.h>
#include <cdio/mmc.h>
#include <cdio/mmc_cmds.h>
#include <cdio/logging.h>

#include <stdio.h>
#include <assert.h>

#define BD_SG_PATH "/dev/sg7"
#define CDIO_MMC_FEATURE_BD_READ 0x0022

int main(){
  uint8_t buf[64];
  cdio_loglevel_default = 0;
  CdIo_t *p_cdio = cdio_open_am(BD_SG_PATH, DRIVER_DEVICE, "MMC_RDWR");
  assert(p_cdio);

  //HW info
  {
    uint8_t buffer[256];
    puts("--- Program WILL stall when running the next line ---");
    driver_return_code_t driver_return = mmc_get_configuration(p_cdio, buffer, sizeof(buffer), 1, CDIO_MMC_FEATURE_BD_READ, 5000);
  }
  cdio_destroy(p_cdio);
  return 0;
}

Build with cc -lcdio bugsample.c

Output Given

Does not apply

Expected behavior

The response to mmc_get_configuration on all my other drives is immediate.

Workarounds

I am using libsgutils2 to send MMC commands as an alternative, project has cdio and libsg code paths.

Priority

I presume this bug makes using all these drives near unusable with libcdio.

Additional Context

I can code and i try to provide feedback, but I'm pretty new to libcdio internals. MT1959-based drives are pretty popular for exotic media and BluRay.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    volunteer wantedVolunteer wanted to fix if a bug or to implement if a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions