Closed emlyn closed 2 years ago
I can replicate the seg fault on my Linux system before playing audio (after starting a run it enables just fine)
It looks like that scope expects at least 1024 audio samples from the audio processor (see here and here in scope_window.cpp), but only 1 fake sample is initialized in that buffer before a run (see here in scope_window.cpp). That causes a seg fault when that scope tries to access nonexistent samples when it is enabled before audio (but work just fine after that sample buffer has been filled once)
Those files were last changed in #2644 so @cmaughan may have more insight. The fix may be to either initialize 4096 samples (the fixed FrameSamples
from scope.cpp) in the code here or have the Lissajous scope dynamically calculate samples and not assume 1024 samples (the fixed LissajousSamples
in scope_window.cpp)
On Windows I don't get a segfault, but none of the "Scope Kinds" toggles have any effect. This may or may not be related.
I can confirm that if I make it play something first, then I can enable the Lissajous scope, but then when I quit and restart, it crashes immediately on startup. I had to edit the gui-settings.ini file to set scope\show-lissajous=false
before it would start up.
Since this is something I wrote, I'll get around to fixing it this week; sorry for the trouble.
@cmaughan if you manage to find some time - that would be amazing!
Is like to add a new visualiser, just haven't thought of a good one yet.
Is like to add a new visualiser, just haven't thought of a good one yet.
What about some sort of blur/shift+blur/rotate+blur modifier to the existing visualisers. Just thinking of the good old winamp days!
Do you have an example?
On Tue, Mar 22, 2022 at 5:53 PM Sam Aaron @.***> wrote:
Is like to add a new visualiser, just haven't thought of a good one yet.
What about some sort of blur/shift+blur/rotate+blur modifier to the existing visualisers. Just thinking of the good old winamp days!
— Reply to this email directly, view it on GitHub https://github.com/sonic-pi-net/sonic-pi/issues/3027#issuecomment-1075445696, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5M73WP5RX3F7MUKB7WLLVBICH5ANCNFSM5PIARJPA . You are receiving this because you were mentioned.Message ID: @.***>
Is like to add a new visualiser, just haven't thought of a good one yet.
What about some sort of blur/shift+blur/rotate+blur modifier to the existing visualisers. Just thinking of the good old winamp days!
A (configurable?) persistence, like an old phosphor oscilloscope, on at least the lissajous mode would be awesome (i.e. when something is drawn it slowly fades instead of disappearing as soon as the next frame is displayed). Maybe even infinite persistence, with a command to clear it?
Also, a minor annoyance: it seems that the y axis points downwards - it would be nicer if it points upwards (not that it makes any difference for normal use cases!).
You can probably tell that I've been playing around with Lissajous figures recently 🙂, I'll try to clean things up and post my explorations to in-thread soon.
Just thinking aloud... every time the scope is about to be redrawn, instead of just clearing it and drawing the new frame, you could have a set of configurable transforms that you apply to the current display, and then draw the new frame on top. You could blur it, rotate it, translate it, fade it (maybe others, and all with parameters configurable from code, so the effect can be changed dynamically). Current behaviour could be reproduced by having 100% fade. Less than 100% would give the phosphor effect. Adding varying amounts of blur/rotation etc. would produce the WinAmp style effects that I think Sam is referring to.
Yep, I was just thinking about the kind of thing @emlyn has described in way more detail.
v4 is now released.
The effect you describe isn't hard; but does require blending to the target
On Tue, Mar 22, 2022 at 9:31 PM Sam Aaron @.***> wrote:
Yep, I was just thinking about the kind of thing @emlyn https://github.com/emlyn has described in way more detail.
— Reply to this email directly, view it on GitHub https://github.com/sonic-pi-net/sonic-pi/issues/3027#issuecomment-1075663499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5M75M7ZIRHYXYDOKEOALVBI32BANCNFSM5PIARJPA . You are receiving this because you were mentioned.Message ID: @.***>
I was just trying out the Sonic Pi v4 beta 3 from Patreon (on MacOS), and every time I enable the Lissajous scope in the preferences it immediately crashes with a segmentation violation in the DrawLissajous function (a MacOS problem report window pops up shortly after it dies). I'm on an M1 Mac on MacOS 12.2.1. The other scope modes all work fine, and they all work (including Lissajous) on Sonic Pi 3.3.1.
Here are the error report details:
``` ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: Sonic Pi [72558] Path: /Applications/Sonic Pi v4 BETA 3.app/Contents/MacOS/Sonic Pi Identifier: net.sonic-pi.app Version: 4.0.0 (4.0.0) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2022-02-24 16:38:41.4680 +0000 OS Version: macOS 12.2.1 (21D62) Report Version: 12 Anonymous UUID: E5D3F08D-388C-C4FE-8099-6C60B9DC15A2 Sleep/Wake UUID: 29074F66-A3C8-433C-89DE-663732D404CC Time Awake Since Boot: 87000 seconds Time Since Wake: 915 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000600400116624 Exception Codes: 0x0000000000000001, 0x0000600400116624 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [72558] VM Region Info: 0x600400116624 is not in any region. Bytes after previous region: 16644138533 Bytes before following region: 34850571459036 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL MALLOC_NANO (reserved) 600018000000-600020000000 [128.0M] rw-/rwx SM=NUL ...(unallocated) ---> GAP OF 0x1fb628000000 BYTES MALLOC_MEDIUM 7fb648000000-7fb648800000 [ 8192K] rw-/rwx SM=PRV Kernel Triage: VM - pmap_enter failed with resource shortage Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 Sonic Pi 0x1042ca652 SonicPi::ScopeWindow::DrawLissajous(SonicPi::ProcessedAudio const&, QPainter&, SonicPi::ScopeWindowPanel&) + 466 1 Sonic Pi 0x1042caec4 SonicPi::ScopeWindow::paintEvent(QPaintEvent*) + 1732 2 QtWidgets 0x10f3dff95 QWidget::event(QEvent*) + 1093 3 QtWidgets 0x10f3a6a56 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 262 4 QtWidgets 0x10f3a7e02 QApplication::notify(QObject*, QEvent*) + 466 5 QtCore 0x111e6c2b6 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 166 6 QtWidgets 0x10f3d9f0b QWidgetPrivate::sendPaintEvent(QRegion const&) + 43 7 QtWidgets 0x10f3b4099 0x10f393000 + 135321 8 QtWidgets 0x10f3b42b2 0x10f393000 + 135858 9 QtWidgets 0x10f3e01be QWidget::event(QEvent*) + 1646 10 QtWidgets 0x10f4f1094 QMainWindow::event(QEvent*) + 276 11 QtWidgets 0x10f3a6a56 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 262 12 QtWidgets 0x10f3a7e02 QApplication::notify(QObject*, QEvent*) + 466 13 QtCore 0x111e6c2b6 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 166 14 QtCore 0x111e6d3f3 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 803 15 libqcocoa.dylib 0x1116a8892 0x11166c000 + 247954 16 libqcocoa.dylib 0x1116a8f98 0x11166c000 + 249752 17 CoreFoundation 0x7ff80d274c08 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 18 CoreFoundation 0x7ff80d274b70 __CFRunLoopDoSource0 + 180 19 CoreFoundation 0x7ff80d2748e3 __CFRunLoopDoSources0 + 242 20 CoreFoundation 0x7ff80d2732ff __CFRunLoopRun + 897 21 CoreFoundation 0x7ff80d2728a9 CFRunLoopRunSpecific + 567 22 HIToolbox 0x7ff8162fe4f1 RunCurrentEventLoopInMode + 292 23 HIToolbox 0x7ff8162fe118 ReceiveNextEventCommon + 284 24 HIToolbox 0x7ff8162fdfe5 _BlockUntilNextEventMatchingListInModeWithFilter + 70 25 AppKit 0x7ff80fbc8d88 _DPSNextEvent + 886 26 AppKit 0x7ff80fbc73f4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1411 27 AppKit 0x7ff80fbb9919 -[NSApplication run] + 586 28 libqcocoa.dylib 0x1116a7d74 0x11166c000 + 245108 29 QtCore 0x111e686b7 QEventLoop::exec(QFlags