Open willyspinner opened 6 years ago
Those are parallel processes so it has nothing to do with reaper being thread safe. What you describe is a memory corruption problem, maybe some memory is not freed correctly.
Could you share the .wav file that is causing the error?
In addition you could take that .wav file that causes an error, compile reaper in debug mode and see if there's any hint in the output logging information.
Thanks
Hello, so I looked into the wav files that caused the memory corruption errors, and in total, there were only 50 files that couldn't be processed out of 1000 files. I realised that some of the files were in fact, stereo, and I realised that reaper expects mono input. So for those, I will simply have to preprocess the wav files into mono first.
However, some mono ones still caused the error above. Here are some samples of the wav files that caused the errors (obtained by MAC OS's afinfo
command):
File type ID: WAVE
Num Tracks: 1
----
Data format: 1 ch, 48000 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
no channel layout.
estimated duration: 10.860000 sec
audio bytes: 1042560
audio packets: 521280
bit rate: 768000 bits per second
packet size upper bound: 2
maximum packet size: 2
audio data file offset: 78
optimized
source bit depth: I16
----
here is another one:
File type ID: WAVE
Num Tracks: 1
----
Data format: 1 ch, 48000 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
no channel layout.
estimated duration: 20.400000 sec
audio bytes: 1958400
audio packets: 979200
bit rate: 768000 bits per second
packet size upper bound: 2
maximum packet size: 2
audio data file offset: 78
optimized
source bit depth: I16
----
Whereas the ones successfully processed by reaper often have this format:
File type ID: WAVE
Num Tracks: 1
----
Data format: 1 ch, 48000 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer
no channel layout.
estimated duration: 19.020000 sec
audio bytes: 1825920
audio packets: 912960
bit rate: 768000 bits per second
packet size upper bound: 2
maximum packet size: 2
audio data file offset: 78
optimized
source bit depth: I16
----
Could there be an audio format issue that makes Reaper corrupt memory?
If you'd like, I could share you some of the actual samples of the wav files.
Thank you so much for your help, Wilson
Yes, I would need some of the actual samples.
In the meantime you can try to downsample to 16kHz and see what happens.
2018-03-25 19:30 GMT-04:00 Wilson Jusuf notifications@github.com:
Hello, so I looked into the wav files that caused the memory corruption errors, and in total, there were only 50 files that couldn't be processed out of 1000 files. I realised that some of the files were in fact, stereo, and I realised that reaper expects mono input. So for those, I will simply have to preprocess the wav files into mono first.
However, some mono ones still caused the error above. Here are some samples of the wav files that caused the errors (obtained by MAC OS's afinfo command):
File type ID: WAVE Num Tracks: 1
Data format: 1 ch, 48000 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer no channel layout. estimated duration: 10.860000 sec audio bytes: 1042560 audio packets: 521280 bit rate: 768000 bits per second packet size upper bound: 2 maximum packet size: 2 audio data file offset: 78 optimized source bit depth: I16
here is another one:
File type ID: WAVE Num Tracks: 1
Data format: 1 ch, 48000 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer no channel layout. estimated duration: 20.400000 sec audio bytes: 1958400 audio packets: 979200 bit rate: 768000 bits per second packet size upper bound: 2 maximum packet size: 2 audio data file offset: 78 optimized source bit depth: I16
Whereas the ones successfully processed by reaper often have this format:
File type ID: WAVE Num Tracks: 1
Data format: 1 ch, 48000 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer no channel layout. estimated duration: 19.020000 sec audio bytes: 1825920 audio packets: 912960 bit rate: 768000 bits per second packet size upper bound: 2 maximum packet size: 2 audio data file offset: 78 optimized source bit depth: I16
Could there be an audio format issue that makes Reaper corrupt memory?
If you'd like, I could share you some of the actual samples of the wav files.
Thank you so much for your help, Wilson
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/REAPER/issues/14#issuecomment-376012649, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVsoctr9Ot4obXtg0wsB---dBgnL2Pcks5tiCh-gaJpZM4SvDD- .
-- Xavi.
I'm working with @willyspinner on this project. I will try to provide more information later including some failing samples.
In running this across our samples now, I see Reaper exit code -11 for several failing samples, though when that exit code is returned there is no stdout or stderr from Reaper.
I see the memory corruption accompanied by exit code -6.
Will get back soon with more info.
Some of the failing samples are empty or sound empty (maybe corrupt?). @xavigonzalvo is there a way I can send you the samples privately? I don't want to post them in here as they are somewhat sensitive in nature.
By debug mode, did you mean like cmake -DCMAKE_BUILD_TYPE=Debug ..
?
Just wanted to let you know I managed to "fix" the samples that still caused crashes despite being playable in an ordinary media player. I just ran ffmpeg -i <file> -ac 1 <output_file>
which is technically a no-op for these since they were already mono (1 channel), but it seemed to fix the problem. Notably in the ffmpeg output for those operations, there was a yellow message reading Guessed Channel Layout for Input Stream #0.0 : mono
.
I would consider this closed for my practical purposes but if you want to keep debugging, LMK and I can get you some samples that surface the problem.
Hi Ezekiel,
Thanks for letting me know. Was it a problem with the header?
Thanks
2018-04-24 22:43 GMT-04:00 Ezekiel Victor notifications@github.com:
Just wanted to let you know I managed to "fix" the samples that still caused crashes despite being playable in an ordinary media player. I just ran ffmpeg -i
-ac 1 which is technically a no-op for these since they were already mono (1 channel), but it seemed to fix the problem. Notably in the ffmpeg output for those operations, there was a yellow message reading Guessed Channel Layout for Input Stream #0.0 : mono . I would consider this closed for my practical purposes but if you want to keep debugging, LMK and I can get you some samples that surface the problem.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/REAPER/issues/14#issuecomment-384143781, or mute the thread https://github.com/notifications/unsubscribe-auth/AEVsoVUcXHWJ_zNCfTGJG9HJvOblT3wzks5tr-LBgaJpZM4SvDD- .
-- Xavi.
I believe so... ffmpeg
was able to repair the files somehow apparently.
Dear sir, I also met the same problem, and I cannot deal with it. when I used the option -e, and it was set to default value 0.005, the code is ok.
reaper -i 40fa0110_1.1436028c0216-1.1436_40fo030o.wav -f ./tmp/bla.f0 -p ./tmp/bla.pm -e 0.005 -a
But, when I set the -e parameter to 0.016, the code had a problem: malloc() memory corruption error. The details are:
So, could you help me to deal with the problem? The wav I used is upload on: https://pan.baidu.com/s/1CqL-q761FLJeSuelLoTHow and the link password is: zesd
@gemengtju Another thing I've done with some success is convert to 44100 sample rate—i.e. ffmpeg arg -ar 44100
—but even that does not always work. It fixes some files but still some remain unable to process.
Is your wav file of a reasonable length and actually playable in other media players?
can you drop the wav somewhere accessible ? (there are some pop-ups I don't understand in the link above)
I have met this problem when I use a large resample_interval
in ResampleAndReturnResults(float resample_interval, ...)
, it happened on some specific wave files:
for wav in wav_list:
CHECK(et->Init(wav));
CHECK(et->ComputeFeatures());
CHECK(et->TrackEpochs());
// extract f0 & corr
std::vector<float> f0;
std::vector<float> corr;
CHECK(et->ResampleAndReturnResults(resample_interval, &f0, &corr));
But when I test on the single file, no error occurs.
Fixed by using LD_PRELOAD=/usr/lib/libtcmalloc.so python whatever.py
Edit: this is actually for the Python PyREAPER wrapper
Hi reaper, I was running parallel reaper processes as worker processes spawned by python's multiprocessing Pool to speed up generation of .f0 files from multiple single-channel .wav files. In each worker process, I call
which executes the reaper command processing that filename in a subshell (Obviously I made sure that no two reaper workers access the same FILENAME). All of a sudden, I got an unexpected malloc error below.
(FYI I am running Ubuntu 16.04 LTS, but have confirmed this error persists on Mac OSX as well...)
======= Backtrace: =========
Could there be something I'm doing wrong? Or could Reaper be thread-unsafe? I just recently started using REAPER, and would really like to use this simple and powerful command-line tool frequently in the future.
Thank you for reading my issue :) Best,
Wilson