Skip to content

Conversation

milkdropper
Copy link
Collaborator

Some minor things:

  • disabled the compilation of native presets in msvc.
  • suppressed some unnecessary debug output so the console is more clear.
  • made error messages about missing textures more clear (it failed when looking for multiple file extensions).
  • separated the presets from textures folder. Note: loadTextureDir checks dataDir/presets dataDir/textures and the presetURL itself. It's more logical to separate them, and that's what milkdrop did as well.

std::string datadir = "");
~TextureManager();

std::vector<std::string> extensions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls comment

@milkdropper
Copy link
Collaborator Author

milkdropper commented Jun 8, 2020

I did a lot of testing last night with WASAPI enabled, WASAPI disabled, a single input microphone, and multiple input microphones. Based on this testing I made the following changes (some little, and others bigger):

removed some unnecessary debug from console

Issue: selectAudioInput is legacy
It does nothing and returns 0 by default. I removed this.

Issue: input toggling does not work on Windows
On WASAPI devices input toggling will show a toast message and will output to console you are changing devices, but it doesn't actually start listening to your mic or stop listening to the WASAPI loopback. I made changes so you can jump from WASAPI loopback to microphone and back when toggling devices in Windows. From the end user perspective it will seem like there is an additional input source called "capture loopback".

Here is an example of console output you will see on screen (with some lines redacted). The toast messages are similar:

INFO: GL_VERSION: 3.2.0 NVIDIA 446.14
INFO: GL_SHADING_LANGUAGE_VERSION: 1.50 NVIDIA via Cg compiler
INFO: GL_VENDOR: NVIDIA Corporation
INFO: Opened audio capture loopback.
INFO: Opened audio capture device index=0 devId=2: Headset Microphone (HyperX 7.1 Audio)
INFO: Opened audio capture device index=1 devId=2: Rear Mic (Realtek High Definition Audio)
INFO: Opened audio capture device index=2 devId=2: Stereo Mix (Realtek High Definition Audio)
INFO: Opened audio capture loopback.
INFO: Opened audio capture device index=0 devId=2: Headset Microphone (HyperX 7.1 Audio)
INFO: Opened audio capture device index=1 devId=2: Rear Mic (Realtek High Definition Audio)
INFO: Opened audio capture device index=2 devId=2: Stereo Mix (Realtek High Definition Audio)
INFO: Opened audio capture loopback.

Issue: input toggling will crash Windows (eventually)
Each time you input toggle you will register a new device ID (it keeps incrementing). If you keep toggling eventually it will crash with the error "Too many open audio devices". I changed it so it will end the capture with that device ID and reinitialize so it doesn't keep incrementing. I tested a lot to be sure you can reuse the same device ID and change sources with the device Index you pass to it.

Issue: input toggling is pointless when you are not using WASAPI loopback and there is only one audio source
I changed it so if you only have one audio source then input toggling will do nothing and just produce a message to console.

@milkdropper
Copy link
Collaborator Author

milkdropper commented Jun 8, 2020

So it seems like audio input toggling never worked. The mac issue reported #365 is legitimate and also exists in Windows (when WASAPI is not used). You see information about toggling but never stop listening to the first device.

Edit: to be clear, this PR fixes the issue.

@milkdropper milkdropper requested a review from revmischa June 26, 2020 14:16
</Target>
<Target Name="Build-Presets" BeforeTargets="PrepareForBuild">
<Exec Command="xcopy /Y /Q /I &quot;$(MSBuildThisFileDirectory)../presets\presets_tryptonaut&quot; &quot;$(OutDir)presets&quot;" />
<Exec Command="xcopy /Y /Q /I &quot;$(MSBuildThisFileDirectory)../presets\textures_tryptonaut&quot; &quot;$(OutDir)textures&quot;" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance we could install all the presets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course - I was just going with what was done previously. I am not sure if there was a reason to use tryptonaut presets by default.

CurAudioDevice++; // iterate device index
if (CurAudioDevice >= NumAudioDevices) { // We reached outside the boundaries of available audio devices.
CurAudioDevice = 0; // Return to first audio device in the index.
#ifdef WASAPI_LOOPBACK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would really love to see this code live in "driver" subclasses rather than all #ifdef'd in between the rest of the code in this big file someday

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree the #ifdef stuff looks sloppy and confusing when nested like this. I didn't want to undo what someone else did so I kept with it. But hopefully the comments will keep it OK for now.

I did A LOT of testing so it should work on windows / mac without issue.

@milkdropper
Copy link
Collaborator Author

milkdropper commented Jul 4, 2020

I accidentally committed the icon change in c870da3, but since I did I thought it's worth raising.

@coast77777777777 - I assume you made the icon based on the EyeTune concept for the Windows Store. Since you renamed it back from EyeTune to projectM would you consider using this Icon instead? I can share the PSD. I think it's a better idea since it uses the M .tga file from the idle preset and github logo. Here is the image I made

@revmischa
Copy link
Member

I refactored the texture and preset loading code in #385

@revmischa revmischa reopened this Jul 25, 2020
app->init(win, &glCtx);

// if using built in settings then default to full screen.
if (configFilePath.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pmSDL mostly always uses built-in config. It doesn't install the config file by default

{
std::cerr << "Texture loading error for: " << sampler << std::endl;
std::string extensionList = "";
// prepare a list of extensions we looked for, so it's more clear what a texture is in error logs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any extension will work, just the first part of the name should match. i suggest removing this code

@milkdropper
Copy link
Collaborator Author

I reverted:

  • the extension stuff
  • the preset / texture folder move stuff (since you are working on that)
  • the auto fullscreen (that's part of the issue you saw on macOS with Steam - it slows the load and if you don't see the microphone access request it will be a bad first impression).

Copy link
Member

@revmischa revmischa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great lets try it

@revmischa revmischa merged commit c5533e3 into projectM-visualizer:master Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants