rafael2k / darkice

DarkIce is a live audio streamer. It records audio from an audio interface (e.g. sound card), encodes it and sends it to a streaming server. This is the official development repository of Darkice.
http://www.darkice.org
200 stars 47 forks source link

Darkice 1.3 core dumped #122

Closed 0d0a closed 4 months ago

0d0a commented 7 years ago

Every week or so my darkice 1.3 running Ubuntu 16 dumps core . I am running aacplus and MP3 (http://radiopatapoe.nl:8000/transit). I compiled without debug so no trace.

DanielEckl commented 7 years ago

To be honest, we would need a lot more information to at least have a slight chance for any clue.

Some ideas:

(Disclaimer: I am not a developer, but I try to help)

0d0a commented 7 years ago

From unname -a

4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:17 UTC 2016 i686 i686 i686 GNU/Linux

My darkice.cfg [general] duration= 0# duration of encoding, in seconds. 0 means forever bufferSecs= 3# 7,5,then 3 size of internal slip buffer, in seconds reconnect= yes# reconnect to the server(s) if disconnected realtime= yes# run the encoder with POSIX realtime priority rtprio= 3# scheduling priority for the realtime threads

this section describes the audio input that will be streamed

[input] device= hw:0,0 #plughw:0,0 # dev/dsp # OSS DSP soundcard device for the audio input sampleRate= 44100 # sample rate in Hz. try 11025, 22050 or 44100 bitsPerSample = 16# bits per sample. try 16 inbitsPerSample = 24 channel= 2# channels. 1 = mono, 2 = stereo

this section describes a streaming connection to an IceCast2 server

there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]

these can be mixed with [icecast-x] and [shoutcast-x] sections

[icecast2-0] bitrateMode = vbr# average bit rate quality= 1.0 format= mp3 # format of the stream bitrate= 192# bitrate of the stream sent to the server server= radiopatapoe.nl # host name of the server port= 8000# port of the IceCast2 server, usually 8000 password= # source password to the IceCast2 server mountPoint= patapoe # mount point of this stream on the IceCast2 server name= Radio Patapoe mp3 # name of the stream description = streaming high quality from Amsterdam to the world # description of the stream url = http://radiopatapoe.nl # URL related to the stream [icecast2-1] bitrateMode = cbr# constant bit rate bitrate= 48# bitrate of the mp3 stream sent to the server format= aacp

quality= 0.8# encoding quality

server= radiopatapoe.nl # host name of the server port= 8000# port of the IceCast server, usually 8000 password = # source password to the IceCast server mountPoint = patapoe.aac # mount point of this stream on the IceCast server name = Radio Patapoe aacp # name of the stream description = aacp for lowband devices # description of the stream url = http://radiopatapoe.nl

Compiled without debug , will try to build with debug and send a trace

By googling I am quite convinced that it is the aacplus stream that forces darkice to dump core but will use a separate instance to make sure

