-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jumps in recorded file. #54
Comments
Hmm, if that's the case, I suspect this is caused by the same issue as in #39. I'm still working on troubleshooting that issue. By the way, with stable version 1.7, it's possible to select WAV/PCM output + 16kHz so you don't have to use the debug build. |
This was previously disabled due to incorrect troubleshooting of an issue where the `c2.android.flac.encoder` component would crash during recording. It turns out the crash was caused by incorrect math: inputTimestamp += frames * 1000000 / audioRecord.sampleRate `frames` and `1000000` are both 32-bit integers, so the multiplication result overflowed and caused `inputTimestamp` (a 64-bit integer) to accumulate negative values, which would crash the encoder. This bug was inadvertently fixed during refactorying in commit 3d3eb82. This commit reenables the submission of timestamps to MediaCodec. To avoid accumulated error due to integer division when the microseconds per sample count is not perfectly divisible, the recording loop will keep track of the total frame count and only calculate the timestamp during buffer submission. This should fix issues where the encoded output files had overlapping audio or other weird audible artifacts. These were caused by MediaCodec's multithreaded encoding, where the lack of timestamps would cause encoded samples to be produced out of order. Fixes: #39 #54 Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
This was previously disabled due to incorrect troubleshooting of an issue where the `c2.android.flac.encoder` component would crash during recording. It turns out the crash was caused by incorrect math: inputTimestamp += frames * 1000000 / audioRecord.sampleRate `frames` and `1000000` are both 32-bit integers, so the multiplication result overflowed and caused `inputTimestamp` (a 64-bit integer) to accumulate negative values, which would crash the encoder. This bug was inadvertently fixed during refactoring in commit 3d3eb82. This commit reenables the submission of timestamps to MediaCodec. To avoid accumulated error due to integer division when the microseconds per sample count is not perfectly divisible, the recording loop will keep track of the total frame count and only calculate the timestamp during buffer submission. This should fix issues where the encoded output files had overlapping audio or other weird audible artifacts. These were caused by MediaCodec's multithreaded encoding, where the lack of timestamps would cause encoded samples to be produced out of order. Fixes: #39 #54 Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
EDIT: Version 1.8 has been released with the fix included. Please give that one a try instead. |
This was previously disabled due to incorrect troubleshooting of an issue where the `c2.android.flac.encoder` component would crash during recording. It turns out the crash was caused by incorrect math: inputTimestamp += frames * 1000000 / audioRecord.sampleRate `frames` and `1000000` are both 32-bit integers, so the multiplication result overflowed and caused `inputTimestamp` (a 64-bit integer) to accumulate negative values, which would crash the encoder. This bug was inadvertently fixed during refactoring in commit 3d3eb82. This commit reenables the submission of timestamps to MediaCodec. To avoid accumulated error due to integer division when the microseconds per sample count is not perfectly divisible, the recording loop will keep track of the total frame count and only calculate the timestamp during buffer submission. This should fix issues where the encoded output files had overlapping audio or other weird audible artifacts. These were caused by MediaCodec's multithreaded encoding, where the lack of timestamps would cause encoded samples to be produced out of order. Fixes: #39 #54 Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Yes.
I'll do it in few hours.
Many thanks for your work.
Robert
…On Wed, Jun 1, 2022, 05:47 Andrew Gunnerson ***@***.***> wrote:
Can you give the test build in #59
<#59> a try? I think I may have
found the issue 🙂
—
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZHT2ZDTWC72JK77SYPUBLVM3MM3ANCNFSM5XKGACTQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi,
Quick test made with BCR V1.8 - with OGG - and still have the issue.
(First jumps now in the sound started at 17 seconds, -previous records -earlier- had jumps mainly after 1 minutes. I dont know is it matter or not and it is not strict rule, rather it was a small notice)
![image](https://user-images.githubusercontent.com/7502315/171358698-ee6dad39-cdbe-40bd-b8ed-7ee46bac76fa.png)
So now I will try the other formats, and report here.
Best Regards,
Robert
|
BCR V1.8 tests: WAV records seems OK. Sample rate, tried 8000Hz. I plan to try ffmpeg -post process- conversion from wav to mp3 in Termux. https://www.reddit.com/r/tasker/comments/iyttlf/convert_recorded_audio_to_wave_nonroot/ |
Hi,
Thanks for this project efforts!
Recorded files with (all version including Version 1.6) sounds have random small jumps (sounds like hiccups)
It seems there is no problem with the BCR-1.4.r3.gaa21633-debug-dump_raw_wave_16kHz.zip you provided in other issue#39.
I have Redmi K30 Pro (Poco F2 Pro) - with LOS 19.1 (Android 12)
Sample file having jumps - errors- in it:
sample error from recorded sound
Original recorded file is 1 minutes 10 sec - this sample is from ~27seconds where the error started, and as you can hear after a 5 seconds sounds good again as it was earlier and after.
This is the Codec debug info:
`OMX.qcom.video.encoder.heic:
OMX.qcom.video.encoder.avc:
OMX.qcom.video.encoder.h263sw:
OMX.qcom.video.encoder.hevc:
OMX.qcom.video.encoder.hevc.cq:
OMX.qcom.video.encoder.mpeg4sw:
OMX.qcom.video.encoder.vp8:
c2.android.aac.encoder:
OMX.google.aac.encoder:
c2.android.amrnb.encoder:
OMX.google.amrnb.encoder:
c2.android.amrwb.encoder:
OMX.google.amrwb.encoder:
c2.android.flac.encoder:
OMX.google.flac.encoder:
c2.android.opus.encoder:
c2.android.avc.encoder:
OMX.google.h264.encoder:
c2.android.h263.encoder:
OMX.google.h263.encoder:
c2.android.hevc.encoder:
c2.android.mpeg4.encoder:
OMX.google.mpeg4.encoder:
c2.android.vp8.encoder:
OMX.google.vp8.encoder:
c2.android.vp9.encoder:
OMX.google.vp9.encoder:
`
How can i provide debug info to you?
The text was updated successfully, but these errors were encountered: