Skip to content
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

PoC Download function #62

Merged
merged 36 commits into from Nov 16, 2020
Merged

PoC Download function #62

merged 36 commits into from Nov 16, 2020

Conversation

deenine
Copy link
Contributor

@deenine deenine commented Sep 24, 2020

Proof of concept download (fetch track from MD, store on PC) functionality for RH1, very rough. Note this version of upload.py is modified to allow specification of an output path.

Todo:

  • port python code to support python3
  • ability to select multiple files to transfer
  • test on windows/linux/another mac - tested on windows, fails to find python executable, when hard coded path to python 2, fails on loading libusb-1.0.dll
  • Hide Transfer button when !RH1
  • allow user to specify where downloaded files go
  • convert downloaded atrac to something more useful
  • Transfer status progress updates
  • Transfer in progress screen not 'device not detected' when shelling out to python, or freeze the listing view?
  • Icon for transfer button not <<

@deenine deenine mentioned this pull request Sep 24, 2020
…etch-2.6.1

Bump node-fetch from 2.6.0 to 2.6.1
added missing dependencies to brew install
Fixed copy/paste error causing display of title format in directory view
@gavinbenda
Copy link
Owner

Will have a review/test of this - good work, need to have a think about how the UI will work like you've mentioned.

@deenine
Copy link
Contributor Author

deenine commented Sep 25, 2020

Thanks, its pretty rough - my first time writing in node or async programming. I will push my latest version when I walk away in a bit.

@gavinbenda
Copy link
Owner

This actually works quite well. To get it to work (on OSX), had to move the Python scripts into /resources/mac/netmd-py/ and I just added the ensureDirSync function in for testing purposes.

You might want to consider moving the actual downloading code from NetMdListing.vue into DirectoryListing.vue, and calling it by firing an event via the event bus that's been implemented. You'll have a bunch of nice helper functions locally scoped then, including the directory helpers, and fluent-ffmpeg to do the MP3 (or whatever) conversion.
Otherwise there will be a bunch of repeated code, or having to refactor big chunks of the rest of the app.

@deenine
Copy link
Contributor Author

deenine commented Sep 25, 2020

Ive fixed the error in binaries.js that had the wrong path for the python scripts when running in dev mode (I hadnt figured out how to run it in dev mode - it worked in the built version).

I saw your comment after I'd created a common.js and moved a couple of functions into it, happy to move that back and use the bus if you prefer.

I am having issues with the vue refresh, it isnt refreshing to show the progress of the download, and I cant get the show/hide of the transfer button to work, is there something obvious I have missed?

@deenine
Copy link
Contributor Author

deenine commented Sep 30, 2020

I have taken a look at getting this working on windows:

  1. python2.exe needs to be on the path (pyhton2 is a link on OSX (and linux?) to the installed python2, but by default this is not installed when installing python2 on windows.
  2. python needs to be able to find libusb-1.0.dll to download the tracks off the disc, which means installing it properly (copy to Windows/System32 && Windows/SysWOW64 && regsvr32.exe /u libusb-1.0.dll at admin terminal) or pasting it into the same directory as the python2.exe
  3. the version of libusb-1.0.dll in platinum-md/resources/win/bin is a 32bit dll, so download the 64bit version from https://github.com/libusb/libusb/releases

This results in they python script executing correctly and downloading the tracks from md to pc. However, node python-shell does not receive any messages from the python script, so it cannot pass the filename to ffmpeg for conversion.

@deenine
Copy link
Contributor Author

deenine commented Oct 2, 2020

Added a dirty hack on windows to batch convert the music after it is downloaded, rather than doing it track by track as it comes. In reality takes a handful of seconds on an old i5, so probably not that terrible

@gavinbenda
Copy link
Owner

Do you think we should release this in the next Version as Mac (and Linux if it works, which it should) only and continue work on Windows release? Fairly close to a new build with other features.

@deenine
Copy link
Contributor Author

deenine commented Oct 17, 2020

I think thats a good approach, it seems fairly stable on mac. This has gone on the backburner for the moment while i work on debugging the MDS-JE780, I have got the majority of the control commands working, but havent tested music transfer yet.

@Invictaz
Copy link

@deenine Would you be able to fetch raw .aea (ATRAC1) from normal Minidisc discs ?
Or store them in a WAV container?

LP2/LP4 = ATRAC3

I need the download function to save older Minidisc's. RH1 is the only device that allows that.
Congratulations on your work.

@deenine
Copy link
Contributor Author

deenine commented Oct 18, 2020

@Invictaz this fetchs .aea or .at3 from the RH1, depending on wether the track is SP or LP2/4, then converts it to wav/flac/mp3 as specified in the settings:
Screenshot 2020-10-18 at 10 50 44

@Invictaz
Copy link

@deenine Would you be able to make a button that says "do not convert" or "save as original" ?
I like to do the conversion afterwards myself.

And just for interest, are you able to work on the Hi-MD side of the RH1 as well?

@deenine
Copy link
Contributor Author

deenine commented Oct 18, 2020

@Invictaz yeah sure, I can add a 'do not convert' button.

I plan to look at the Hi-MD functionality at some point, its a few projects down my list, so I'll probably get to it around christmas.

@Invictaz
Copy link

@deenine If the "do not convert" button is there and branch is merged I can easily live till Christmas :)

