BASSENC.BASS_Encode_CastGetStats fails after a while

Started by GTHvidsten,

GTHvidsten

I have a process to get the current listener and peak listener count. This uses the BassEnc.BASS_Encode_CastGetStats() method.

This initially works fine, but after a while it starts failing and returning "BASS_ERROR_UNKNOWN". At times it also returns invalid XML (I'm not logging the entire response so I don't know what's invalid).

This only happens after the encoder has been streaming for a while.

It is currently streaming to an Icecast server using BASSenc_AAC.

What are my debugging options here for when it is returning "BASS_ERROR_UNKNOWN" ?

Ian @ un4seen

There are a few possible reasons for a BASS_ERROR_UNKNOWN error from BASS_Encode_CastGetStats: BASSenc failed to send the request to the server, or it failed to receive a response from the server (and didn't timeout), or the response wasn't recognised. If you're able to reproduce the problem, I can send you a debug BASSenc version to get more info on that.

When the problem starts to happen, does it happen every time after that, or does it come and go? And can you still view the server's stats in your browser at that time?

GTHvidsten

When the problem occurs I can see that some threads experience the error, and other threads don't. I can also view the server stats in the browser.

I don't have any steps to reproduce it, but I can deploy new versions of stuff to my server for long-term testing, so a debug libbassenc.so might do some good. What are the extra debugging? How would I access this extra information?

Ian @ un4seen

Quote from: GTHvidstenWhen the problem occurs I can see that some threads experience the error, and other threads don't. I can also view the server stats in the browser.

You're calling BASS_Encode_CastGetStats in multiple threads? Is it possible that there are multiple simultaneous calls? Perhaps the server only allows one request at a time per IP. Please try making the BASS_Encode_CastGetStats calls in a single thread (so there are no simultaneous calls), and see if that helps.

Quote from: GTHvidstenI don't have any steps to reproduce it, but I can deploy new versions of stuff to my server for long-term testing, so a debug libbassenc.so might do some good. What are the extra debugging? How would I access this extra information?

A debug version would write a log file, eg. logging what's happening in each BASS_Encode_CastGetStats call in this case.

GTHvidsten

I haven't been able to reproduce this error, so I don't know what originally was causing it.
I have also followed your recommendation to try to prevent multiple simultaneous calls, which might also have mitigated the issue.
Should it reappear I'll post here again, but for now I believe we can consider this issue "closed" :)