linux-minidisc / linux-minidisc

Free software for accessing MiniDisc devices
GNU General Public License v2.0
108 stars 61 forks source link

Cannot connect to MZ-NE410 #86

Open MagnetoOptical opened 2 years ago

MagnetoOptical commented 2 years ago

Platform: Linux, Pop!_OS 21.10

Looks similar to #68

Cloned repo and build from source. netmdcli and qhimdtransfer both compiled successfully. Added my user to plugdev group, and installed the udev rule.

netmdcli reports: "Error opening netmd Error while opening the USB device"

qhimdtransfer reports: "Error opening minidisc device (SONY MZ-NE410 / MZ-DN430 / MZ-NF520 (NetMD)): Error opening netmd: Error while opening the USB device.

thp commented 2 years ago

Did you reboot / restart udevd and/or re-plug the device? Have you verified with the groups command that the user you're running in is actually part of the plugdev group?

MagnetoOptical commented 2 years ago

Did you reboot / restart udevd and/or re-plug the device? Have you verified with the groups command that the user you're running in is actually part of the plugdev group?

I did restart systemd-udevd.service which was successful e.g. a status of active (running), however there was no change in behavior so I rebooted my computer. groups shows: <myusergroup>, adm, sudo, plugdev, users, lpadmin

What's interesting to me is that I was able to use https://webminidisc.com/ on another computer via Chrome (macOS Monterey) and I could play, pause, stop, and change tracks (no audio, however). The site does not work on Linux, all I get is Access denied. That makes me think there's something interfering with my USB ports.

thp commented 2 years ago

What's interesting to me is that I was able to use https://webminidisc.com/ on another computer via Chrome (macOS Monterey) and I could play, pause, stop, and change tracks (no audio, however). The site does not work on Linux, all I get is Access denied. That makes me think there's something interfering with my USB ports.

For NetMD play/pause/stop controls, the audio is played on the device (so plug your headphones into the player), the audio doesn't come out of the computer's audio device.

If webminidisc doesn't work (also try https://web.minidisc.wiki, although if you have USB port permission issues, then this won't help) then it really looks like a USB port problem. Do you have some special security modules loaded (e.g. SELinux, etc..) that might interfere? Do journalctl or dmesg give hints when trying to access the device? I guess it shows up in lsusb, right?

MagnetoOptical commented 2 years ago

Turns out you were on the right track: An AppArmor profile was preventing access to the ports.

MagnetoOptical commented 2 years ago

Turns out I am still having trouble getting music on to the NetMD. I see a lot of chatter about the device expecting LP2 (and possibly SP) ATRAC files, but with no encoder freely available I'm not sure how to accomplish that. QHiMDTransfer makes it look like you can transfer mp3's, but that also does not work.

Trying to use netmdcli send on both .wav and .mp3 files results in : Error opening netmd Error while opening the USB device.

thp commented 2 years ago

atracdenc can encode ATRAC3 (LP2/LP4), and with a recent patch it can output .wav files that netmdcli (and QHiMDTransfer in case of minidisc-ffwd) can consume. atracdenc is also what Web Minidisc and Platinum MD use for LP2/LP4 upload. Note that quality of encoded ATRAC3 with atracdenc is not yet as good as LP2/LP4 encoded with SonicStage.

netmd download of LP2/LP4 depends on #83 being merged, or alternatively ("Ask me about Loom"-style "<ADVERTISEMENT>" starts blinking at the bottom of your screen) the minidisc-ffwd friendly fork contains NetMD upload support, also from QHiMDTransfer among other fixes -- the fork even includes really basic support for uploading MP3s to NetMD, but that's accomplished via the ffmpeg command-line tool run as a subprocess in the background to decode to WAV (and then upload as SP) - similar to Web Minidisc and Platinum MD.

MagnetoOptical commented 2 years ago

OK I think I can safely say that I can connect to the device and have limited control of it via netmdcli. I am not able to get audio onto a blank minidisc, however, and I do find QHiMDTransfer to be rather confusing. In one view it looks like you can transfer .WAV files, but they don't, in another view (button on top bar, blue disc with the down arrow which wants .mp3 files, but only enables when another "valid" file type is slected in the right pane).

All of that said, I think the initial issue is resolved.

Is there any interest in converting the python 2 code into python 3? I spent about an hour on it tonight, but there is a lot left to do....for example libnetmd raises an exception no matter what right now, but the exception depends on whether or not the disc has a title (or doesn't), or is blank.

thp commented 2 years ago

OK I think I can safely say that I can connect to the device and have limited control of it via netmdcli. I am not able to get audio onto a blank minidisc, however, and I do find QHiMDTransfer to be rather confusing. In one view it looks like you can transfer .WAV files, but they don't, in another view (button on top bar, blue disc with the down arrow which wants .mp3 files, but only enables when another "valid" file type is slected in the right pane).

Did you try with minidisc-ffwd from https://github.com/thp/linux-minidisc ? The uploading/downloading has been improved a bit with this, it can even (using the ffmpeg command-line utility for decoding to WAV) download MP3s to NetMD.

Is there any interest in converting the python 2 code into python 3? I spent about an hour on it tonight, but there is a lot left to do....for example libnetmd raises an exception no matter what right now, but the exception depends on whether or not the disc has a title (or doesn't), or is blank.

There's #60 already, but since it's a quick'n'dirty 2to3 job, feel free to do it properly and replace that PR.