Author Topic: questions about bass_enc  (Read 498 times)

drugoimir

  • Posts: 32
questions about bass_enc
« on: 9 Aug '19 - 10:13 »
Hello Ian,
i'm trying your encoder libraries on a linux x64 machine.

I have a couple of questions:

First: i started with your "server.glade" example (removing all glade visual stuff)
and i was able to stream mp3 using both internal and external (lame) encoder.
I can connect with any player (winamp, vlc, bass_streamcreateurl ..), but i get
a nasty "SIGPIPE" error each time a client disconnects.
It seems that, if i set a debug breakpoint on  EncodeClientProc when "connect" is false,
then manually stepping instructions till function return, makes no error to be triggered.
For the moment i set the SIGPIPE signal to SIG_IGN and i have no problems, but i was
just curious to know why it's happening.

Second: i wrapped up the fdk-aac library encoder and fed it through BASS_Encode_StartUser callback.
It is working very nicely, but the stream can be opened only with bass_streamcreateurl.
VLC does not play anything and it idles (it disconnects when i press its stop button) after the icy header is received.
If i write the encoded stream to disk, i'm able to play it with VLC as well.
As said, i'm using the bass_encode as a server, i didn't try to push a stream to a shoutcast server.

Thanks for any suggestion.
Regards.
« Last Edit: 9 Aug '19 - 10:29 by drugoimir »

drugoimir

  • Posts: 32
Re: questions about bass_enc
« Reply #1 on: 9 Aug '19 - 11:45 »
Got it ...
adding a Content-Type: audio/aac to the response header did the trick!  ;D
and vlc is not complaining any more.

The SIGPIPE question on client disconnection remains open.

Ian @ un4seen

  • Administrator
  • Posts: 22829
Re: questions about bass_enc
« Reply #2 on: 9 Aug '19 - 16:11 »
First: i started with your "server.glade" example (removing all glade visual stuff)
and i was able to stream mp3 using both internal and external (lame) encoder.
I can connect with any player (winamp, vlc, bass_streamcreateurl ..), but i get
a nasty "SIGPIPE" error each time a client disconnects.
It seems that, if i set a debug breakpoint on  EncodeClientProc when "connect" is false,
then manually stepping instructions till function return, makes no error to be triggered.
For the moment i set the SIGPIPE signal to SIG_IGN and i have no problems, but i was
just curious to know why it's happening.

BASSenc does indeed currently require SIGPIPE signals to be disabled/ignored. The GTK library (used by the BASSenc examples) disables them automatically. Here's an update that shouldn't require that:

   www.un4seen.com/stuff/bassenc-linux.zip

Let me know if you still have the problem with that.

Second: i wrapped up the fdk-aac library encoder and fed it through BASS_Encode_StartUser callback.
It is working very nicely, but the stream can be opened only with bass_streamcreateurl.
VLC does not play anything and it idles (it disconnects when i press its stop button) after the icy header is received.
If i write the encoded stream to disk, i'm able to play it with VLC as well.
As said, i'm using the bass_encode as a server, i didn't try to push a stream to a shoutcast server.

As you have already since found, some players will require a "Content-Type" header.

Coincidentally, there is an unreleased BASSenc_AAC add-on based on the FDK AAC encoder. If you (or anyone else) would like to try that, I've just posted it here:

   www.un4seen.com/forum/?topic=18609

drugoimir

  • Posts: 32
Re: questions about bass_enc
« Reply #3 on: 10 Aug '19 - 13:43 »
Hello Ian,
confirmed that the SIGPIPE error is gone with your patched encoder library.

Since i don't use glade, i would just know if it is ok to ignore the SIGPIPE signal 
and eventually other signals that must be ignored.
I don't know if you will put this fix into your future releases of bassenc, so for the
moment i would keep the signals ignoring setup into my intialization section.

I confirm also that your aac encoder is working, but it consumes more cpu
(tried both on single core arm and x86) than the compiled library i used, anyway
i'll keep it running on a test hardware.

Please let me know if i can do other tests for you.
 
Thanks.