the white rider (Het leuke van ... is

On 1 dec. 2016, at 13:46, DanielEckl notifications@github.com wrote:

To be honest, we would need a lot more information to at least have a slight chance for any clue.

Some ideas:

Which Ubuntu 16 is that? 16 includes 2 releases. Is it 64-bit? How exactly do you compile, which exact configure options did you use? Can you narrow down "every week or so" by noting down start and crash time? Using this info: Is the time to crash always the same then? Can you compile a debug build and provide a trace at next crash? Can you post your darkice configuration (sans the passwords, please) Have you tried to start separate instances for mp3 and AAC+, so you could see which one crashes? (Disclaimer: I am not a developer, but I try to help)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

0d0a commented 7 years ago

outpUt when starting darkice from cli using config file: /etc/darkice.cfg 01-Dec-2016 16:34:59 Using ALSA DSP input device: hw:0,0 01-Dec-2016 16:34:59 buffer size: 529200 01-Dec-2016 16:34:59 buffer size: 529200 01-Dec-2016 16:34:59 encoding 01-Dec-2016 16:34:59 scheduler high priority 99 01-Dec-2016 16:34:59 Using POSIX real-time scheduling, priority 3 01-Dec-2016 16:34:59 HTTP/1.0 200 01-Dec-2016 16:34:59 set lame mode 1 01-Dec-2016 16:34:59 set lame channels 2 01-Dec-2016 16:34:59 set lame in sample rate 44100 01-Dec-2016 16:34:59 set lame out sample rate 44100 01-Dec-2016 16:34:59 set lame vbr bitrate 4 01-Dec-2016 16:34:59 set lame vbr quality 0 01-Dec-2016 16:34:59 set lame lowpass frequency 0 01-Dec-2016 16:34:59 set lame highpass frequency 0 01-Dec-2016 16:34:59 set lame psycho acoustic model 1 01-Dec-2016 16:34:59 set lame error protection 1 LAME 3.99.5 32bits (http://lame.sf.net) CPU features: MMX (ASM used), SSE (ASM used), SSE2 polyphase lowpass filter disabled 01-Dec-2016 16:34:59 HTTP/1.0 200 01-Dec-2016 16:34:59 Using aacplus codec 01-Dec-2016 16:34:59 nChannelsAAC 2 01-Dec-2016 16:34:59 sampleRateAAC 22050 01-Dec-2016 16:34:59 inSamples 4096 01-Dec-2016 16:34:59 MultiThreadedConnector :: ThreadData :: threadFunction, was (thread, priority, type): 0x9417930 3 SCHED_FIFO 01-Dec-2016 16:34:59 MultiThreadedConnector :: ThreadData :: threadFunction, was (thread, priority, type): 0x9417940 3 SCHED_FIFO 01-Dec-2016 16:34:59 MultiThreadedConnector :: ThreadData :: threadFunction, now is (thread, priority, type): 01-Dec-2016 16:34:59 0x9417930MultiThreadedConnector :: transfer, bytes 1 0 01-Dec-2016 16:34:59 MultiThreadedConnector :: ThreadData :: threadFunction, now is (thread, priority, type): 0x9417940 1 SCHED_FIFO SCHED_FIFO

DanielEckl schreef op 2016-12-01 13:46:

To be honest, we would need a lot more information to at least have a slight chance for any clue.

Some ideas:

  • Which Ubuntu 16 is that? 16 includes 2 releases.
  • Is it 64-bit?
  • How exactly do you compile, which exact configure options did you use?
  • Can you narrow down "every week or so" by noting down start and crash time?
  • Using this info: Is the time to crash always the same then?
  • Can you compile a debug build and provide a trace at next crash?
  • Can you post your darkice configuration (sans the passwords, please)
  • Have you tried to start separate instances for mp3 and AAC+, so you could see which one crashes?

(Disclaimer: I am not a developer, but I try to help)

-- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2].

*

Links:

[1] https://github.com/rafael2k/darkice/issues/122#issuecomment-264165011 [2] https://github.com/notifications/unsubscribe-auth/AKi7exltfuZ3_PfaCIvjOb1oIyeaIx73ks5rDsGZgaJpZM4LBKoZ

DanielEckl commented 7 years ago

Okay, from your uname output you are running Ubuntu 16.04 LTS 32-bit. I'm surprised about the 32-bit part for a server installation, but beside feelings I don't have arguments against that.

Since you read directly from the hardware device, it's not so easy to split the streams. I hope you can make this possible without too much changes. But if you manage to separate that, it should make your setup more robust anyway.

I guess you also compiled libaacplus yourself. If you suspect libaacplus to be the culprit, you may try to use precompiled packages. I am using a package from Deb Multimedia Project on Ubuntu 16.10 64-bit. For your setup this one might be fitting: https://www.deb-multimedia.org/dists/jessie/main/binary-i386/package/libaacplus2 https://www.deb-multimedia.org/dists/jessie/main/binary-i386/package/libaacplus-dev

Obviously it's best to try inside of a VM first to see if it can resolve all dependencies. If you have dependency problems, you might try the package for Sid or Wheezy.

0d0a commented 7 years ago

Should I recompile darkice then? (Using the libaacplus you linked to)

the white rider (Het leuke van ... is

On 1 dec. 2016, at 17:32, DanielEckl notifications@github.com wrote:

Okay, from your uname output you are running Ubuntu 16.04 LTS 32-bit. I'm surprised about the 32-bit part for a server installation, but beside feelings I don't have arguments against that.

Since you read directly from the hardware device, it's not so easy to split the streams. I hope you can make this possible without too much changes. But if you manage to separate that, it should make your setup more robust anyway.

I guess you also compiled libaacplus yourself. If you suspect libaacplus to be the culprit, you may try to use precompiled packages. I am using a package from Deb Multimedia Project on Ubuntu 16.10 64-bit. For your setup this one might be fitting: https://www.deb-multimedia.org/dists/jessie/main/binary-i386/package/libaacplus2

Obviously it's best to try inside of a VM first to see if it can resolve all dependencies. If you have dependency problems, you might try the package for Sid or Wheezy.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

DanielEckl commented 7 years ago

If this is the same version of libaacplus as you used up to now, I think recompiling is not needed

0d0a commented 7 years ago

While locating libaacplus I do not find one in /usr/bin nor in /usr/local/bin... So where should I place libaacplus so that darkice uses it ?

the white rider (Het leuke van ... is

On 1 dec. 2016, at 20:04, DanielEckl notifications@github.com wrote:

If this is the same version of libaacplus as you used up to now, I think recompiling is not needed

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

0d0a commented 7 years ago

I have a aacplusenc in /usr/local/bin though

the white rider (Het leuke van ... is

On 1 dec. 2016, at 20:04, DanielEckl notifications@github.com wrote:

If this is the same version of libaacplus as you used up to now, I think recompiling is not needed

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

DanielEckl commented 7 years ago

darkice does not spawn a program like aacplusenc somewhere in the background and feeding it data, instead the dynamic linker is searching for libaacplus.so.2 and imports its functions.

You can ask the dynamic linker on your system where it searches for libraries with something like: ldconfig -v 2>/dev/null | grep -v ^$'\t'

Additionally you can modify its behavior with the use of LD_LIBRARY_PATH environment variably to tell it to search some other path(s) before falling back to the default.

You need to uninstall your current libaacplus library first before installing another version of course. But here we go into packaging/installing/uninstalling basics, and depending on how you installed the current libaacplus library. This will likely go beyond the scope of this issue tracker

0d0a commented 7 years ago

Basisvakken what i thought so why THE link ?

the white rider (Het leuke van ... is

On 1 dec. 2016, at 23:16, DanielEckl notifications@github.com wrote:

darkice does not spawn a program like aacplusenc somewhere in the background and feeding it data, instead the dynamic linker is searching for libaacplus.so.2 and imports its functions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

0d0a commented 7 years ago

So, after a good sleep i reread your answers and came to the conclusion that I use the libaacplus you recommend allready. In the current cfg I am using cbr for aacplus , before that is with the core dumped I used vbr. Maybe that was causing the problem... the white rider (Het leuke van ... is

On 1 dec. 2016, at 23:16, DanielEckl notifications@github.com wrote:

darkice does not spawn a program like aacplusenc somewhere in the background and feeding it data, instead the dynamic linker is searching for libaacplus.so.2 and imports its functions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

DanielEckl commented 7 years ago

Indeed such details can easily change the outcome. Good luck!

jmturner commented 7 years ago

Daniel et al, I get the same segfault on CentOS7. Here's a backtrace:

Jan 23 08:42:27 host kernel: traps: darkice[23473] general protection ip:7f6d460e801c sp:7f6d41dde5e8 error:0 in libfftw3f.so.3.3.2[7f6d45fc9000+16d000

0 t3fv_16 (ri=, ii=, W=0x6dd3c0, rs=0x6dc360, mb=, me=32, ms=2)

at ../../../../dft/simd/common/t3fv_16.c:269

1 0x00007ffff7a87faa in apply (ego_=0x6db7a0, rio=0x6c188c, iio=0x6c1890) at ../../dft/dftw-direct.c:53

2 0x00007ffff6f38c38 in CFFTN () from /lib64/libaacplus.so.2

3 0x00007ffff6f50aea in mdct.constprop.1 () from /lib64/libaacplus.so.2

4 0x00007ffff6f50d45 in Transform_Real () from /lib64/libaacplus.so.2

5 0x00007ffff6f46635 in psyMain () from /lib64/libaacplus.so.2

6 0x00007ffff6f32580 in AacEncEncode () from /lib64/libaacplus.so.2

7 0x00007ffff6f51860 in aacplusEncEncode () from /lib64/libaacplus.so.2

8 0x000000000041df0c in aacPlusEncoder::write (this=0x649880, buf=0x6dfd40, len=)

at aacPlusEncoder.cpp:228

9 0x000000000040ef7a in MultiThreadedConnector::sinkThread (this=0x649130, ixSink=1)

at MultiThreadedConnector.cpp:305

10 0x000000000040f35b in MultiThreadedConnector::ThreadData::threadFunction (param=0x6db870)

at MultiThreadedConnector.cpp:425

11 0x00007ffff65d9dc5 in start_thread (arg=0x7ffff387a700) at pthread_create.c:308

12 0x00007ffff59c873d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

[root@host src]# ldd /usr/local/bin/darkice linux-vdso.so.1 => (0x00007ffd2e749000) libfftw3f.so.3 => /lib64/libfftw3f.so.3 (0x00007fbd9a9cd000) libvorbisenc.so.2 => /lib64/libvorbisenc.so.2 (0x00007fbd9a4fd000) libvorbis.so.0 => /lib64/libvorbis.so.0 (0x00007fbd9a2cf000) libogg.so.0 => /lib64/libogg.so.0 (0x00007fbd9a0c8000) libaacplus.so.2 => /lib64/libaacplus.so.2 (0x00007fbd99e98000) libm.so.6 => /lib64/libm.so.6 (0x00007fbd99b96000) libtwolame.so.0 => /lib64/libtwolame.so.0 (0x00007fbd99972000) libjack.so.0 => /lib64/libjack.so.0 (0x00007fbd99754000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbd99538000) librt.so.1 => /lib64/librt.so.1 (0x00007fbd99330000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fbd99116000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fbd98e0d000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fbd98bf7000) libc.so.6 => /lib64/libc.so.6 (0x00007fbd98835000) /lib64/ld-linux-x86-64.so.2 (0x00007fbd9ad52000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fbd98631000)

This is using libaacplus-2.0.2 from http://217.20.164.161/~tipok/aacplus

Let me know if I can provide anything else. Thanks!

jmturner commented 7 years ago

Here's another backtrace with jack and libaacplus debuginfos added:

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff387a700 (LWP 24213)] t3fv_16 (ri=, ii=, W=0x6dd3c0, rs=0x6dc360, mb=, me=32, ms=2) at ../../../../dft/simd/common/t3fv_16.c:269 269 TW = LD(&(x[WS(rs, 8)]), ms, &(x[0])); (gdb) bt

0 t3fv_16 (ri=, ii=, W=0x6dd3c0, rs=0x6dc360, mb=, me=32, ms=2)

at ../../../../dft/simd/common/t3fv_16.c:269

1 0x00007ffff7a87faa in apply (ego_=0x6db7a0, rio=0x6c188c, iio=0x6c1890) at ../../dft/dftw-direct.c:53

2 0x00007ffff6f38c38 in CFFTN (ctx=, afftData=afftData@entry=0x6c188c, len=len@entry=512,

isign=isign@entry=-1) at cfftn.c:1390

3 0x00007ffff6f50aea in mdct (fftctx=fftctx@entry=0x6b2298, dctdata=dctdata@entry=0x6c188c,

sineWindow=<optimized out>, n=n@entry=1024, ld_n=ld_n@entry=10, trigData=<optimized out>) at transform.c:128

4 0x00007ffff6f50d45 in Transform_Real (fftctx=fftctx@entry=0x6b2298, mdctDelayBuffer=0x6c9ba0,

timeSignal=0x6b22b8, chIncrement=chIncrement@entry=1, realOut=0x6c188c, blockType=<optimized out>)
at transform.c:249

5 0x00007ffff6f46635 in psyMain (fftctx=0x6b2298, timeInStride=timeInStride@entry=1,

elemInfo=elemInfo@entry=0x6add10, timeSignal=timeSignal@entry=0x6b22b8, psyData=0x6af5d8, tnsData=0x6b1048, 
psyConfLong=psyConfLong@entry=0x6aed58, psyConfShort=psyConfShort@entry=0x6af390, psyOutChannel=0x6ae718, 
psyOutElement=psyOutElement@entry=0x6ae620, pScratchTns=0x6c588c) at psy_main.c:299

6 0x00007ffff6f32580 in AacEncEncode (aacEnc=, timeSignal=,

timeInStride=<optimized out>, ancBytes=<optimized out>, numAncBytes=<optimized out>, outBytes=<optimized out>, 
numOutBytes=numOutBytes@entry=0x7ffff3879d54) at aacenc.c:310

7 0x00007ffff6f51860 in aacplusEncEncode (hEncoder=0x6adcc0, inputBuffer=,

samplesInput=<optimized out>, outputBuffer=<optimized out>, bufferSize=<optimized out>) at aacplusenc.c:349

8 0x000000000041df0c in aacPlusEncoder::write (this=0x649880, buf=0x6dfd40, len=)

at aacPlusEncoder.cpp:228

9 0x000000000040ef7a in MultiThreadedConnector::sinkThread (this=0x649130, ixSink=1)

at MultiThreadedConnector.cpp:305

10 0x000000000040f35b in MultiThreadedConnector::ThreadData::threadFunction (param=0x6db870)

at MultiThreadedConnector.cpp:425

11 0x00007ffff65d9dc5 in start_thread (arg=0x7ffff387a700) at pthread_create.c:308

12 0x00007ffff59c873d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

jmturner commented 7 years ago

Possibly relevant: https://trac.ffmpeg.org/ticket/943#comment:5

" libaacplus encoding started crashing for all samples for me after upgrading from Ubuntu Lucid to Oneiric. The bug is probably somewhere in libaacplus or libfftw3, but adding info here for when others hit this.

Oneiric now builds libfftw3 with SSE/SSE2 enabled, Lucid did not. ​https://bugs.launchpad.net/ubuntu/+source/fftw3/+bug/602586

I tried building my own libfftw3 with and without --enable-sse/--enable-sse2 and if I enable SSE then libaacplus crashes, leave it disabled and it works."

jmturner commented 7 years ago

I can confirm this segfault does not happen with an fftw library built without sse/sse2.

0d0a commented 7 years ago

jmturner, how did you compile the fftw library exactly?..

rafael2k commented 6 years ago

Someone to write a patch to update darkice from libaacplus to fdk-aac?

cdgraff commented 6 years ago

hi @rafael2k, I'm able to sponsor the patch for adding support to FDK-AAC if some one can work around this... do you think some can be interested? and I'm interested in sponsor too the support for SDR devices.

rafael2k commented 6 years ago

I'll have time in next week to implement FDK-AAC to darkice. I would appreciate the sponsorship. ; )

cdgraff commented 6 years ago

@rafael2k please reach me by mail alejandro [@] mediainbox.net, this way we can coordinate the sponsorship :)

aitrone commented 6 years ago

I also really need it! (-___-)

aitrone commented 5 years ago

I'll have time in next week to implement FDK-AAC to darkice. I would appreciate the sponsorship. ; )

Hello! Did you manage to implement FDK-AAC to darkice?

0d0a commented 5 years ago

It would really make a differencte to have fdk-aac. I guess my problem with streaming both m3 and aac and having the stream(s) drop because darkice stops has somehow to do with the aac encoding that is used until now. I have streamed with pc's and laptops running a version of ubuntu and with raspberrypi's running raspbian lite . They all dropped stream more or less frequently. so I am looking forward to fdk-aac coming into play soon!

regards,

The white rider http://radiopatapoe.nl:8000/transit casting 24H/365days

rafael2k commented 5 years ago

It will not happen unless someone do it. No question about how fdk-aac is the best AAC encoder in town, stable and very high quality. :P I'm really without time. Sorry.

rafael2k commented 4 years ago

Should we disable current he-aac encoder until we have proper fdk-aac code in place?

0d0a commented 4 years ago

No why?

the white rider (Het leuke van ... is weten op reis te zijn

On 26 Aug 2020, at 01:31, rafael2k notifications@github.com wrote:

 Should we disable current he-aac encoder until we have proper fdk-aac code in place?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

rafael2k commented 4 years ago

Just asking. ; )

rafael2k commented 5 months ago

Started working on fdk-aac here: https://github.com/rafael2k/darkice/tree/fdk-aac

0d0a commented 5 months ago

What happened to version 1.5?the white rider(Het leuke van ... is weten op reis te zijn; geboren te Vught, opgegroeid in Amsterdam en gezworven door Eurazië…)On 18 Jun 2024, at 21:44, Rafael Diniz @.***> wrote: Started working on fdk-aac here: https://github.com/rafael2k/darkice/tree/fdk-aac

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

rafael2k commented 5 months ago

Version 1.5 release before any new features are added: https://github.com/rafael2k/darkice/releases/tag/v1.5