FormatConverterStream causing dropouts (under-runs?) during channel conversion #2135
-
I'm using FormatConverterStream to convert URLstreams with different sampling rates and channel counts, so they can eventually be sent to a mixer for further processing. I've observed the following:
I see no changes in the log when the sound starts breaking up, but the pace of the messages slows down to match the gaps in the audio:
(also, if I specify a larger buffer size in the StreamCopy constructor, I see no effect in the copy sizes decribed in the logs, but maybe I'm misunderstanding that?) Test sketch that shows the problem with a mono -> stereo conversion after a few seconds:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Please share the log: double check that i2s gets informormed about the 2 channels. |
Beta Was this translation helpful? Give feedback.
-
I'm bumping this after doing some more troubleshooting. If I pass manually-configured AudioInfo objects to the How can I use FormatConverterStream to dynamically change channel-counts after .begin()? Reminder of the symptoms: mono URLstreams play at double speed for a few seconds and then start stuttering (probably since they are emptying 2x faster than filling). |
Beta Was this translation helpful? Give feedback.
-
I can see the issue in the log: when helix reports mono, I2S is switched to mono, but it should stay as stereo. [I] AudioTypes.h : 124 - MP3DecoderHelix sample_rate: 44100 / channels: 1 / bits_per_sample: 16 I committed a correction: double check if this makes a difference and provide the updated log. ps. Please note that when you call conv.begin(multi.audioInfo(), out_info), multi.audioInfo() is still stereo because the decoding has not started yet. |
Beta Was this translation helpful? Give feedback.
I can see the issue in the log: when helix reports mono, I2S is switched to mono, but it should stay as stereo.
[I] AudioTypes.h : 124 - MP3DecoderHelix sample_rate: 44100 / channels: 1 / bits_per_sample: 16
[I] ResampleStream.h : 145 - setStepSize: 1.000000
[I] ResampleStream.h : 129 - -> ResampleStream:
[I] AudioTypes.h : 124 - in: sample_rate: 44100 / channels: 1 / bits_per_sample: 16
[I] AudioTypes.h : 124 - out: sample_rate: 44100 / channels: 1 / bits_per_sample: 16
[I] I2SStream.h : 96 - virtual void audio_tools::I2SStream::setAudioInfo(audio_tools::AudioInfo)
[I] AudioTypes.h : 124 - in: sample_rate: 44100 / channels: 1 / bits_per_sample: 16
[I] AudioTypes.h : 124 - out: sample_rat…