projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 365 forks source link

[APP BUG] Unable to detect input from audio device on macOS #819

Open acherunilam opened 1 week ago

acherunilam commented 1 week ago

Please confirm the following points:

Affected Application

projectM Standalone SDL2 Frontend (includes the Steam app)

Affected Version

4.1.0

Operating System

macOS

Additional Application Details

projectMSDL version: 2.0.0 Built/running with projectM4 version: 4.1.0 Built against SDL version: 2.30.4

MacBook version: Air with M2 chip macOS version: 14.5

I also have Rogue Amoeba's Loopback v2.4.0 installed; not sure how relevant the ARK plugin is to this issue.

Type of Defect

Audio issue (no audio recording, delayed reaction)

Log Output

2024-06-19T07:52:58Z Events enabled: 1
2024-06-19T07:52:58Z Recording audio from device "Default capturing device" (ID -1).
2024-06-19T07:52:58Z Opened audio recording device "System default capturing device" (ID -1) with 2 channels at 44100 Hz.
2024-06-19T07:52:58Z Displaying preset: /Applications/projectM.app/Contents/MacOS//../Resources/Presets/207-wave.milk

Describe the Issue

projectM.app on macOS doesn't seem to be detecting any input from any of my audio devices; I cycled through them all using Cmd + I but it made no difference.

image

Steps to reproduce the issue:

  1. Build and install libprojectM.
    
    mkdir -p "$HOME/tech/projectm" && cd "$_"

brew install cmake git clone https://github.com/projectM-visualizer/projectm && cd projectm git submodule update --init --recursive

mkdir build && cd $_ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. cmake --build . -j sudo cmake --build . --target install

2. Build and install frontend-sdl2.
```bash
mkdir -p "$HOME/tech/projectm" && cd "$_"

brew install sdl2 poco freetype
git clone https://github.com/kblaschke/frontend-sdl2 -b installation-and-packaging && cd frontend-sdl2
sed -i '' 's/"{BUNDLE_BASE_DIR/"\${BUNDLE_BASE_DIR/g' CMakeLists.txt  # bug fix
git submodule update --init --recursive

mkdir build && cd $_
cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/Applications/ ..
cmake --build . --target install
  1. Unbreak app.
    
    install_name_tool -add_rpath /usr/local/lib /Applications/projectM.app/Contents/MacOS/projectMSDL
    codesign --sign - --force --preserve-metadata=entitlements,requirements,flags,runtime /Applications/projectM.app/Contents/MacOS/projectMSDL

cat </Applications/projectM.app/Contents/Info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

CFBundleExecutable projectMSDL CFBundleIdentifier com.example.projectM CFBundleName projectM CFBundleVersion 1.0 NSHighResolutionCapable CFBundleIconFile projectMSDL

EOF

4. Configure app.
```bash
mkdir "$HOME/Library/Preferences/projectM" && cd "$_"
cp /Applications/projectM.app/Contents/Resources/projectMSDL.properties .

wget -P /Applications/projectM.app/Contents/Resources/Presets 'https://raw.githubusercontent.com/projectM-visualizer/projectm/master/presets/tests/207-wave.milk'
  1. Open app.
    open /Applications/projectM.app