Skip to content
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

mp3 Seeking has warnings in logs #274

Open
hasezoey opened this issue Apr 9, 2024 · 1 comment
Open

mp3 Seeking has warnings in logs #274

hasezoey opened this issue Apr 9, 2024 · 1 comment

Comments

@hasezoey
Copy link

hasezoey commented Apr 9, 2024

I have noticed that when playing mp3's and then seek, the following warnings / messages come up in the logs, while also in the audio output being noticeable "noise":

[WARN  symphonia_bundle_mp3::demuxer]: invalid mpeg audio header
[WARN  symphonia_bundle_mp3::demuxer]: skipping junk at 844617 bytes
[WARN  symphonia_bundle_mp3::layer3]: mpa: invalid main_data_begin, underflow by 28 bytes
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[WARN  symphonia_bundle_mp3::demuxer]: skipping junk at 926290 bytes
[WARN  symphonia_bundle_mp3::layer3]: mpa: invalid main_data_begin, underflow by 25 bytes
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[WARN  symphonia_bundle_mp3::layer3]: mpa: invalid main_data_begin, underflow by 1 bytes
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[WARN  symphonia_bundle_mp3::demuxer]: skipping junk at 926290 bytes
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: big_values overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[WARN  symphonia_bundle_mp3::demuxer]: invalid mpeg audio header
[WARN  symphonia_bundle_mp3::demuxer]: skipping junk at 844617 bytes
[WARN  symphonia_bundle_mp3::layer3]: mpa: invalid main_data_begin, underflow by 72 bytes
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: big_values overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: big_values overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[WARN  symphonia_bundle_mp3::layer3]: mpa: invalid main_data_begin, underflow by 12 bytes
[WARN  symphonia_bundle_mp3::layer3]: mpa: invalid main_data_begin, underflow by 13 bytes
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream
[INFO  symphonia_bundle_mp3::layer3::requantize]: count1 overrun, malformed bitstream

This seems to only happen on mp3's, not on mka(vorbis) or m4a(aac), with the same (transpiled) track; this also happens on any other mp3 i try.

This happens in both SeekMode::Coarse and SeekMode::Accurate.

I could not reproduce this on symphonia-play as that does not have live seek (only initial seek).

symphonia 0.5.4
rustc 1.77.1
linux (playback via cpal alsa into pipewire)

For context, some code:
how the seek is done
and the decode loop

Note: even when adding a required_ts check like in symphonia-play, it does not change the warnings or outputted "noise"
Note: i used "noise" as i dont quite know how else to describe it other than a mix of "popping" and "squeaking"

sample with 5 seeks done at somewhat regular intervals sample.tar.gz (length: 2 seconds)

@hasezoey
Copy link
Author

hasezoey commented Apr 9, 2024

Update: i have now read over the documentation again for seeking, it says that the decoder should be reset after seeking, which actually helped for mp3, though it seems to not be required for other decoders.

After a seek, all Decoders consuming packets from this reader should be reset.

Another Update:
resetting the decoder works for working around the issue of the audible noise (as provided in the sample) in mp3, but resetting the decoder after a seek in mka(vorbis) actually always plays from the beginning
(note that resetting the decoder does not resolve the warning messages)

hasezoey added a commit to hasezoey/termusic that referenced this issue Apr 9, 2024
…mp3)

as recommended by symphonia.
fixes audible "noise" while playing mp3

re pdeljanov/Symphonia#274
hasezoey added a commit to hasezoey/termusic that referenced this issue Apr 9, 2024
…mp3)

as recommended by symphonia.
fixes audible "noise" while playing mp3

re pdeljanov/Symphonia#274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant