shorepine / amy

AMY - the Additive Music synthesizer librarY

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on patch 250 (` DX7 LASER GUN `)

RomanKharin opened this issue · comments

I have persistent crash when i load simple test program with sending via wire

import amy
import time

amy.live(0)
print("Get message")
# v0n50l1K250r0Z
msg = amy.message(osc=0, note=50, vel=1, load_patch=250, voices=0)
print(f"{msg=}")
amy.send_raw(msg)

time.sleep(10)

Tested on Ubuntu 20.04
commit 7984420

There is no patch 256 at this time. You can see all the patches here: https://github.com/bwhitman/amy/blob/main/src/patches.h

Sorry for inconvenience. I mean patch 250 (not 256), i've changed title and code sample.

Addenum: tried amy in esp32 and catch same error
Guru Meditation Error: Core 1 panic'ed (Double exception)

Yep, sorry, I see that here too. It's only in linux for me. It plays a simple tone on Mac but doesn't crash. We will take a look

Starting program: /usr/bin/python3 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import amy
>>> amy.live(0)
[New Thread 0xfffff70cf120 (LWP 5556)]
>>> [New Thread 0xfffff5f1f120 (LWP 5557)]

>>> amy.send(voices='0', load_patch=250, note=50, vel=1)
>>> 
Thread 3 "python3" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xfffff5f1f120 (LWP 5557)]
0x0000fffff70e47e4 in play_event (d=...) at amy.c:849
849	        synth[d.osc].wave = *(uint16_t *)&d.data;
(gdb) bt
#0  0x0000fffff70e47e4 in play_event (d=...) at amy.c:849
#1  0x0000fffff70e5e60 in amy_prepare_buffer () at amy.c:1256
#2  0x0000fffff70e623c in amy_simple_fill_buffer () at amy.c:1282

Fixed, thank you! We had MAX_PARAM_LEN (the maximum string length of an AMY parameter) to be 64, and the breakpoint string for this patch was... 65 bytes. We've increased MAX_PARAM_LEN, and this patch sounds great.