Utilizing My Resources

You're new to the LinuxSampler world? You don't know where to start and nothing works? Here's the place to ask for help.
ccherrett
Advanced User
Posts: 162
Joined: Wed Jan 23, 2008 11:24 pm
Contact:

Re: Utilizing My Resources

Post by ccherrett » Mon Sep 01, 2008 10:38 am

grishata,

OK! Latest CVS Fantasia loads very fast!

Thank you!

Would you use On Demand or On Demand and Hold to load the full orchestra with hundreds of instruments at hundreds of GBs?
Christopher Cherrett
Founder of The Open Octave Project
http://www.openoctave.org

User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

Re: Utilizing My Resources

Post by dahnielson » Mon Sep 01, 2008 11:00 am

I would use "On Demand" as default and "On Demand and Hold" or "Persistent" on the instruments I use the most.

Well, what strategy you use depend on if you're going to load different articulations into separate sample channels having their own assigned MIDI channels, or if you're going to switch between them using program/bank changes. The two basic strategies:
  • Use a few MIDI/Sample channels and switch using program/bank changes. "On Demand and Hold" for a general map or "Persistent" for a customized per project map, because you want them to switch quickly and not wait for them to load.
  • Use plenty of MIDI/Sample channels and only use the map to remotely load instruments into the channels. "On Demand" since you can wait for them to load and don't need to change in the middle of a performance.
Last edited by dahnielson on Mon Sep 01, 2008 1:33 pm, edited 4 times in total.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

grishata
Developer
Posts: 138
Joined: Thu Jan 24, 2008 7:21 pm
Location: Bulgaria
Contact:

Re: Utilizing My Resources

Post by grishata » Mon Sep 01, 2008 1:02 pm

Definitons from the LSCP spec:

"ON_DEMAND" -

The instrument will be loaded when needed, that is when demanded by at least one sampler channel. It will immediately be freed from memory when not needed by any sampler channel anymore.

"ON_DEMAND_HOLD" -

The instrument will be loaded when needed, that is when demanded by at least one sampler channel. It will be kept in memory even when not needed by any sampler channel anymore. Instruments with this mode are only freed when the sampler is reset or all mapping entries with this mode (and respective instrument) are explicitly changed to "ON_DEMAND" and no sampler channel is using the instrument anymore.

"PERSISTENT" -

The instrument will immediately be loaded into memory when this mapping command is sent and the instrument is kept all the time. Instruments with this mode are only freed when the sampler is reset or all mapping entries with this mode (and respective instrument) are explicitly changed to "ON_DEMAND" and no sampler channel is using the instrument anymore.

ccherrett
Advanced User
Posts: 162
Joined: Wed Jan 23, 2008 11:24 pm
Contact:

Re: Utilizing My Resources

Post by ccherrett » Mon Sep 01, 2008 3:46 pm

grishata wrote:Definitons from the LSCP spec:

"ON_DEMAND" -

The instrument will be loaded when needed, that is when demanded by at least one sampler channel. It will immediately be freed from memory when not needed by any sampler channel anymore.

"ON_DEMAND_HOLD" -

The instrument will be loaded when needed, that is when demanded by at least one sampler channel. It will be kept in memory even when not needed by any sampler channel anymore. Instruments with this mode are only freed when the sampler is reset or all mapping entries with this mode (and respective instrument) are explicitly changed to "ON_DEMAND" and no sampler channel is using the instrument anymore.

"PERSISTENT" -

The instrument will immediately be loaded into memory when this mapping command is sent and the instrument is kept all the time. Instruments with this mode are only freed when the sampler is reset or all mapping entries with this mode (and respective instrument) are explicitly changed to "ON_DEMAND" and no sampler channel is using the instrument anymore.
Can you elaborate on the performance hit of reloading samples? Will it effect a midi sequence, or is it just something that will cause problems with realtime performances?

What happens when linuxsampler hits it's RAM limit? Will it xrun or just carry on and not play the sample?

I am playing many scenarios in my head as how to get my full orchestra to play nice with the 8GB or RAM.

Thanks!
Christopher Cherrett
Founder of The Open Octave Project
http://www.openoctave.org

User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

Re: Utilizing My Resources

Post by dahnielson » Mon Sep 01, 2008 4:14 pm

ccherrett wrote:Can you elaborate on the performance hit of reloading samples? Will it effect a midi sequence, or is it just something that will cause problems with realtime performances?
If the samples are already loaded you wont notice a thing when LinuxSampler get a program change message to load them again. If the samples wasn't already loaded you will have to wait for the instrument to finish loading until you can use it (but you can still use the instrument previously loaded on the channel until the new instrument replacing it is fully loaded). AFAIK, loading and unloading of samples will not affect realtime performance (that is causing xruns).
ccherrett wrote:What happens when linuxsampler hits it's RAM limit? Will it xrun or just carry on and not play the sample?
According to Alex, LinuxSampler will simply refuse to load an instrument if there isn't enough RAM.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

Re: Utilizing My Resources

Post by dahnielson » Mon Sep 01, 2008 4:55 pm

ccherrett wrote:I am playing many scenarios in my head as how to get my full orchestra to play nice with the 8GB or RAM.
The best way to find out is to test it...
  • Loading: Create plenty of sample channels and load as many of the instruments you want at a given time, try to max out the system. If you run out of memory LinuxSampler will refuse to load the instrument, but 8 GB is plenty.
  • Polyphony: The polyphony is set at compile time, you can probably safely raise the number of voices (look at this thread about memory to calculate good configuration values to avoid wasting memory).
To display the memory usage in MB, run:

Code: Select all

free -m
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

grishata
Developer
Posts: 138
Joined: Thu Jan 24, 2008 7:21 pm
Location: Bulgaria
Contact:

Re: Utilizing My Resources

Post by grishata » Wed Sep 03, 2008 6:27 pm

It turns out that there were an efficiency issues on LinuxSampler side, too. I just made some optimization and now I can load 800+ MIDI instruments in Fantasia for about 6-7 seconds :)
Hope I didn't break something else, so testing is appreciated!

User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

Re: Utilizing My Resources

Post by dahnielson » Fri Sep 05, 2008 8:35 am

You can also run this in a console if you want to monitor your system memory regularly:

Code: Select all

watch free -m
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

Alex
Moderator
Posts: 316
Joined: Wed Jan 23, 2008 9:08 pm

Re: Utilizing My Resources

Post by Alex » Fri Sep 05, 2008 11:59 am

Grishata,

A challenge with the latest Fantasia. If too many patches are labelled persistent, then during loading i get 'Midi intruments read timed out,' and other failed messages related to the midi and audio devices.

Seems to be a time conflict between all the persistent instruments loading at the same time midi instruments maps, midi devices, and audio devices are being loaded.

I've gone back to demand and hold for now, as this only seems to happen during 'persistent'.


Alex.

grishata
Developer
Posts: 138
Joined: Thu Jan 24, 2008 7:21 pm
Location: Bulgaria
Contact:

Re: Utilizing My Resources

Post by grishata » Fri Sep 05, 2008 1:16 pm

Alex wrote:A challenge with the latest Fantasia. If too many patches are labelled persistent, then during loading i get 'Midi intruments read timed out,' and other failed messages related to the midi and audio devices.
Read timeout occurs when the linuxsampler lscp server is blocked long enough. I should increase the timeout maybe to be at least 1 or 2 minutes, or maybe better make an option to let the user choose from the preferences.
After Read timeout error you should always refresh jsampler by clicking the Refresh toolbar button or choosing Actions/Refresh or hitting F5.

Post Reply