@deenine
Copy link
Contributor Author

deenine commented Oct 19, 2020

@Invictaz sure, I'll take a look at that sometime when Ive got a few minutes, should be simple to add.

This is what I have been working on recently, if you are interested in testing: http://forums.sonyinsider.com/topic/31120-mds-je780-with-linux-minidiscplatinum-mdwebmd/

@gavinbenda sorry for going off topic, but I am optimistic to get a 780/980/nt1/bookshelf compatible build of linux-minidisc out sometime soon.

@Invictaz
Copy link

Very good work @deenine I hope you can upstream this to linux-minidisc main repo if a working PoC is complete.

@deenine
Copy link
Contributor Author

deenine commented Oct 26, 2020

@Invictaz as requested:
Screenshot 2020-10-26 at 10 09 12

@Invictaz
Copy link

@deenine Wonderful. How stable is it?

I hope it can be merged. That way we might dump QHimdtransfer.

Hope you can continue on RH1 specific features such as MP3 up and download or other Hi-MD specifics. The assigning to groups is something I can do on the device for now. Doing this on Sonicstage might DRM things again.

@deenine
Copy link
Contributor Author

deenine commented Oct 27, 2020

@gavinbenda while i was working on the 780 code, I spotted this function: https://github.com/gavinbenda/linux-minidisc/blob/master/libnetmd/secure.c#L744

Ive written a function to use that function instead of shelling out to python and it works with LP2/LP4 tracks, but is not correctly writing the AEA header for SP tracks, so ffmpeg throws an IO error.

Ive pushed a WIP version, will take another look when I get more time. Once this is sorted, I think it might be worth making a test build and asking a few people to try the 780 and RH1 functionality.

@gavinbenda
Copy link
Owner

Great work - will take a look and give it a test - perhaps we can just tell FFMPEG what the format is - i.e. ->inputFormat('aea') I know this was sometimes an issue on the atracdenc project too.

@deenine
Copy link
Contributor Author

deenine commented Oct 29, 2020

Ive done a fair bit of testing and this seems to work correctly with both RH1 downloads and 780 uploads. I have included the latest mac netmdcli binary (built from this gavinbenda/linux-minidisc#3) but do not have a toolchain to build the windows or linux binaries.

Known bug: the rh1 upload format checkbox does not remember its setting when you close platinum-md and reopen it, I think this is a vue subtlety that I have missed.

Otherwise, transfers seem slow, there may be some timeouts or something we can tweak.

@gavinbenda
Copy link
Owner

Will fire up the windows machine and see if I can get a build working there, might be after the weekend though!
Linux build will be easy, so can do that at the same time.

@Invictaz
Copy link

Invictaz commented Nov 1, 2020

@gavinbenda hoping for a Windows release. Also mentioned this to @cybercase so he can port it to WebMinidisc. He might be able to help debugging it.

@gavinbenda gavinbenda merged commit 76653b8 into gavinbenda:master Nov 16, 2020
@gavinbenda
Copy link
Owner

Making an interim build/release for now - will make a few changes later on to the UI - thank you again!
Found a bit more time on my hands since my city has been locked down with COVID-19 again...

@deenine deenine mentioned this pull request Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants