[yoshimi] Re: Big MusicClient rewrite :)

  • From: Will Godfrey <willgodfrey@xxxxxxxxxxxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Wed, 30 Dec 2015 21:40:12 +0000

On Thu, 31 Dec 2015 00:51:04 +0400
Andrew Deryabin <andrew@xxxxxxxx> wrote:

Hi Will, All,

Just pushed new commit 131ace1.

Don't panic about 8 removed files. If you will ever need them, you can
checkout any previous commit and they will appear again.

Here is a step-by-step explanation of new changes:

I removed 8 files: AlsaJackClient.cpp/h, JackClient.cpp/h,
JackAlsaClient.cpp/h, AlsaJackClient.cpp/h.
Now all combo driver functionality is handled by one class: MusicClient.

Interface became more universal. How it works:

Here is the function newMusicClient in MusicClient class. Before my
changes this function created default audio/midi driver pair and if this
had no success, yoshimi simply failed to start.

Now the behavior is different.
There are 3 drivers for audio: jack_audio, alsa_audio, null_audio
and 3 drivers for midi: jack_midi, alsa_midi, null_midi.

When creating new music client, default driver pair is tested first. If
it fails, then new algorithm tries to open combos in following order:

jack_audio/jack_midi (if is was not the first)
jack_audio/alsa_midi
alsa_audio/alsa_midi
jack_audio/no_midi
alsa_audio/no_midi
no_audio/no_midi

Now yoshimi will never fail it's startup because of new driver
'no_audio' which is a simple thread, that calls masterAudio at constant
intervals emulating virtual audio device.

Now, if default audio/midi pair fails, no questions are asked and
fallback pairs are probed automatically. Don't know if there is a
probability that user will tap 'No' to question about switching to
alternate pair.


That was remarkably quick work.

I've just checked it out. The changes work well but there is a problem.

When using Jack audio the pitch is shifted about a semitone high, and the
startup message says samplerate is 44.1K although I have jack set to 48K.
If I set jack to 44.1K then it's OK.

--
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
Yoshimi source code is available from either:
http://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: