Will try now with a debug build, but so far, I've got this.
Thread 33 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 12632.0x2948]
0x005bb0ea in sb_get_buffer_emu8k ()
(gdb) bt
#0 0x005bb0ea in sb_get_buffer_emu8k ()
#1 0x0057bce4 in sound_poll ()
#2 0x005c4ebf in timer_process ()
#3 0x00483532 in exec386_dynarec ()
#4 0x0055f5c5 in runpc ()
#5 0x0067e4a9 in mainthread ()
#6 0x6c991bd8 in ?? () from D:\msys64\mingw32\bin\SDL2.dll
#7 0x6c9e558e in ?? () from D:\msys64\mingw32\bin\SDL2.dll
#8 0x769f67f1 in msvcrt!_beginthreadex () from C:\WINDOWS\System32\msvcrt.dll
#9 0x769f68b1 in msvcrt!_endthreadex () from C:\WINDOWS\System32\msvcrt.dll
#10 0x73ab8654 in KERNEL32!BaseThreadInitThunk ()
from C:\WINDOWS\System32\kernel32.dll
#11 0x76f84a77 in ntdll!RtlGetAppContainerNamedObjectPath ()
from C:\WINDOWS\SYSTEM32\ntdll.dll
#12 0x76f84a47 in ntdll!RtlGetAppContainerNamedObjectPath ()
from C:\WINDOWS\SYSTEM32\ntdll.dll
#13 0x00000000 in ?? ()
EDIT: In debug it doesn't crash, but the release backtrace might indicate that the changes for the dynamic filter are the culprit.
I don't quite like the fact of using a static local variable, and also, the filter coefficients are not initialized at startup, only when the card is configured by an application, but at that time, the audio buffer is already running.
EDIT2: Should I mention that the "pos" variable should also be "per channel"?
EDIT3: Aside of the crash, the implementation of the filter is definitely broken. Printing the coeffs for frequency 45454 gives this result:
I'll take a look and try to fix, if yo don't do that faster than me.
Code: Select all
1: 0.000014
2: -0.000051
3: 0.000097
4: -0.000131
5: 0.000122
6: -0.000025
7: -0.000216
8: 0.000672
9: -0.001422
10: 0.002551
11: -0.004144
12: 0.006269
13: -0.008975
14: 0.012278
15: -0.016153
16: 0.020528
17: -0.025284
18: 0.030256
19: -0.035240
20: 0.040011
21: -0.044331
22: 0.047971
23: -0.050732
24: 0.052456
25: 0.946958
26: 0.052456
27: -0.050732
28: 0.047971
29: -0.044331
30: 0.040011
31: -0.035240
32: 0.030256
33: -0.025284
34: 0.020528
35: -0.016153
36: 0.012278
37: -0.008975
38: 0.006269
39: -0.004144
40: 0.002551
41: -0.001422
42: 0.000672
43: -0.000216
44: -0.000025
45: 0.000122
46: -0.000131
47: 0.000097
48: -0.000051
49: 0.000014
50: 0.000000