Long delay playing AAC stream on Windows 11 without bass_aac

Started by carolino,

carolino

Hello,

I have a software using bass.dll to play url streams. One of my users reported a delay of around 2 minutes before playback starts on Windows 11 (24H2 and 25H2). The same user reported that on Windows 11 23H2 everything runs fine. My code is basic, just creating the stream with these flags and plugging it into a mixer:

Bass.BASS_StreamCreateURL(Url, 0, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_MUSIC_DECODE | BASSFlag.BASS_STREAM_BLOCK, null, IntPtr.Zero)

Until today, I had never been able to reproduce the problem. It worked correctly on my Windows 10 and Windows 11 on the same builds (24H2 and 25H2), so for me it was just something particular to that user.

But now that I've had some free time, I decided to do a clean install using a recent Windows 11 Consumer Edition 25H2 ISO and confirmed the issue myself. To be sure, I also tested NetRadio, and the same happens: the stream connects, HTTP 200 OK is returned, but audio starts only ~2 minutes later. During this time, no "buffering" info is shown, only connecting.

Problematic stream:
http://cast3.zadax.com.br:6270/live
ffprobe reports:
Audio: aac (HE-AAC), 44100 Hz, stereo, fltp, 63 kb/s
When using bass_aac, playback starts immediately, but I cannot use it for my users due to licensing restrictions.

Since this happens both in my code and in NetRadio, I don't believe it's a issue with buffer or timeout settings. Maybe is related to Media Foundation or some other system codec?

I'm reporting this to see if others experience the same delay with this stream, and to know if there's any solution other than using bass_aac.

Thank you in advance.

Ian @ un4seen

Yeah, the latest Media Foundation is pre-buffering 1MB of data and that server is sending very slowly, so it's taking a long time. I'll hopefully have a BASS update for you to try tomorrow.

Ian @ un4seen

Here's the update for you to try, which changes the way internet files/streams are handled with Media Foundation:

    www.un4seen.com/stuff/bass.zip

Please let me know if you still see this problem or any new ones.

carolino

Hello, I'm doing an initial test and it's loading quickly as expected.

I'll leave the link running for a few hours and try to simulate a few connection drops to see how it behaves when connecting and disconnecting, and see if I can find any issues. For now, everything looks good. Thank you!

carolino

Hello,

For the record, after testing over the past few days, everything is okay, thank you very much! Will this change be included in a future official update?

Ian @ un4seen

Good to hear the update is working well. The changes will indeed be in the next BASS release. The changes also included some support for seeking ahead in internet files (seeks immediately but stalls playback until the download reaches the position), which has since been tweaked some more. Here's the latest build:

    www.un4seen.com/stuff/bass.zip

This shouldn't make any difference to live streams, but let me know if you do find there's any problem with them again.