User Tools

Site Tools


netmdpython

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
netmdpython [2010/06/19 10:17] glaubitznetmdpython [2013/05/16 11:39] (current) – [Download] glaubitz
Line 1: Line 1:
 ====== NetMDPython ====== ====== NetMDPython ======
  
-NetMD Python is a collection of [[http://www.python.org/|Python]] scripts which allow to control NetMD devices on Linux, Unix and MacOS X (Windows is unfortunately not yet supported since //libusb// is too old on Windows). With NetMD Python, you can upload tracks from standard MDs with the help of the MZ-RH1 Walkman to your PC, list the contents of any standard MD with any NetMD device and control and record tracks over analog input with any NetMD device.+NetMDPython is a collection of [[http://www.python.org/|Python]] scripts which allow to control NetMD devices on Linux, Unix and MacOS X (Windows is unfortunately not yet supported since //libusb// is too old on Windows). With NetMD Python, you can upload tracks from standard MDs with the help of the MZ-RH1 Walkman to your PC, list the contents of any standard MD with any NetMD device and control and record tracks over analog input with any NetMD device. A recently added and therefore still very hacky script called "downloadhack.py" allows to download tracks to a NetMD.
  
 ===== Requirements ===== ===== Requirements =====
Line 21: Line 21:
  
 <code> <code>
-sudo port install libusb git-core+sudo port install libusb git-core py26-crypto sox
 </code> </code>
  
Line 27: Line 27:
  
 <code> <code>
-sudo apt-get install python2.6 libusb-dev git-core subversion+sudo apt-get install python2.6 libusb-dev git-core subversion python-crypto sox
 </code> </code>
  
 ==== Windows ==== ==== Windows ====
  
-//Windows is not yet supported in the latest release of libusbThus the Python code cannot be run on WindowsThere are however efforts now, to port libusb1.0 to Windows [[http://www.libusb.org/wiki/windows_backend|here]].//+Download and install [[http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi|Python2.6]], [[http://www.voidspace.org.uk/downloads/pycrypto-2.1.0.win32-py2.6.zip|PyCrypto]] and [[http://sourceforge.net/projects/sox/files/sox-win/14.3.1/|sox]].
  
-===== Download =====+Download [[http://libusb-winusb-wip.googlecode.com/files/zadig.exe|zadig.exe]] (WinUSB device driver installer), connect your NetMD device and run //zadig.exe//.
  
-Clone the main source repository:+Click //Options->List all devices//, choose your NetMD device an choose //Install Driver//. 
 +//**NOTESonicStage will not be able to communicate with your NetMD device anymore. 
 +If you want to use SonicStage again, you will have to uninstall WinUSB device driver first.**// 
 +(To uninstall the driver, run Windows "Device Manager", choose your device and uninstall it, you can find it at "libusb (WinUSB) devices"
 +Then unplug and reconnect your device).
  
 +Download latest version of [[http://github.com/vpelletier/python-libusb1/tree/|python-libusb1]] and replace usb1.py and libusb1.py in the //netmd// subdirectory of your //linux-minidisc// folder with the python-libusb1 versions. These versions can find and open libusb Windows DLL which has not been implemented in usb1.py and libusb1.py of current main source repository yet. 
 +
 +Download and extract [[http://libusb-winusb-wip.googlecode.com/files/libusb_2010.10.14.7z|libusb windows backend]] and copy libusb1.0.dll to your 
 +windows/system32 folder (usually C:\WINDOWS\system32). Use the version according to your version of Windows, the mingw32 version should work on Windows XP 32-bit.
 +
 +Open a command prompt (Click //Start->Run//, type //cmd// and press enter) and type
 <code> <code>
-git clone git://z6.physik.fu-berlin.de/linux-minidisc+set PATH=<sox install dir>;%PATH% 
 +</code>  
 +to add the path of sox directory temporarily. (<sox install dir> means the path to your sox installation directory, usually C:\sox-14-3-1). To use it permanently you can add the path to your system variables. 
 + 
 +If you want to use ffmpeg to convert uploaded files, you can download Windows binaries of [[http://ffmpeg.arrozcru.org/autobuilds/|ffmpeg]]. 
 +Extract it to a place of your choice and add the path of //bin// subdirectory to your PATH environment variable as described above. 
 +<code> 
 +set PATH=<ffmpeg install dir>\bin;%PATH%
 </code> </code>
 + 
 +To use the tools, change into netmd subdirectory of your linux-minidisc folder and run the scripts by their name (just type 
 +"dump_md.py", "upload.py", ...) with parameters if required. See [[netmdpython#how_to_use_the_tools]] below.
 +
 +
 +==== Getting the code ====
 +
 +To get the code, clone it with //git// as shown on the [[start#source_code|homepage]].
  
 The Python libnetmd can be found in the //netmd// subdirectory: The Python libnetmd can be found in the //netmd// subdirectory:
Line 117: Line 142:
 </code> </code>
 ==== upload.py - upload tracks from standard MDs using Sony's MZ-RH1/M200 ==== ==== upload.py - upload tracks from standard MDs using Sony's MZ-RH1/M200 ====
-This tool is used for digital upload of non-protected tracks (lsmd lists them as "unprotected"). It only works with an MZ-RH1 HiMD Walkman. Invocation works like with the ''dump_md'' utility, but the output format will be ".aea" for SP tracks (a format implemented by very recent versions of ffmpeg) and ".wav" for LP2/LP4 tracks. Beware! While the files are really Windows-compatible wave files, they still do contain the ATRAC3 encoded audio. To play them you need an ATRAC3 decoder. For windows, that means you have to install the ATRAC3 acm to have it work with Windows Media Player. On Linux, the ffmpeg project (and everything based on it) supports ATRAC3 encoded audio.+This tool is used for digital upload of non-protected tracks (lsmd lists them as "unprotected"). It works with the MZ-RH1 HiMD Walkman only. Invocation has the same syntax as the ''dump_md'' utility, but the output format will be ".aea" for SP tracks (a format implemented by very recent versions of ffmpeg) and ".wav" for LP2/LP4 tracks. **NOTE:** While the files are really Windows-compatible WAV files, they still do contain the ATRAC3 encoded audio. To play them you need an ATRAC3 decoder. For Windows, that means you have to install the ATRAC3 decoder (acm file) in order for it work with Windows Media Player. Alternatively, you can install a recent version of VLC. On Linux, the ffmpeg project (and everything based on it) supports ATRAC3 encoded audio as well as ATRAC SP (version 0.6 or later).
  
-This tool will silently skip protected tracks, so if you don't get the files you expect check their protection status. There is no known way to unprotect a track using NetMD or HiMD players. All tracks uploaded by Sonic Stage are protected. Surprisingly, tracks uploaded by MD Simple Burner are not.+This tool will silently skip protected tracks, so if you don't get the files you expectcheck their protection status. There is no known way to unprotect a track using NetMD or HiMD players. All tracks uploaded by Sonic Stage are protected. Surprisingly, tracks uploaded by MD Simple Burner are not. To transfer tracks to the NetMD as unprotected, our "downloadhack.py" may be used as well.
  
 === Using upload.py and ffmpeg to upload tracks on MacOS X === === Using upload.py and ffmpeg to upload tracks on MacOS X ===
Line 196: Line 221:
 ==== downloadhack.py - download tracks to NetMD (buggy) ==== ==== downloadhack.py - download tracks to NetMD (buggy) ====
  
-Use this script download tracks to your NetMD Walkman. **Note: This requires the NetMD root key from Sony which is not (yet) part of the official repository due to legal reasons.**+Use this script download tracks to your NetMD Walkman. <del>**Note: This requires the NetMD root key from Sony which is not (yet) part of the official repository due to legal reasons.**</del>
  
-==== mdctl.py ====+==== mdctl.py - test libnetmd functionality (DEBUG use only) ====
  
-This is in a more-then-primitive state. It is supposed to export all functions of libnetmd.py for easy command-line use. Currently, it's a brain-dead wrapper around a pdb shell. Use only if you know python.+This is in a more-than-primitive state. It is supposed to export all functions of libnetmd.py for easy command-line use. Currently, it's a brain-dead wrapper around a pdb shell. Use only if you know Python.
  
 ==== lsusb.py - list USB devices connected to the PC ==== ==== lsusb.py - list USB devices connected to the PC ====
Line 208: Line 233:
  
 **Important notes regarding all tools:** **Important notes regarding all tools:**
- 
-  * The tools use a python binding for libusb 1.0. There is no libusb 1.0 for Windows yet, so no chance of using them on Windows. 
  
   * Write access to usb device required (even for listing, as it requires sending usb commands). One way to obtain the rights on modern Linux distributions that use PolicyKit ist to add the portable_audio_player capability to the Net MD device using the provided fdi file (look in netmd/etc of the linux-minidisc tree). Another way is to run them with root permissions (not recommended) or make sure the device raw USB device (the file /dev/bus/usb/<bus>/<device>) gets read/write access by the user you want to use the tools with.   * Write access to usb device required (even for listing, as it requires sending usb commands). One way to obtain the rights on modern Linux distributions that use PolicyKit ist to add the portable_audio_player capability to the Net MD device using the provided fdi file (look in netmd/etc of the linux-minidisc tree). Another way is to run them with root permissions (not recommended) or make sure the device raw USB device (the file /dev/bus/usb/<bus>/<device>) gets read/write access by the user you want to use the tools with.
netmdpython.1276942650.txt.gz · Last modified: 2010/06/19 10:17 by glaubitz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki