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

Changes to learned .midi controller files stored in Appdata local MIXXX controllers aren't loading properly. #14247

Open
zoeymithra opened this issue Jan 27, 2025 · 12 comments · Fixed by #14253

Comments

@zoeymithra
Copy link

Bug Description

Forgive me if this has already been reported. I searched for the issue and didn't find it.

Issue Example; Upon startup the stock Working DJ-505 midi mapping file doesn't map mastergain, library button, and aux1 gain (for use with TRS-505), which is correct I think? So I map them once I have inputs and such setup, then I save the user mappings file on exiting the learn dialog. New file is created and appears to live in ...\AppData\Local\Mixxx\controllers as a new file with the mappings saved there. If I exit, and start the program anew, the mappings are no longer present. If I find the learned sections of the user file and copy them into the original .midi MIXXX 2.5.0\controllersfile\Roland_DJ-505.midi at the end, the changes are persistent between launches. It seems like the file that was created in AppData\Local\ is not being read after being created.

Here are the sections that I copied, but I think they should probably stay in the AppData local version of the file, and be correctly loaded after the original MIXXX 2.5.0\controllersfile\Roland_DJ-505.midi

        <control>
            <group>[Skin]</group>
            <key>show_maximized_library</key>
            <description>MIDI Learned from 2 messages.</description>
            <status>0x9F</status>
            <midino>0x06</midino>
            <options>
                <normal/>
            </options>
        </control>
		            <control>
            <group>[Master]</group>
            <key>gain</key>
            <description>MIDI Learned from 219 messages.</description>
            <status>0xBF</status>
            <midino>0x0A</midino>
            <options>
                <normal/>
            </options>
        </control>
		            <control>
            <group>[Auxiliary1]</group>
            <key>pregain</key>
            <description>MIDI Learned from 218 messages.</description>
            <status>0xBF</status>
            <midino>0x1A</midino>
            <options>
                <normal/>
            </options>
        </control>

Side note; Copying the AppData local saved version of the file to the software controllers directory seems to break it completely, hence the mods to the file to gain persistent mappings.

Version

2.5.0

OS

Windows 10

@zoeymithra zoeymithra added the bug label Jan 27, 2025
@ronso0
Copy link
Member

ronso0 commented Jan 27, 2025

Are you saying that the user mapping is not loaded but the default, built-in version?
In the user settings directory (...\AppData\Local\Mixxx\ in your case) is also the mixxx.cfg which holds the last loaded mapping for each controller that has been connected and had a mapping loaded. It's the [ControllerPreset] section.
Can you please check that file for the saved mapping path?

@zoeymithra
Copy link
Author

zoeymithra commented Jan 27, 2025 via email

@ronso0
Copy link
Member

ronso0 commented Jan 28, 2025

I could try again to replicate it?

Yes please, try again.
Do you save the changed mapping with Apply, or do you quit the preferences which should give a warning and option to apply?

Please try to list every step you make, starting with the click on Learning.
Maybe there's an uncovered case in the apply/save flow, or a bug.

@ronso0
Copy link
Member

ronso0 commented Jan 28, 2025

And can you please post the literal copy of the [ControllerPreset] section? Look slike linebreaks are off..

