mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.52k stars 1.28k forks source link

Segfault when recording with ffmpeg #8649

Open mixxxbot opened 2 years ago

mixxxbot commented 2 years ago

Reported by: ronso0 Date: 2016-09-16T23:07:12Z Status: Confirmed Importance: Critical Launchpad Issue: lp1624576 Tags: recording Attachments: [gdb backtrace](https://bugs.launchpad.net/bugs/1624576/+attachment/4742378/+files/gdb backtrace)


I'm not sure if this is a real bug because it happens only on a version I compiled from source with "ffmpeg=1" flag. (I need ffmpeg to play AAC files on which FAAD sometimes fails)

  1. In "Recording" tab, set format to mp3 or ogg
  2. Start recording
  3. Stop recording ... (no matter how much time passes)
  4. Start recording again
  5. Stop recording Segfault

Created mp3s are useless (noisy or 'empty').

In normal log appear these lines after starting the recording:
Debug [Main]: Split size is: 750000000
Debug [Main]: Recordings folder set to "/tmp"
Debug [EngineSideChain 1]: ffmpegencodercore: UpdateMetadata: ! RonsoFX  -    -
Debug [EngineSideChain 1]: EncoderFfmpegCore::initEncoder: Old Style initialization
Debug [EngineSideChain 1]: EncoderFfmpegCore::initEncoder: Codec MP3
Debug [EngineSideChain 1]: EncoderFfmpegResample::openMixxx: open MIXXX FFmpeg Resampler version
Debug [EngineSideChain 1]: Created sample rate converter for conversion of 44100 Hz format: flt with: 2 (layout: 0 ) channels (BPS 4 )
Debug [EngineSideChain 1]: To  44100  HZ format: s32p with  2  (layout: 0 ) channels (BPS  4 )
Debug [EngineSideChain 1]: openCodec!
[libmp3lame @ 0x7fffc0020a60] channel_layout not specified
Debug [EngineSideChain 1]: Setting record flag to: ON

And this repeatingly until reccording is stopped/mixxx crashes:
Debug [EngineSideChain 1]: Unsupported sample format: s32p
Debug [EngineSideChain 1]: Unsupported sample format: s32p
Debug [EngineSideChain 1]: Unsupported sample format: s32p
...

mixxx rev5919 Linux 3.14.23-rt20 #⁠1 SMP PREEMPT RT Thu Nov 20 17:03:31 CET 2014 x86_64 x86_64 GNU/Linux

mixxxbot commented 2 years ago

Commented by: ronso0 Date: 2016-09-16T23:07:12Z Attachments: [gdb backtrace](https://bugs.launchpad.net/mixxx/+bug/1624576/+attachment/4742378/+files/gdb backtrace)

mixxxbot commented 2 years ago

Commented by: daschuer Date: 2016-09-17T07:25:41Z


It is a real bug, thank you for reporting.

Could you file a second bug with the file attached that fails on a faad build?

mixxxbot commented 2 years ago

Commented by: daschuer Date: 2016-09-17T10:41:00Z


This is the significant path:

#0  EncoderFfmpegCore::~EncoderFfmpegCore (this=0x7fffc01c9b90, __in_chrg=<optimized out>) at src/encoder/encoderffmpegcore.cpp:83
mixxxdj/mixxx#4910  0x0000000000689310 in ~EncoderFfmpegMp3 (this=0x7fffc01c9b90, __in_chrg=<optimized out>) at src/encoder/encoderffmpegmp3.h:26
mixxxdj/mixxx#4911  EncoderFfmpegMp3::~EncoderFfmpegMp3 (this=0x7fffc01c9b90, __in_chrg=<optimized out>) at src/encoder/encoderffmpegmp3.h:26
mixxxdj/mixxx#4912  0x0000000000847907 in EngineRecord::closeFile (this=0x1f1cb40) at src/engine/sidechain/enginerecord.cpp:389

@Uwe @illusio: is there a benefit from using ffmpeg for mp3 recording over lame?

mixxxbot commented 2 years ago

Commented by: daschuer Date: 2016-09-17T14:46:00Z


It looks like ffmpeg uses liblame anyway. So the benefit it that ffmpeg is a nice wrapper for any encoder library.

However, currently liblame works, ffmpeg crashes.

I can confirm the crash, with https://github.com/mixxxdj/mixxx/pull/1003, but only if I record wave before.

mixxxbot commented 2 years ago

Commented by: ronso0 Date: 2016-09-25T13:29:07Z


@Daniel about that failing m4a with the faad-only build: I'm compiling 5936 without ffmpeg and will try to find that file(s), right now I can't recall what it was, probably some mp4 > m4a extraction with avconv. The conversation with tapir is here: http://www.mixxx.org/forums/viewtopic.php?f=3&t=8231

mixxxbot commented 2 years ago

Commented by: ronso0 Date: 2016-09-25T15:19:56Z


@Daniel Okay, I found that file. When reporting a new bug on this it point to this bug: https://bugs.launchpad.net/mixxx/+bug/1519472

Log output is the same, fails on non-fixed sample durations.

mixxxbot commented 2 years ago

Commented by: illuusio Date: 2018-12-03T18:20:32Z


Not having time for Mixxx for a while I'm slowly trying to get into business again. This is mostly Janitor job. There is more reason to use FFMpeg than separated libraries for encoding because when you have understand API you can render anything but as it seems it's always like this and doesn't work with new version of FFMpeg. It try to get on with patch on this.