Hi Andrew.

On January 26, 2016 11:19:57 PM Andrew Deryabin wrote:
> Hi guys,
> 
> These changes were made by me in December. The main goal was to move
> memory allocation functions from RT context.

Always good. 
Robert fixed some stuff there before, that was eating up stack space.

> Frankly speaking, I forgot to make different tests with random buffer
> sizes and sample rates and did not informe you about these changes.
> 
> So all recent recording (and may be playing?)wave bugs are from me :(.


It's OK. There's a bunch 'o stuff . Here's some:

There were unfinished loose ends from the change to non-shared event lists.

Sndfile handles were left open when wave tracks, parts, or events
 were 'deleted' (sitting in the undo/redo list).

There was an oversight in my Copy On Write code. Didn't check clones.

There are old ugly hacks for dealing with record-stop and recorded waves.
I'm trying to get through this last part. Ugh!

T.

> 
> 26.01.2016 21:43, Tim E. Real пишет:
> > On January 26, 2016 04:34:20 PM Robert Jonsson wrote:
> >> Hey guys,
> >> 
> >> Just a heads up while I remember it.
> >> 
> >> Has anybody been trying to record something with current git?
> >> I got a new microphone, the type you connect directly to usb, not the
> >> best
> >> but very handy.
> >> 
> >> I got clicking in the recordings though and was blaming the mic, the
> >> drivers and jack but finally it dawned on me that it seems to be MusE
> >> adding clicks.
> >> I need to test more and try to narrow down when this started occuring, a
> >> qualified guess would be the new and shiny wave drawing.
> >> 
> >> A test that you can perform if you'd like is to setup one Input and
> >> connect
> >> it to two Wave tracks and start recording to both. After recording a
> >> minute
> >> or two, compare the two files.
> >> Easiest way I found to do it is:
> >> xxd file1 out1.hex
> >> xxd file2 out2.hex
> >> diff out1.hex out2.hex
> >> 
> >> If they are identical diff will stay silent.
> >> I did one recording where they are identical, but then a longer one with
> >> three tracks where the files had differences.
> >> I will test this more.
> >> 
> >> Regards,
> >> Robert
> > 
> > As it happens I am in the wave section right now.
> > 
> > I am surprised it hasn't crashed on you.
> > I have (locally) fixed several problems and crashes.
> > 
> > During testing, one of the first things I noticed was after
> > 
> >   using the wave editor 'functions' to edit a wave, there were
> >   'spikes' left in the edited wave that weren't in the original.
> > 
> > And it would occasionally crash.
> > 
> > The following was changed for two reasons:
> > 'n' may not be evenly divisible by writeSegSize.
> > And size_t is an unsigned. So 'n' was 'underflowing' but
> > 
> >   actually 'rolling over' so that "while(n > 0)" was failing.
> > 
> > This would either cause a crash or cause invalid or incomplete
> > 
> >   data to be written ('spikes').
> > 
> > size_t SndFile::write(int srcChannels, float** src, size_t n)
> > {
> > 
> >     size_t wrFrames = 0;
> >     
> >     if(n <= writeSegSize)
> >     
> >         wrFrames = realWrite(srcChannels, src, n);
> >     
> >     else
> >     {
> >     
> >        while(n > 0)
> >        {
> >        
> >           size_t nrWrote = realWrite(srcChannels, src, writeSegSize,
> >           wrFrames);
> >           wrFrames += nrWrote;
> >           n -= nrWrote;
> >        
> >        }
> >     
> >     }
> >     return wrFrames;
> > 
> > }
> > 
> > Changed to:
> > 
> > size_t SndFile::write(int srcChannels, float** src, size_t n)
> > {
> > 
> >     size_t wrFrames = 0;
> >     
> >     if(n <= writeSegSize)
> >     
> >         wrFrames = realWrite(srcChannels, src, n);
> >     
> >     else
> >     {
> >     
> >        while(1)
> >        {
> >        
> >           size_t sz = (n - wrFrames) < writeSegSize ? (n - wrFrames) :
> > writeSegSize;
> > 
> >           size_t nrWrote = realWrite(srcChannels, src, sz, wrFrames);
> >           if(nrWrote == 0) // Nothing written?
> >           
> >             break;
> >           
> >           wrFrames += nrWrote;
> >           if(wrFrames >= n)
> >           
> >             break;
> >        
> >        }
> >     
> >     }
> >     return wrFrames;
> > 
> > }
> > 
> > 
> > Another thing I found was this:
> > 
> > void SndFile::setFormat(int fmt, int ch, int rate)
> > 
> >        {
> > 
> > ...
> > 
> >        writeBuffer = new float [writeSegSize * std::max(2, ch)];
> >        }
> > 
> > The writeBuffer allocation was moved out of there and into
> > 
> >   SndFile::openWrite() because there was a crash with some operations
> >   because writeBuffer was not allocated because setFormat() had not
> >   been called beforehand.
> > 
> > Since these functions are responsible for recording,
> > 
> >   these may be part of your problem.
> > 
> > But also being a USB mic there may be problems there.
> > I've seen it recommended to use 3 Jack periods with USB,
> > 
> >   not sure why, but LAD and LAU always have discussions
> >   about USB. Maybe ask there if my fixes don't solve it.
> > 
> > /Lots/ of wave fixes here, will try to commit soon.
> > 
> > Tim.
> > 
> > 
> > 


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer

Reply via email to