Wrap it in triple backticks ``` (on single lines before/after)

@zoeymithra
Copy link
Author

zoeymithra commented Jan 28, 2025 via email

@ronso0
Copy link
Member

ronso0 commented Jan 28, 2025

I could probably also make a video of all the steps involved to show this
bug if it would help.

Yeah, a short screencsast is probably better than trying to clarify the procedure in text.
For the video, please rename/remove the Mixxx dir in appdata to simulate a fresh start.
Thank you!

@zoeymithra
Copy link
Author

ControllerPreset section of mixxx.cfg from C:\Users\iracarmel\AppData\Local\Mixxx
If viewed in notepad++ the line endings seem to be

[ControllerPreset]
2-DJ-505 E:/MIXXX 2.5.0/controllers/Roland_DJ-505.midi.xml
2.4G_Wireless_Mouse
C:/Users/iracarmel/AppData/Local/Mixxx/controllers/2.4G_Wireless_Mouse_--2.hid.xml
DJ-505 C:/Users/iracarmel/AppData/Local/Mixxx/controllers/Roland_DJ-505.midi.xml
Razer_DeathAdder_ C:/Users/iracarmel/AppData/Local/Mixxx/controllers/Razer_DeathAdder_.hid.xml
USB_Receiver__0 C:/Users/iracarmel/AppData/Local/Mixxx/controllers/USB_Receiver__0.hid.xml
USB_Receiver__1 C:/Users/iracarmel/AppData/Local/Mixxx/controllers/USB_Receiver__1--5.hid.xml
W10_GYRO__0 C:/Users/iracarmel/AppData/Local/Mixxx/controllers/W10_GYRO__0.hid.xml
W10_GYRO__1 C:/Users/iracarmel/AppData/Local/Mixxx/controllers/W10_GYRO__1--3.hid.xml
W10_GYRO__2 C:/Users/iracarmel/AppData/Local/Mixxx/controllers/W10_GYRO__2.hid.xml

@ronso0
Copy link
Member

ronso0 commented Jan 28, 2025

FWIW on Linux I can at least reproduce that the new mapping is not selected in the mapping combobox.
Tested with a virtual MIDI and the 505 mapping.

@ronso0
Copy link
Member

ronso0 commented Jan 28, 2025

This is logged

debug [Main] Mapping renamed to "Roland DJ-505--new"
debug [Main] Saving mapping "Roland DJ-505--new" to "/home/ro/.mixxx_dev/controllers/Roland DJ-505--new.midi.xml"
debug [Main] writing script block for "lodash.mixxx.js"
debug [Main] writing script block for "midi-components-0.0.js"
debug [Main] writing script block for "Roland_DJ-505-scripts.js"
debug [Main] Mapping saved as "/home/ro/.mixxx_dev/controllers/Roland DJ-505--new.midi.xml"
debug [Main] Loading controller mapping from "/home/ro/mixxx_source/src/master/res/controllers/Roland_DJ-505.midi.xml"

So it's indeed reloading the original mapping.

I'll take a look..

@zoeymithra
Copy link
Author

Sorry it took so long, after renaming the AppLocal Mixxx folder I foolishly told Mixxx where my music library was, and then it took a long time looking through it.

This time I was able to confirm that the .cfg file is looking at the OEM file even after a new mapping file is saved.
From the .cpf file;

[ControllerPreset]
2-_DJ-505 E:/MIXXX 2.5.0/controllers/Roland_DJ-505.midi.xml

^^-- Not the AppData/Local/Mixxx file.
This indeed is the install location of my copy of 2.5.0.

Adding the learned sections that are saved into Appdata/Local/Mixxx/ into the above file has the desired effect, but of course this is not how we'd like it to work. I'm not sure why the .cfg file wasn't showing the actual load location before when the Mixxx folder was (probably?) imported during the new 2.5.0 install?

The video is quite long, but if it's still required I can edit it down. In the video, I walk through a fresh setup, and then try and map controls, fail, look at the new files in AppData/Local/Mixxx, copy the new bits into the .midi file that is actually being loaded and shown in the ControllerPreset, and it works.

@ronso0
Copy link
Member

ronso0 commented Jan 28, 2025

@zoeymithra found the issue, we don't need the video anymore, thanks!

and I can confirm the bug exists in 2.4.2, too.

@zoeymithra
Copy link
Author

zoeymithra commented Jan 28, 2025 via email

ronso0 added a commit to ronso0/mixxx that referenced this issue Jan 28, 2025
mapping changed with MIDI Learning wizard not saved
Reason:
signal DlgControllerLearning::stopLearning triggers DlgPrefController::show which
enumerates and selects the old mapping BEFORE the changed mapping is selected and assigned
DlgControllerLearning::stopLearning -> show() -> slotUpdate() -> enumerateMappings() -> slotMappingSelected()
Though, DlgControllerLearning::mappingEnded signal will also call show(),
so the other conection is not needed in the first place

requires some other fixes in slotUpdate() and slotmappingSelected()
@ronso0 ronso0 linked a pull request Jan 28, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants