mixxx icon indicating copy to clipboard operation
mixxx copied to clipboard

Allow loading custom sound config with '--sound-config' argument

Open ronso0 opened this issue 1 year ago • 6 comments

first step to resolve https://bugs.launchpad.net/mixxx/+bug/1516035

This allows loading a custom sound config via --sound-config config_file.xml. For now this is restricted to files inside the settings dir. If the argument not added or the passed file is not readable, default soundconfig.xml is used. Note: the given config file (command line or default) is used for all read/write operations in the current session, i.e. if you change your config those changes will be stored in your custom sound config.

Thus, the workflow currently goes like this: Create sound profile

  • connect audio devices and start Mixxx
  • adjust sound devices and options as desired
  • quit Mixxx
  • copy soundconfig.xml and rename to something like soundconfig_DDJ-SB3_NIAudio8.xml

Load sound profile

  • connect audio devices and start Mixxx
  • start Mixxx with mixxx --sound-config soundconfig_DDJ-SB3_NIAudio8.xml

I post-poned adding a profile selector to Preferences > Sound Hardware since that is more elaborate than I first thought. It's mainly getting the UX right, but also some flaws in current DlgPrefSound become obvious when dealing with profiles for the entire page (e.g. some settings are applied instantly).

ronso0 avatar Jul 18 '22 11:07 ronso0

I think this is good enough to be mergd (if a second reviewer doesn't spot issues, of course).

The preferences / startup UI integration is a bit more elaborate and I'm unsure I find time to finish that soonish, so I'll do it another branch.

ronso0 avatar Jul 18 '22 19:07 ronso0

Cool. I didn't do too many tests myself yet. With an arg config it shouldn't even matter if soundconfig.xml exists or not.

ronso0 avatar Jul 20 '22 15:07 ronso0

Merge?

ronso0 avatar Aug 02 '22 09:08 ronso0

Just a suggestion (not blocking merge or something), but if you can't specify full paths anyway, why not just dictate a naming scheme for the sake of shorter command lines?

For example, instead of:

mixxx --sound-config soundconfig_DDJ-SB3_NIAudio8.xml

we could use:

mixxx --sound-config DDJ-SB3_NIAudio8

And mixxx creates the filename from the name automatically?

Holzhaus avatar Aug 02 '22 12:08 Holzhaus

Sure, that makes sense. Tbh I consider this PR a temporary solution, so I'd rather implement this in #4862. There, only the basenames are visible in the preferences so we'd (re)construct the file paths anyway.

ronso0 avatar Aug 02 '22 16:08 ronso0

When reworking and simplifying #4862 it turned out that all the file(name) handling should rather happen in SoundManager, thus I suspend this one. Actually, dealing with filenames in general and in particular legacy soundconfig.xml is the bulk of the work :\

ronso0 avatar Aug 03 '22 12:08 ronso0

I'm closing this. Sound config via command line is part of #4862 now

ronso0 avatar Aug 10 '22 19:08 ronso0

Thanks for the review @Swiftb0y

ronso0 avatar Aug 10 '22 19:08 ronso0