Hi Dennis, Robert,
Ok. This problem became more clear now.
- default template was saved some time ago with precount flag enabled,
and it made all new songs based on this template copy this flag too.
- when this flag is set and jack backend is used, timing problem occurs
if you try to start a song, and then everything can be completely broken.
for test: run muse under gdb, load a song and start to play it. after
some time (10-15 seconds) hit ctrl+c in gdb to pause the program. wait
for ~1 minute and then write 'cont' and press enter. Something strange
will happen - muse will try to catch up with jack time. It seems, that
this problem happens with precount flag set to 'true' too.
P.S. this happens with jack2. jack1 simply kills program by timeout.
Probably we should simply ignore it as Robert suggested. Dennis's patch
already did it. So, if we all agree with this, lets disable it :).
05.01.2016 00:56, Robert Jonsson пишет:
Hi Dennis,
Sorry for dropping the ball last time around but good that we finally
got to the bottom of this.
So, since precount doesn't work we might add some precautions so this
flag is not read (comment it out I guess). What do you think Andrew?
Regards,
Robert
2016-01-04 21:49 GMT+01:00 Dennis Schulmeister
<[email protected] <mailto:[email protected]>>:
Hi Andrew,
Thanks for the quick reply.
On Mon, 4 Jan 2016 02:55:50 +0400
Andrew Deryabin <[email protected] <mailto:[email protected]>> wrote:
> Your problem (as seen from your patch) is that
> MusEGlobal::precountEnableFlag is always 'on'?
I did more detailed tests today and found out that the flag is set
when
a song is loaded. I have a default song which is loaded on startup.
This file contains <precountEnable>1</precountEnable> which sets the
runtime flag.
This is the console output when I tried to record:
MusEGlobal::precountEnableFlag=1
state = PRECOUNT!
JACK: state transition PRECOUNT -> PLAY ?
JACK: state transition PRECOUNT -> PLAY ?
JACK: state transition PRECOUNT -> PLAY ?
JACK: state transition PRECOUNT -> PLAY ?
...
JACK: state transition PRECOUNT -> STOP ?
JACK: state transition PRECOUNT -> STOP ?
JACK: state transition PRECOUNT -> STOP ?
JACK: state transition PRECOUNT -> STOP ?
The "state transition" messages also come from audio.cpp. They log how
MusE gets confused because jack state doesn't match sequencer state.
Changing the default song to <precountEnable>0</precountEnable> made
recording work again:
MusEGlobal::precountEnableFlag=0
The same is true for any song not only the default song. The flag is
always retrieved from the song file. I checked some old files in order
to confirm.
Now to the metronome settings dialog. Here you can see a checkbox
which
shows whether the runtime flag is set. But you cannot change it here.
Almost all precount settings are greyed out with a tooltip saying
"disabled since jack cannot handle it".
See this image: http://www.pingu-mobil.de/share/metronome-alsa.png
There is also no difference between the Jack backend and the ALSA
backend. Starting MusE with "muse3 -a" I repeated all tests with an
ALSA MIDI interface. I configured a new MIDI interface this time using
ALSA instead of JACK and had exactly the same results:
* precount flag is read from the song file
* precount settings in metronome dialog are greyed out
* enabled precount flag confuses the sequencer
All in all it seems the precount is completely broken. But at least
there is a workaround in order to be able to record. However I do
wonder if precount really cannot work with jack:
* When there is no jack time master: Precount should be possible
just like with ALSA
* When MusE is the time master: Do the precount and then start
rolling. Time slaves will remain inactive during precount.
* When MusE is time slave: Precount doesn't make sense anyway.
Then I found out more about my other problem:
> 04.01.2016 01:58, Dennis Schulmeister пишет:
> > Playback doesn't work anymore. The sequencer rolls incredibly slow
> > and the MIDI messages are not sent in time.
I didn't find out why but it turned out that startRolling() is called
called each time the sequencer tries to advance time.
MusEGlobal::precountEnableFlag=0
MusEGlobal::precountEnableFlag=0
MusEGlobal::precountEnableFlag=0
MusEGlobal::precountEnableFlag=0
MusEGlobal::precountEnableFlag=0
MusEGlobal::precountEnableFlag=0
...
The strange thing is that the problem is now gone. For testing I
loaded
some old songs and they played fine. Then back to my default song and
the problem reoccurred. When I compared the XMLs I found only minor
differences:
* The default song didn't contain MIDI data, obviously
* <precountEnable>1</precountEnable> in the default song
* <master>0</master> in the default song
* The default song contained two Jack routes which were
accidentally created
So I changed the two flags in the default song and removed the jack
routes and all of a sudden playback worked again. Most strange ...
Dennis
------------------------------------------------------------------------------
_______________________________________________
Lmuse-developer mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/lmuse-developer
------------------------------------------------------------------------------
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer
--
Regards,
Andrew
------------------------------------------------------------------------------
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer