negdo / Sound_Nodes

Unleash the power of sound in your Blender animations with Sound Nodes! Easily analyze audio, harness its features in Geometry Nodes, and create stunning audio-visual masterpieces.
GNU General Public License v3.0
26 stars 3 forks source link

crashes on analyze #5

Open kevchat82 opened 12 months ago

kevchat82 commented 12 months ago

This addon is crashing blender. As soon as i click on analyze audio, blender closes. when i check crash log there is no backtrace sound nodes test.crash.txt Tested in blender 3.6.4 and 3.6.2 This is my first time making an issue request, please let me know if i need to include anything else. Thank you

negdo commented 12 months ago

Haven't seen such behaviour of the addon yet, and Blender is not supposed to crash even when errors appear in addons. Might be something connected to Linux operating system. Have you followed the installation instructions? Specifically, I would like to know, if you have clicked on "Install Requirements" button in the addon panel.

kevchat82 commented 12 months ago

Yes, i installed requirements, and clicking the test button shows that they are installed.

negdo commented 11 months ago

Can you please do the following tests, which might help determine, where the problem originates from?

properties = bpy.context.scene.sound_nodes
import librosa
y, sr = librosa.load(properties.audio_source)
spectrogram = librosa.feature.melspectrogram(y=y, sr=sr, hop_length=int(sr/24), n_mels=8)

I suspect one of these lines could cause an error or crash.

zERO123331 commented 9 months ago

i have a simillar problem and for me it crashes after the 3rd line

negdo commented 9 months ago

@zERO123331 More information about your situation would very be helpful. Which Blender version are you running and on what OS? Which version of sound nodes addon do you have installed? What is the console output when you run the code?

tavasti commented 8 months ago

I am also having crash in analyze. Empty project, added audio as wav, press analyze and getting crash. blender.crash.txt

tavasti commented 8 months ago

Tested also with Blender 3.6.2, crashes also with it in analyze.

FuzzyExpress commented 8 months ago

Same issue here! I tried all 3 versions, SoundNodes - Blender 4.zip SoundNodes.zip (Blender 3?) and Sound_Nodes-main.zip (downloaded the github)

Operation system: Kubuntu 23.10 | KDE Plasma 5.27.8 | Wayland | 6.6.8-x64v3-xanmod1 Kernel.

I tried the trouble shooting steps as shown:

properties = bpy.context.scene.sound_nodes
import librosa
y, sr = librosa.load(properties.audio_source) # the frame counter appears on the mouse
# like it does for baking, then crashes a second later.

Nothing interesing or helpful was left in the Console, just Segmentation fault (core dumped).

blender.crash.txt No python backtrack oddly

I'm going to try a different file type, will let know what happens. Edit: I tried mp3 & ogg, same errors, could not figure out how to make a flac file. I'll try using my Windows 11 install tomorrow or Tuesday and see if it works there. Edit2: It works exactly as expected on Windows 11.

FuzzyExpress commented 8 months ago

I figured I'd try using the system librosa instead of the one installed on Blender, I slapped:

import sys   # at top of compute.py
...  
        sys.path.append('/home/fexp/.local/lib/python3.11/site-packages')  # added line ~72
        global librosa  # unchanged
        import librosa

to compute.py to use this system package instead

When trying to run it: it makes this funny error:

error.kate.txt

I did have another idea though, instead of running librosa inside blender, we could run it outside blender and save it to a file, and import that with blender.

negdo commented 8 months ago

What version of the librosa library did you install? Potentially that can be related to the error. Make sure you install version 0.9.2. Latest version doesn't work with the current code in the addon.

pip install librosa==0.9.2
FuzzyExpress commented 8 months ago

I did indeed have the wrong version leading to that error. I installed librosa 0.9.2, same crash as before, I also tried updating pip and force reinstalling librosa, also crashed. I also tried the test file you sent on BlenderMarket, same crash. blender.crash.txt

Edit: I did also come accross this issue Error with librosa.load() #536 I am going to mess around with that and see if anything comes of it I have no idea what any of that code means. I did figure out that that running librosa by itself works great. Yet running the same code in blender, be it using the system package or installed in blender, crashes on librosa.load(), which is very bizarre.

Update:

I edited copied the librosa stuff from the compute.py file into a new file and make it so it writes a dictionary with all the data to a file. and I made put a loader into the original compute.py to load the music data into the geometry nodes system. It's very wack to use, is very hardcoded and requires manual removal of the numpy syntax from the file to load it, but at least it works!