New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediatools/windows backend #24

Closed
JonnyJD opened this Issue Nov 19, 2012 · 20 comments

Comments

Projects
None yet
2 participants
@JonnyJD
Owner

JonnyJD commented Nov 19, 2012

There is already a windows tool to submit ISRCs: http://forums.musicbrainz.org/viewtopic.php?id=1838
and I don't use windows.

However, there are request of getting ISRCs with mediatools because the algorithm will always (?) get correct ISRCs.

Additionally the windows tool still has the same problems with multi-disc releases we had with #16

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Nov 19, 2012

The command line mediatools: http://www.flanagan-family.com/mediatools.zip
There is some information on the forums about mediatools: http://forums.musicbrainz.org/viewtopic.php?pid=9578#p9578

There is also a full isrc submit tool based on mediatools: http://forums.musicbrainz.org/viewtopic.php?id=2116

If the mediatools based isrc submit gui works good, then there is not that much of a need to implement windows support our this isrcsubmit.

@jesus2099

This comment has been minimized.

Contributor

jesus2099 commented Nov 19, 2012

Thanks for this issue Jonny !
As I said, the problems with isrcsubmit.exe are

  • algorithm not as robust as mediatools.exe’s (cf. line #263) → frequent inaccurate CD drives cause duplicate ISRC.
  • cannot submit to multi-disc releases
@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Nov 20, 2012

There are also windows builds of cdrdao at http://www.student.tugraz.at/thomas.plank/

A possibly bigger problem is that there is only a windows build for libdisc-1.1 which itself complains about a missing MSVCR71.dll, which should go with the lib, I think.
A guide to build libdiscid can be found here: http://forums.gcstar.org/viewtopic.php?id=1825

We need to find a way to look up what backend is available. The which approach doesn't work on windows.

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Nov 20, 2012

Like I suspected: In my virtual machine (virtualbox) mediatools drive D isrcs only gives

ISRCS STARTS
ISRC    01
ISRCS ENDS

So I can't test much on my own machine. I have to see if I can get a hold of a real windows machine.

But first I need to get libdiscid to work.

EDIT:
With media_info d I get: DeviceIOControl with SCSI_PASS_THROUGH_DIRECT command failed. Looks much like a virtualization problem.

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Nov 21, 2012

Okay, this is how it looks on a real windows machine.

ISRCS STARTS
ISRC    01      GBAMC0300001
ISRC    02      GBAMC0300002
ISRC    03      GBAMC0300003
ISRC    04      GBAMC0300004
ISRC    05      GBAMC0300005
ISRC    06      GBAMC0300006
ISRC    07      GBAMC0300007
ISRC    08      GBAMC0300008
ISRC    09      GBAMC0300009
ISRC    10      GBAMC0300010
ISRC    11      GBAMC0300011
ISRCS ENDS

I still need a good libdiscid binary for windows.

@jesus2099

This comment has been minimized.

Contributor

jesus2099 commented Nov 21, 2012

mediatools is quite raw, it seems you can’t use on fake windows.
Don’t worry though, Jonny, I have other means of submitting (OK they are less easy), you can put this as less priority, really. :)

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Nov 24, 2012

I took the libdiscid build from the windows version of picard:
https://github.com/downloads/JonnyJD/musicbrainz-isrcsubmit/libdiscid-0.2.2-win32.zip

This seems to work in general, but in my virtual machine it's giving wrong discIDs. Again, this is probably a virtualization problem. I will have to re-check this on a real machine.

@jesus2099

This comment has been minimized.

Contributor

jesus2099 commented Nov 24, 2012

I can test whatever you want me to test. :)

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Nov 25, 2012

Not yet. I will ask you again when I have something fairly complete (= easy to test)

@ghost ghost assigned JonnyJD Dec 1, 2012

JonnyJD added a commit that referenced this issue Dec 1, 2012

hasBackend test for windows, re #24
On Windows we normally don't have "which" to search if a certain
executable exists.
However, all of our backends are non-interactive console tools that exit
rightaway when started without arguments. So we just try to start the
tool. When we get no Exception, this backend is available.

JonnyJD added a commit that referenced this issue Dec 1, 2012

defaultDevice D: on Windows, re #24
D: is the default cd device on windows now.
In every other case the default is still /dev/cdrom and this is also shown
in the usage.
OS X and Linux are both "posix" in os.name so we still substitute the
default with "1" later on in "drutil".
@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 1, 2012

windows branch should work on windows together with discid.dll and cdrdao (cdrdao.exe, cyggcc_s-sjlj-1.dll, cygwin1.dll). All executables, dlls and the musicbrainz2 directory in the same folder as isrcsubmit.py.
I couldn't test that yet, though.

The mediatools backend is not in place yet.

@JonnyJD JonnyJD closed this in ca17090 Dec 1, 2012

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 1, 2012

This should work now. I created a preview package at http://kraehen.org/tmp/isrcsubmit-0.5-win32.zip

It would be nice if you could test it. I would also like to hear feedback about the packaging. I created isrcsubmit.bat. When you create a windows shortcut for that batchfile (and append arguments as you wish in the shortcut) you should be able to work with this quite comfortably.

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 9, 2012

0.5 is now officially released.

Feedback would still be nice, because I only tested it on windows myself.

@jesus2099

This comment has been minimized.

Contributor

jesus2099 commented Dec 10, 2012

Hi JonnyJD, I tried both your pre-0.5-package and to download the actual isrcsubmit.py file with the python-musicbrainz2 dependcy. Hopefully I have python on this machine !
But it says that it cannot find mediatools, although mediatools**.exe** is both in the same folder and in the path too.

BTW could you add a password parameter ? ;)

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 10, 2012

"it says it cannot find mediatools" means this?:

ERROR: Cannot find a backend to extract the ISRCS!

What Windows version are you using? I tested with XP and 7.
Are you using the isrcsubmit.bat with a "double click" in the windows explorer or are you using isrcsubmit.py or .bat from the cmd?
What happens when you start the cmd (start->execute) and try to start mediatools there? If that doesn't work, does it when you cd to the directory where mediatools is? Does mediatools.exe work, but mediatools doesn't?

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 10, 2012

Do you by chance have the program which? (try to run which mediatools in the cmd)
Normally windows users don't have this, but when you have cygwin tools in your path you might. This could possibly lead to other problems when checking for symlinks.

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 10, 2012

@password parameter:
Wouldn't be a difficult change, but I am highly opposed to store or show your password in plain text (other than in memory).
You might say your MB password is not as important as the one for your bank account, but this is my principle ;-)
You can of course create a patch/fork on github with this change for others to use or an issue to track this. I just won't include it in my distribution.

That being said: With 0.5 I only ask for the password if you actually submit new ISRCs, so you won't nee to type it once per disc.

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 10, 2012

If there really is a problem with the actual python call of mediatools, you can try this test script:

#!/usr/bin/env python2
from subprocess import call
call(["mediatools"])

(paste in a file called mediatools.py and call that file in cmd)

This should give the same output as calling mediatools directly, except when it can't find mediatools. You can also change this to call(["mediatools.exe"]) and see if that makes a difference for you.

If this gives an exception, I would like to know the exception/traceback.

@jesus2099

This comment has been minimized.

Contributor

jesus2099 commented Dec 10, 2012

I call some-path\python some-path\isrcsubmit.py some-parameters from my own isrc.bat.
I will try the things you say, but could you come to #musicbrainz it could be easier to live debug together. :)
My error is :

some-path\python some-path\isrcsubmit.py some-parameters
Cannot find a backend to extract the ISRCS!

or

some-path\python some-path\isrcsubmit.py -b mediatools some-parameters
ERROR: Chosen backend not found. No ISRC extraction possible!
   Make sure that mediatools is installed.

If I call either mediatools.exe drive e isrc or mediatools drive e isrc in cmd, it works (windows XP).

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 10, 2012

You can try placing mediatools.exe where isrc.bat is. Just to make sure this isn't a problem with the %PATH%.

Next thing to test would be which mediatools in cmd. It should tell you which can't be found. If you have which installed I have to know from where and test a bit with that.

The other part is that mediatools.py test script I posted above your comment (with call(["mediatools"])). This will print the exception when there are any problems. (In isrcsubmit I hide this problem and just assume it is because the backend is not available; which should normally be the reason)

I sometimes hang around in #musicbrainz-devel, but I will also have a look in #musicbrainz tomorrow. Today I am off quite soon and afk in between.

@JonnyJD

This comment has been minimized.

Owner

JonnyJD commented Dec 10, 2012

This is now tracked as #30

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