drumkv1 icon indicating copy to clipboard operation
drumkv1 copied to clipboard

[NSM] drumkv1 sents lots of dirty messages :)

Open grammoboy2 opened this issue 3 years ago • 8 comments

No, this is not a feature request. ;)

It looks like drumkv1 sents 'dirty' to nsmd whenever there is a change. I think it should just sent it once and sent is_clean as a toggle state.

http://non.tuxfamily.org/nsm/API.html#n:1.2.4.3.

grammoboy2 avatar Jan 26 '22 14:01 grammoboy2

yeah, it should, in an ideal and fully optimal world but nothing (in the API spec at least) makes it sine qua non or does it?

rncbc avatar Jan 26 '22 16:01 rncbc

Once dirty, it's is_dirty, until it's is_clean. The API does not mention it, but I've yet to find a other application that sends 'dirty' after every change. When in doubt, look at how non-daw tools are doing it, I would suggest.

grammoboy2 avatar Jan 26 '22 17:01 grammoboy2

a mitigation to this issue will come shortly, don't despair, thanks

rncbc avatar Jan 26 '22 17:01 rncbc

done in b1e94b8

rncbc avatar Jan 26 '22 18:01 rncbc

Will test, but it needs qt6 apparently.

grammoboy2 avatar Jan 26 '22 18:01 grammoboy2

Will test, but it needs qt6 apparently.

not if you cmake -DCONFIG_QT6=OFF ...

rncbc avatar Jan 26 '22 19:01 rncbc

fix confirmed. thx.

grammoboy2 avatar Jan 26 '22 19:01 grammoboy2

drumkv1 and your other synths sends a dirty message when they're closed / killed in NSM.

grammoboy2 avatar Jun 11 '22 08:06 grammoboy2

If you've a (unreasonable) amount of drumkv1 clients in NSM, it takes a long time to kill them. I was wondering why, is it something in drumkv1, QT, JACK, or is it just the Operating System and expected?

I tried to make sense out of your code as a non-C++ coder to try to understand what is happening after a sigterm signal. It doesn't seems to do a lot (as far as I can tell)... which should be good.

Why is the dirty state touched at sigterm (does it also send a osc msg)? Note that drumkv1 is listed as 'dirty' when it is stopped in NSM. So, there is something wrong.

"as far as NSM goes, we're always filthy!" Why is that?


// SIGTERM signal handler.
void drumkv1_jack_application::handle_sigterm (void)
{
	char c;

	if (::read(g_fdSigterm[1], &c, sizeof(c)) > 0) {
		if (m_pApp && m_pWidget) {
		#ifdef CONFIG_NSM
			if (m_pNsmClient && m_pNsmClient->is_active())
				m_pWidget->updateDirtyPreset(false);
		#endif
			if (m_pWidget->queryClose())
				m_pApp->quit();
		}
	}
}

#endif	// HAVE_SIGNAL_H
// Dirty flag method.
void drumkv1widget_jack::updateDirtyPreset ( bool bDirtyPreset )
{
	drumkv1widget::updateDirtyPreset(bDirtyPreset);

#ifdef CONFIG_NSM
	if (m_pNsmClient && m_pNsmClient->is_active())
		m_pNsmClient->dirty(true); // as far as NSM goes, we're always filthy!
#endif
}

grammoboy2 avatar Nov 24 '22 12:11 grammoboy2

what if you change it to:

// Dirty flag method.
void drumkv1widget_jack::updateDirtyPreset ( bool bDirtyPreset )
{
	drumkv1widget::updateDirtyPreset(bDirtyPreset);

#ifdef CONFIG_NSM
	if (m_pNsmClient && m_pNsmClient->is_active() && bDirtyPreset)
		m_pNsmClient->dirty(true);
#endif
}

rncbc avatar Nov 24 '22 15:11 rncbc

Fixes the 'dirty' issue. Thx.

grammoboy2 avatar Nov 24 '22 21:11 grammoboy2

If you've a (unreasonable) amount of drumkv1 clients in NSM, it takes a long time to kill them. I was wondering why, is it something in drumkv1, QT, JACK, or is it just the Operating System and expected?

Given the fact that I at least can manipulate it with a hack in nsmd, gives me the impression that it might be not the fault of of drumkv1, but more something with nsmd / liblo.

(See issue report: sigkill #82, on the new-session-manager project on github. )

grammoboy2 avatar Nov 26 '22 10:11 grammoboy2