New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore release frames for single-streamed instruments #3900

Merged
merged 4 commits into from Oct 23, 2017

Conversation

Projects
None yet
2 participants
@PhysSong
Member

PhysSong commented Oct 22, 2017

Fixes #3899 by letting InstrumentSoundShaping::releaseFrames() check Instrument::IsSingleStreamed flag.
There is one further option, disabling volume envelope when a single-streamed instrument is dropped(or even loaded). However, this change seems enough.

@PhysSong PhysSong requested a review from zonkmachine Oct 22, 2017

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 22, 2017

Member

Getting there. The issue is still present for cutoff and resonance.

Member

zonkmachine commented Oct 22, 2017

Getting there. The issue is still present for cutoff and resonance.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 22, 2017

Member

True. There was a mistake and now fixed.

Member

PhysSong commented Oct 22, 2017

True. There was a mistake and now fixed.

PhysSong added some commits Oct 22, 2017

Add safety check logic
If m_instrumentTrack->instrument() is NULL, there's no reason to return non-zero value in InstrumentSoundShaping::releaseFrames(). And such situation shouldn't occur anymore.
@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 22, 2017

Member

@zonkmachine Now everything is done. Could you re-test it now?

Member

PhysSong commented Oct 22, 2017

@zonkmachine Now everything is done. Could you re-test it now?

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 22, 2017

Member

Now release doesn't seem to work.

Member

zonkmachine commented Oct 22, 2017

Now release doesn't seem to work.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 22, 2017

Member

Yes. I put ! by mistake... Fixed by 6ad5b0b.

Member

PhysSong commented Oct 22, 2017

Yes. I put ! by mistake... Fixed by 6ad5b0b.

@zonkmachine

Testing: 👍

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 23, 2017

Member

Just got a crash around where you're coding here but on my 'automation' branch (which doesn't touch anything there, so basically stable-1.2).

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000524ef0 in InstrumentSoundShaping::releaseFrames (this=0x100007bd60)
    at /home/zonkmachine/builds/lmms/lmms/src/core/InstrumentSoundShaping.cpp:307
307			? m_instrumentTrack->instrument()->desiredReleaseFrames()
(gdb) bt
#0  0x0000000000524ef0 in InstrumentSoundShaping::releaseFrames (this=0x100007bd60)
    at /home/zonkmachine/builds/lmms/lmms/src/core/InstrumentSoundShaping.cpp:307
#1  0x000000000053d229 in NotePlayHandle::actualReleaseFramesToDo (this=0x10000302f8) at /home/zonkmachine/builds/lmms/lmms/src/core/NotePlayHandle.cpp:400
#2  0x000000000053ce08 in NotePlayHandle::framesLeft (this=0x10000302f8) at /home/zonkmachine/builds/lmms/lmms/src/core/NotePlayHandle.cpp:321
#6  0x000000000051c04b in MixerWorkerThread::addJob (_job=0x10000302f8) at /home/zonkmachine/builds/lmms/lmms/include/MixerWorkerThread.h:87
#7  0x0000000000536d5a in MixerWorkerThread::fillJobQueue<QList<PlayHandle*> > (_vec=..., _opMode=MixerWorkerThread::JobQueue::Static)
    at /home/zonkmachine/builds/lmms/lmms/include/MixerWorkerThread.h:99
#8  0x0000000000533cbe in Mixer::renderNextBuffer (this=0x10337d0) at /home/zonkmachine/builds/lmms/lmms/src/core/Mixer.cpp:439
#9  0x0000000000535827 in Mixer::fifoWriter::run (this=0x14cba40) at /home/zonkmachine/builds/lmms/lmms/src/core/Mixer.cpp:1103
#10 0x00007f6ec092332f in QThreadPrivate::start (arg=0x14cba40) at thread/qthread_unix.cpp:349
#11 0x00007f6ec1c98184 in start_thread (arg=0x7f6e777fe700) at pthread_create.c:312
#12 0x00007f6ebe025ffd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
Member

zonkmachine commented Oct 23, 2017

Just got a crash around where you're coding here but on my 'automation' branch (which doesn't touch anything there, so basically stable-1.2).

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000524ef0 in InstrumentSoundShaping::releaseFrames (this=0x100007bd60)
    at /home/zonkmachine/builds/lmms/lmms/src/core/InstrumentSoundShaping.cpp:307
307			? m_instrumentTrack->instrument()->desiredReleaseFrames()
(gdb) bt
#0  0x0000000000524ef0 in InstrumentSoundShaping::releaseFrames (this=0x100007bd60)
    at /home/zonkmachine/builds/lmms/lmms/src/core/InstrumentSoundShaping.cpp:307
#1  0x000000000053d229 in NotePlayHandle::actualReleaseFramesToDo (this=0x10000302f8) at /home/zonkmachine/builds/lmms/lmms/src/core/NotePlayHandle.cpp:400
#2  0x000000000053ce08 in NotePlayHandle::framesLeft (this=0x10000302f8) at /home/zonkmachine/builds/lmms/lmms/src/core/NotePlayHandle.cpp:321
#6  0x000000000051c04b in MixerWorkerThread::addJob (_job=0x10000302f8) at /home/zonkmachine/builds/lmms/lmms/include/MixerWorkerThread.h:87
#7  0x0000000000536d5a in MixerWorkerThread::fillJobQueue<QList<PlayHandle*> > (_vec=..., _opMode=MixerWorkerThread::JobQueue::Static)
    at /home/zonkmachine/builds/lmms/lmms/include/MixerWorkerThread.h:99
#8  0x0000000000533cbe in Mixer::renderNextBuffer (this=0x10337d0) at /home/zonkmachine/builds/lmms/lmms/src/core/Mixer.cpp:439
#9  0x0000000000535827 in Mixer::fifoWriter::run (this=0x14cba40) at /home/zonkmachine/builds/lmms/lmms/src/core/Mixer.cpp:1103
#10 0x00007f6ec092332f in QThreadPrivate::start (arg=0x14cba40) at thread/qthread_unix.cpp:349
#11 0x00007f6ec1c98184 in start_thread (arg=0x7f6e777fe700) at pthread_create.c:312
#12 0x00007f6ebe025ffd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 23, 2017

Member

What were you doing when it crashed?

Member

PhysSong commented Oct 23, 2017

What were you doing when it crashed?

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 23, 2017

Member

I think I pressed either of the Open existing project and Open Recenty opened projects buttons while looping a track.

Member

zonkmachine commented Oct 23, 2017

I think I pressed either of the Open existing project and Open Recenty opened projects buttons while looping a track.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 23, 2017

Member

I think it's a separate issue and very rare one. It is "dereferencing a deallocated pointer" problem. There are several approaches to fix it. I guess it could be fixed easily if needed.

Member

PhysSong commented Oct 23, 2017

I think it's a separate issue and very rare one. It is "dereferencing a deallocated pointer" problem. There are several approaches to fix it. I guess it could be fixed easily if needed.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 23, 2017

Member

OK. Open a separate issue for it?
Merge #3900?

Member

zonkmachine commented Oct 23, 2017

OK. Open a separate issue for it?
Merge #3900?

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 23, 2017

Member

I'll merge it after about 10 hours.

Open a separate issue for it?

Well, I don't think that's a major bug. Anyway, you may do so if needed.

Member

PhysSong commented Oct 23, 2017

I'll merge it after about 10 hours.

Open a separate issue for it?

Well, I don't think that's a major bug. Anyway, you may do so if needed.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 23, 2017

Member

No separate issue. If you search the site you get this discussion anyway so it's already documented.

Member

zonkmachine commented Oct 23, 2017

No separate issue. If you search the site you get this discussion anyway so it's already documented.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 23, 2017

Member

If you search the site you get this discussion anyway so it's already documented.

Where can I find that?

Member

PhysSong commented Oct 23, 2017

If you search the site you get this discussion anyway so it's already documented.

Where can I find that?

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 23, 2017

Member

I mean when you search for a part of the backtrace. Like this.

Member

zonkmachine commented Oct 23, 2017

I mean when you search for a part of the backtrace. Like this.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Oct 23, 2017

Member

Though I think the ctash is not really relevant to this PR, fixing that isn't harmful. I suggest fixing it later, but it can be done now if needed.

Member

PhysSong commented Oct 23, 2017

Though I think the ctash is not really relevant to this PR, fixing that isn't harmful. I suggest fixing it later, but it can be done now if needed.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Oct 23, 2017

Member

You call the shots here. Fixing later is fine by me.

Member

zonkmachine commented Oct 23, 2017

You call the shots here. Fixing later is fine by me.

@PhysSong PhysSong merged commit de20d76 into LMMS:stable-1.2 Oct 23, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@PhysSong PhysSong deleted the PhysSong:singlestream-noenv branch Oct 23, 2017

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine May 12, 2018

Member

Got another crash like the one in #3900 (comment) when poking the arpeggiator release time in #4355.

I was just listening to a four beat groove when it took a dive. By judging from the backtrace it crashed when looping back to the beginning.

last_metro_pos = {<MidiTime> = {m_ticks = -1, static s_ticksPerTact = 192}, m_timeLine = 0x0, m_currentFrame = 0}

Full backtrace in gist here.

Member

zonkmachine commented May 12, 2018

Got another crash like the one in #3900 (comment) when poking the arpeggiator release time in #4355.

I was just listening to a four beat groove when it took a dive. By judging from the backtrace it crashed when looping back to the beginning.

last_metro_pos = {<MidiTime> = {m_ticks = -1, static s_ticksPerTact = 192}, m_timeLine = 0x0, m_currentFrame = 0}

Full backtrace in gist here.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong May 13, 2018

Member

@zonkmachine Do you remember which instrument was playing? Or do you know steps to reproduce?

Member

PhysSong commented May 13, 2018

@zonkmachine Do you remember which instrument was playing? Or do you know steps to reproduce?

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine May 13, 2018

Member

No steps to reproduce. It's just one kick and an arpeggiated lb302 running over 4 beats. I'll try and see if I can make it crash again. I'll leave it up and running until something happens. Just one instrument so there'll be no doubt on the matter.

Member

zonkmachine commented May 13, 2018

No steps to reproduce. It's just one kick and an arpeggiated lb302 running over 4 beats. I'll try and see if I can make it crash again. I'll leave it up and running until something happens. Just one instrument so there'll be no doubt on the matter.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine May 13, 2018

Member

8 hours and not a glitch. I think I need a plan for testing this on a larger scale.

Member

zonkmachine commented May 13, 2018

8 hours and not a glitch. I think I need a plan for testing this on a larger scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment