SanderVocke / winmm_midi_rename

WinMM wrapper which enables rule-based modification of MIDI device properties.
GNU General Public License v3.0
6 stars 1 forks source link

"No log file specified." error on Windows 10 #2

Closed elvetemedve closed 2 months ago

elvetemedve commented 2 months ago

Hi @SanderVocke,

I'm trying to find the midi device name differences between Windows and Linux.

For that I've copied the 1.3 version of the dll file to the application folder and created the config file in the same directory with content:

{
  "log": "midi_rename.log",
  "popup": true,
  "rules": []
}

After staring the app the debug info dialog appears with this error: "No log file specified." winmm_midi_rename

I don't understand why. The dll with the same config file works well on Linux. Do you have any idea what went wrong?

SanderVocke commented 2 months ago

Hi @elvetemedve, sorry to hear that. I don't know what is going wrong here. I will have a look if I can reproduce it when I get the chance, probably tomorrow.

I did notice that in my own example in the README i didn't put quotes around the log filename - maybe that helps? In that case it would still be a bug of course.

On another note: I'm curious what you are trying to get working. It just so happens that someone messaged me to try to help getting a Pioneer DDJ-SX controller recognized in Rekordbox on Linux, and unfortunately it didn't end up working (probably there is more going on than just MIDI with that controller).

elvetemedve commented 2 months ago

Hi @SanderVocke,

I did notice that in my own example in the README i didn't put quotes around the log filename - maybe that helps?

Yeah, I figured that out already. Thanks anyway for checking out.

Well, I have a DDJ-FLX10 controller that I use with Rekordbox 6 on Windows 10. But as we know Windows sucks (USB storage sometimes disconnects causing the playing track stop after the read buffer is empty, or random hiccups in audio) and I'm tired of dual boot to Windows only for running this app.

So I'm trying to get the same setup working with Linux. Though Rekordbox crashes with vanilla Wine, but it seems to be working with Proton (at least Rekordbox 7.x). Next step would be get the controller working, but it's not recognized by Rekordbox. After that I had found your experiment with renaming the midi device, so I wanted to explore if renaming (changing product ID etc.) helps or not.

Even if it worked the last bit would be get the music playing on the integrated audio interface which might be tricky as on Windows it has direct access to the hardware (or similar) via ASIO, but it has no replacement in Linux/Wine. So I hope somehow can get it stream the audio via Alsa.

So any help would be appreciated. :)

SanderVocke commented 2 months ago

I am having a look at the log file issue. I can reproduce it too on Windows 11, so I think I should be able to fix it very soon.

As for the audio interfacing: have you heard of WineASIO (https://github.com/wineasio/wineasio)? Worked like a charm for me to get a real-time audio Windows app working on Linux within a JACK audio environment. The only prerequisite is that you set up JACK (e.g. look at https://wiki.archlinux.org/title/JACK_Audio_Connection_Kit) and that your audio device already works properly in Linux.

With that setup, your Windows Rekordbox can even share the audio interface with other Linux apps.

SanderVocke commented 2 months ago

Most likely the issue is that you don't have permission to create the log file in that folder. At least, that is what it turned out to be in my case.

You can work around this by specifying an absolute path (note the double slashes): "C:\\Users\\MyUser\\midi_rename.log", where MyUser is your user account name.

I have some work to do to improve the error reporting to show this problem, so I will keep this issue open to fix that.

elvetemedve commented 2 months ago

I am having a look at the log file issue. I can reproduce it too on Windows 11, so I think I should be able to fix it very soon.

As for the audio interfacing: have you heard of WineASIO (https://github.com/wineasio/wineasio)? Worked like a charm for me to get a real-time audio Windows app working on Linux within a JACK audio environment. The only prerequisite is that you set up JACK (e.g. look at https://wiki.archlinux.org/title/JACK_Audio_Connection_Kit) and that your audio device already works properly in Linux.

With that setup, your Windows Rekordbox can even share the audio interface with other Linux apps.

Thank you for the hint. I've heard about that, but the complexity of JACK audio made me stop looking further. Now I will give it a try. :)


Most likely the issue is that you don't have permission to create the log file in that folder. At least, that is what it turned out to be in my case.

You can work around this by specifying an absolute path (note the double slashes): "C:\Users\MyUser\midi_rename.log", where MyUser is your user account name.

I have some work to do to improve the error reporting to show this problem, so I will keep this issue open to fix that.

I'm not sure how the absolute path makes a difference assuming it's a permission problem, but will check it out later today.

SanderVocke commented 2 months ago

Thank you for the hint. I've heard about that, but the complexity of JACK audio made me stop looking further. Now I will give it a try. :)

I agree it's cumbersome to have to start a JACK server every time. I have been very happy with Pipewire, which replaces pulseaudio (probably what you are running) and at the same time can act as an always-on JACK server. It makes the whole experience very seamless in my opinion - no extra start-up steps required.

I'm not sure how the absolute path makes a difference assuming it's a permission problem, but will check it out later today.

It's because the permissions depend on which folder you are in. Probably the folder where the DLL is does not have write permission for your user. But your user will always have write permission in your own user documents folders.

I will close this issue because I have already made the changes to improve error logging (see 1.4 release) - but it doesn't mean you can't ask more questions. If it turns out to be another problem than permissions, I can re-open.

elvetemedve commented 2 months ago

I agree it's cumbersome to have to start a JACK server every time. I have been very happy with Pipewire, which replaces pulseaudio (probably what you are running) and at the same time can act as an always-on JACK server. It makes the whole experience very seamless in my opinion - no extra start-up steps required.

I'm on Arch Linux and switched to Pipewire few months ago. So far I have good experience with it (though had to restart it couple of times when I connected a bluetooth headset). I didn't know that Pipewire can act as JACK server. It's good to know, thank you for that.


It's because the permissions depend on which folder you are in. Probably the folder where the DLL is does not have write permission for your user. But your user will always have write permission in your own user documents folders.

I see, it makes sense.


I will close this issue because I have already made the changes to improve error logging (see 1.4 release) - but it doesn't mean you can't ask more questions. If it turns out to be another problem than permissions, I can re-open.

I've installed your new release and with "popup_verbose": true it showed me the permission issue. After changing the log file path to the home directory, it started recording the data. Thank you very much for helping me out and for the quick response. :)

elvetemedve commented 2 months ago

It looks like the renaming worked well, though I still don't see the Midi controller recognized by the application.

My config:

{
    "log": "midi_rename.log",
    "popup": true,
    "rules": [
        {
          "match_name": "DDJ-FLX10 - DDJ-FLX10 MIDI.+",
          "match_direction": "out",
          "replace_name": "DDJ-FLX10",
          "replace_man_id": 65535,
          "replace_prod_id": 65535,
          "replace_channel_mask": 65535,
          "replace_driver_version": 274,
          "replace_technology": 1
        },
        {
          "match_name": "DDJ-FLX10 - DDJ-FLX10 MIDI.+",
          "match_direction": "in",
          "replace_name": "DDJ-FLX10",
          "replace_man_id": 65535,
          "replace_prod_id": 65535,
          "replace_driver_version": 274
        }
    ]
}

Related lines from log:

Request for output device capabilities:   name: DDJ-FLX10 - DDJ-FLX10 MIDI 1
  man id: 255
  prod id: 1
  driver version: 1
  technology: 1
  voices: 0
  notes: 0
  channel mask: 65535
  support: 0

--> Matched a replace rule. Returning:   name: DDJ-FLX10
  man id: 65535
  prod id: 65535
  driver version: 274
  technology: 1
  voices: 0
  notes: 0
  channel mask: 65535
  support: 0

Request for input device capabilities:   name: DDJ-FLX10 - DDJ-FLX10 MIDI 1
  man id: 255
  prod id: 1
  driver version: 1

--> Matched a replace rule. Returning:   name: DDJ-FLX10
  man id: 65535
  prod id: 65535
  driver version: 274

Do you have any suggestion how to debug this further? @SanderVocke

SanderVocke commented 1 month ago

Hi @elvetemedve, it so happens that I also heard of another user who unsuccessfully attempted to use this wrapper for Rekordbox (with a DDJ-RB in that case). I created another issue to discuss further steps: #4. Let's discuss there.