On Tue, Oct 25, 2011 at 12:43 AM, Yclept Nemo <orbisvi...@gmail.com> wrote:
> On Mon, Oct 24, 2011 at 7:03 PM, Yclept Nemo <orbisvi...@gmail.com> wrote:
>> Versions:
>> Salamander Grand Piano V2
>> liblscp-svn 2132
>> libgig-svn 2274
>> linuxsampler-svn 2277
>> qsampler-svn 2271
>>
>> For the most part the setup works very well, except that it is limited
>> in the number of voices (amount of notes). Too many notes, and
>> LinuxSampler only plays silence.
>>
>> If during runtime (via qsampler), I increase the maximum number of
>> voices and the maximum number of disk streams to 128 and 180
>> respectively, LinuxSampler segfaults. The backtrace is too large to
>> attach, so I mirrored it as an attachment at
>> http://hpaste.org/raw/53096. [Note: An identical email containing the
>> attachment is still awaiting moderator approval]
>>
>> If I compile LinuxSampler with --enable-max-streams=180
>> --enable-max-voices=128, then while loading the SFZ file, LinuxSampler
>> gives the following error:
>> LSCPServer: Client connection established on socket:4.
>> LSCPServer: Client connection established on socket:5.
>> Starting disk thread...OK
>> Scheduling 
>> '/storage/samples/gigasamples/piano/salamander.grand.piano.v2/SalamanderGrandPianoV2_48khz24bit/SalamanderGrandPianoV2.sfz'
>> (Index=0) to be loaded in background (if not loaded yet).
>> Loading sfz file
>> '/storage/samples/gigasamples/piano/salamander.grand.piano.v2/SalamanderGrandPianoV2_48khz24bit/SalamanderGrandPianoV2.sfz'...OK
>> Loading sfz instrument
>> ('/storage/samples/gigasamples/piano/salamander.grand.piano.v2/SalamanderGrandPianoV2_48khz24bit/SalamanderGrandPianoV2.sfz',0)...OK
>> Caching initial samples...sfz::Engine error: Failed to load
>> instrument, cause: Unknown exception while trying to parse sfz file.
>>
>> I've narrowed the problem down to the maximum number of disk streams.
>> For example I can increase the maximum number of voices to 256 without
>> problem (> maximum number of disk streams which is 90), but the
>> error/segfault occurs when the maximum number of disk streams reaches
>> somewhere around 105-115.
>>
>> Solution would be great. I'm not playing a symphony here, just a
>> simple one-piano piece (no more than 6 1/8 notes at a time).
>>
>
> Clarification:
>
> 1] Segfault:
> The segfault is only triggered when changing the number of disk
> streams during runtime *and* when an instrument/channel is currently
> loaded
>
> 2] Error:
> The error only happens if GetChannelInfo is called before
> EngineChannelBase finishes caching the samples. For example, if the
> cache is not finalized you see something like the following. (Notice
> "INSTRUMENT_STATUS: -4", this is the error QSampler displays).
>
> EngineChannelBase: progress 36EngineChannelBase: progress 36
> RenderAudio(Samples=1024)
> Condition::WaitIf: bCondition=0  TimeoutSeconds=0  TimeoutNanoSeconds=0
> Condition::Waitif() -> LOCK()
> Condition::Waitif() -> LOCK() passed
> Condition::Set() -> LOCK()
> Condition::Set() -> LOCK() passed
> Condition::Set() -> broadcasting 'false' condition
> Condition::WaitIf: bCondition=0  TimeoutSeconds=0  TimeoutNanoSeconds=0
> Condition::Waitif() -> LOCK()
> Condition::Waitif() -> LOCK() passed
> Condition::Waitif() -> waiting for 'true' condition
> RenderAudio(Samples=1024)
> RenderAudio(Samples=1024)
> RenderAudio(Samples=1024)
> RenderAudio(Samples=1024)
> RenderAudio(Samples=1024)
> LSCPServer: Got command on socket -1, calling parser.
> LSCPServer: [GET CHANNEL INFO 0
> ]
> LSCPServer: GetChannelInfo(SamplerChannel=0)
> LSCPServer::AnswerClient(ReturnMessage=ENGINE_NAME: SFZ
> VOLUME: 1.000
> AUDIO_OUTPUT_DEVICE: 0
> AUDIO_OUTPUT_CHANNELS: 2
> AUDIO_OUTPUT_ROUTING: 0,1
> MIDI_INPUT_DEVICE: 0
> MIDI_INPUT_PORT: 0
> MIDI_INPUT_CHANNEL: 0
> INSTRUMENT_FILE:
> /storage/samples/gigasamples/piano/salamander.grand.piano.v2/SalamanderGrandPianoV2_48khz24bit/SalamanderGrandPianoV2.sfz
> INSTRUMENT_NR: 0
> INSTRUMENT_NAME:
> INSTRUMENT_STATUS: -4
> MUTE: false
> SOLO: false
> MIDI_INSTRUMENT_MAP: 0
> .
> )LSCPServer: Done parsing on socket -1.
>
> For some strange reason, it seems the greater the number of disk
> streams, either the longer it takes for the sample cache to be
> generated, or the sooner GetChannelInfo is called.
>
> The error basically prevents LinuxSampler from working: any subsequent
> operations, such as Quiting or Removing-the-Channel, all throw the
> same Error:-4.
>

I traced the second error down to
LinuxSampler::SampleFile::LoadSampleDataWithNullSamplesExtension,
realized it had to do with memory, and raised the memlock (max locked
memory) for the @audio group to 800000.
Now I no longer have any problems with this particular instrument.

Is it possible to get a better error message for this particular type
of problem? I notice in Thread.cpp that the return value of the only
system call affected by RLIMIT_MEMLOCK is checked:

    if (mlockall(MCL_CURRENT | MCL_FUTURE) < 0) {
        std::cerr << "Thread: WARNING, can't mlockall() memory!\n"

However, is it possible to check future pages as well, especially when
caching samples?

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to