Summary: | Saving gig from live mode corrupts the sound | ||
---|---|---|---|
Product: | gigedit | Reporter: | Anders Dahnielson <anders> |
Component: | gigedit | Assignee: | Christian Schoenebeck <cuse> |
Status: | CLOSED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | SVN Trunk | ||
Hardware: | PC | ||
OS: | Linux | ||
URL: | https://bb.linuxsampler.org/viewtopic.php?f=2&t=44&p=283#p275 |
Description
Anders Dahnielson
2008-02-10 00:58:22 CET
This is, at least, a bug in libgig, in the RIFF:Save() function. A fix is in CVS now. I'll keep the report open until I hear if it works for you. 1) Created a new gig in stand alone mode: a velocity dimensions with two zones
at C3, added one sample to the gig and first zone, saved it.
2) Loaded it in LinuxSampler, opened gigedit in live mode and added a second
sample to the gig and second zone.
3) Hit the C3 key on my keyboard lightly, producing the first sample as expected.
4) Hit the C3 key again, this time harder, producing a corrupt playback of the
second zone.
5) Get XRUN when LinuxSampler segfaults:
Loading instrument editor plugins...OK
Found matching editor 'gigedit' for instrument
('/home/anders/Studio/instruments/gig/Dahnielson/test.gig', 0) having data
structure ('libgig','3.2.1')
InstrumentEditor::Launch(instr=68f190,type=libgig,version=3.2.1)
InstrumentEditor::Main()
Entered Gigedit Main() loop :)
Initializing 3rd party services needed by gigedit.
Adding sample /home/anders/Studio/instruments/wav/TDH/wav/ff10.wav
dim=1 z=1 dimensionsource=130 split_type=0 zones=2 zone_size=64.000000
Drop received sample "ff10"
Unable to cache sample - maybe memory full!
>>> FATAL ERROR: Segmentation fault (SIGSEGV) occured! <<<
Forget that. I haven't built you fix yet!!! Sorry. Nope. Get the segfault result above with the fix. No suprise since I don't even use "Save". Well, I used it in stand alone mode and it worked as expected. It's the adding of samples in live mode that's causing the corruption and now segfault. It's pretty obvious why: I've added samples but they are not yet saved to the gig that is loaded, hence no samples to stream. But that's something the user should be protected from and not need to think about. So I guess it's a bug to let something bad happen. Will now proceed to save the gig before hitting any keys. 1) Add a region and a sample to the gig in live mode. 2) Saving it as a new file using "Save as" (have to, it's an "Unsaved gig" when opened live). 3) Add a second sample to the gig and the new region. 4) Saving it using "Save". 5) Loading the new gig in LinuxSampler. 6) Works dandy. (In reply to comment #5) > 1) Add a region and a sample to the gig in live mode. > 2) Saving it as a new file using "Save as" (have to, it's an "Unsaved gig" when > opened live). > 3) Add a second sample to the gig and the new region. > 4) Saving it using "Save". > 5) Loading the new gig in LinuxSampler. > 6) Works dandy. Of course, if I don't reload it (step 5) before hitting a key LS will use the edited in memory meta data that doesn't match with the sample data in the gig. If I overwrite the old gig when saving (in hope to get everything to match) it will still fail. This synchronization business between what's in memory, whats in a gig on disk and what LS thinks is in the gig, is a bit confusing to a user. Marking this one as blocker, as it should be fixed before the upcoming release. Ok, I try to fix this issue soon ... (In reply to comment #6) > (In reply to comment #5) > > 1) Add a region and a sample to the gig in live mode. > > 2) Saving it as a new file using "Save as" (have to, it's an "Unsaved gig" when > > opened live). > > 3) Add a second sample to the gig and the new region. > > 4) Saving it using "Save". > > 5) Loading the new gig in LinuxSampler. > > 6) Works dandy. > > Of course, if I don't reload it (step 5) before hitting a key LS will use the > edited in memory meta data that doesn't match with the sample data in the gig. > If I overwrite the old gig when saving (in hope to get everything to match) it > will still fail. This synchronization business between what's in memory, whats > in a gig on disk and what LS thinks is in the gig, is a bit confusing to a user. > If you omit step 5 (reloading the gig), LS will play the old (crap) sample data, but it will _not_ crash, right? (In reply to comment #8) > If you omit step 5 (reloading the gig), LS will play the old (crap) sample > data, but it will _not_ crash, right? No, it has never crashed for me. I just commited fixes all over the place (libgig, linuxsampler, gigedit) to CVS. Please check if those fixes finally resolve this issue! Now when adding a new sample in live-mode in gigedit, you will hear nothing but silence when triggering that sample (before you save your changes that is) and it shouldn't crash either. But I'm not absolutely sure if it's really crash-safe now, because voices are still spawned for such "new" samples and I haven't investigated that part of code in LS yet. Then when you save the just modified file in gigedit, the sampler will now be informed about the samples that have just been added and the sampler will automatically (re)cache those samples, so after saving the file in gigedit you should immediatelly be able to use the new samples while playing. Please let me know! Considered to be fixed from my side now. |