Opened 13 years ago
Last modified 12 years ago
#1476 new defect
rtp pcm_alaw/pcm_mulaw streaming from ALSA
| Reported by: | Spideru | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | git-master | Keywords: | crash SIGSEGV |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
- What I was trying to accomplish:
I am trying to stream ALSA audio in (one channel) over RTP, to a VLC server with pcm_alaw/pcm_mulaw format @8ksample/s.
- The problem I encountered:
After few seconds (from 5 to 100, randomly) of correct and audible sound on server (but with wrong stream speed), the program (ffmpeg) exit with "segmentation fault".
- Exact command line:
./ffmpeg -f alsa -ar 8000 -ac 1 -i hw:1,0 -ar 8000 -acodec pcm_alaw -ab 64k -f rtp rtp://127.0.0.1:1234
- Output of ffmpeg -v 9 -loglevel 99 -report:
- Output of debug as described here http://ffmpeg.org/bugreports.html :
- Summary of the bug:
Program exit with segmentation fault
- How to reproduce:
run command and wait few seconds
ffmpeg version N-41796-g1bb30d0
built on Jun 22 2012 10:56:44 with gcc 4.6.3
configuration: --enable-libx264 --enable-gpl
libavutil 51. 59.100 / 51. 59.100
libavcodec 54. 29.100 / 54. 29.100
libavformat 54. 10.100 / 54. 10.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 82.100 / 2. 82.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
Change History (5)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
I can not reproduce here. Please:
- try to determine what part of the command line are actually relevant for the bug, using successively
-f null, no-acodec, input from a file rather than ALSA, etc.;
- provide
valgrindoutput of the minimal command line.
(It seems that ALSA is returning some unitialized data in the first packet, but that can probably not be related to a segfault in lavfi dozens of seconds later.)
comment:3 by , 13 years ago
I have done several tests, it seems that the problem appears only when using an external mic (USB type).
for example:
./ffmpeg -f alsa -ar 8000 -ac 1 -i default -ar 8000 -acodec pcm_alaw -f rtp rtp://127.0.0.1:1234
works perfectly (default is internal mic in)
but this:
./ffmpeg -f alsa -ar 8000 -ac 1 -i hw:1,0 -ar 8000 -acodec pcm_alaw -f rtp rtp://127.0.0.1:1234
generates a segmentation fault after a minute (hw:1,0 is external USB mic in).
comment:4 by , 13 years ago
| Component: | FFmpeg → undetermined |
|---|---|
| Keywords: | crash SIGSEGV added |
Is this problem still reproducible with current git head?
comment:5 by , 12 years ago
| Priority: | important → normal |
|---|
decreasing priority as clearly a bug that noone can or is willing to try to reproduce in 6month isnt "important"



I'll just copy/paste what's on pastebin, so it doesn't expire some time in the future..
ffmpeg started on 2012-06-22 at 14:40:04 Report written to "ffmpeg-20120622-144004.log" Command line: ./ffmpeg -v 9 -loglevel 99 -report -f alsa -ar 8000 -ac 1 -i hw:1,0 -ar 8000 -acodec pcm_alaw -ab 64k -f rtp rtp://127.0.0.1:1234 ffmpeg version N-41796-g1bb30d0 Copyright (c) 2000-2012 the FFmpeg developers built on Jun 22 2012 10:56:44 with gcc 4.6.3 configuration: --enable-libx264 --enable-gpl libavutil 51. 59.100 / 51. 59.100 libavcodec 54. 29.100 / 54. 29.100 libavformat 54. 10.100 / 54. 10.100 libavdevice 54. 0.100 / 54. 0.100 libavfilter 2. 82.100 / 2. 82.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [alsa @ 0xa060a60] All info found [alsa @ 0xa060a60] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : mono Input #0, alsa, from 'hw:1,0': Duration: N/A, start: 1340368804.551118, bitrate: 705 kb/s Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s [abuffer source @ 0xa05efc0] Setting entry with key 'time_base' to value '1/1000000' [abuffer source @ 0xa05efc0] Setting entry with key 'sample_rate' to value '44100' [abuffer source @ 0xa05efc0] Setting entry with key 'sample_fmt' to value 's16' [abuffer source @ 0xa05efc0] Setting entry with key 'channel_layout' to value '0x4' [abuffer @ 0xa05f400] tb:1/1000000 samplefmt:s16 samplerate: 44100 ch layout:0x4 [aformat @ 0xa05f480] Setting entry with key 'sample_fmts' to value 's16' [aformat @ 0xa05f480] Setting entry with key 'sample_rates' to value '8000' [aformat @ 0xa05f5e0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'aformat' [auto-inserted resampler 0 @ 0xa05fa80] chl:mono fmt:s16 r:44100Hz -> chl:mono fmt:s16 r:8000Hz [rtp @ 0xa05daa0] Cannot respect max delay: frame size = 0 Output #0, rtp, to 'rtp://127.0.0.1:1234': Metadata: encoder : Lavf54.10.100 Stream #0:0, 0, 1/8000: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le -> pcm_alaw) Press [q] to stop, [?] for help size= 9kB time=00:00:00.56 bitrate= 133.9kbits/s size= 17kB time=00:00:01.06 bitrate= 134.1kbits/s size= 26kB time=00:00:01.57 bitrate= 134.0kbits/s size= 34kB time=00:00:02.07 bitrate= 134.0kbits/s size= 42kB time=00:00:02.58 bitrate= 134.0kbits/s size= 50kB time=00:00:03.08 bitrate= 134.0kbits/s size= 59kB time=00:00:03.59 bitrate= 134.0kbits/s size= 67kB time=00:00:04.10 bitrate= 134.0kbits/s size= 75kB time=00:00:04.60 bitrate= 134.1kbits/s size= 84kB time=00:00:05.11 bitrate= 134.1kbits/s size= 92kB time=00:00:05.62 bitrate= 134.1kbits/s size= 100kB time=00:00:06.13 bitrate= 134.1kbits/s size= 109kB time=00:00:06.64 bitrate= 134.1kbits/s size= 117kB time=00:00:07.14 bitrate= 134.1kbits/s size= 125kB time=00:00:07.65 bitrate= 134.0kbits/s size= 133kB time=00:00:08.15 bitrate= 134.1kbits/s size= 142kB time=00:00:08.65 bitrate= 134.1kbits/s size= 150kB time=00:00:09.15 bitrate= 134.1kbits/s size= 158kB time=00:00:09.65 bitrate= 134.1kbits/s size= 166kB time=00:00:10.16 bitrate= 134.1kbits/s size= 175kB time=00:00:10.67 bitrate= 134.1kbits/s size= 183kB time=00:00:11.17 bitrate= 134.1kbits/s size= 191kB time=00:00:11.67 bitrate= 134.1kbits/s size= 199kB time=00:00:12.18 bitrate= 134.1kbits/s size= 208kB time=00:00:12.68 bitrate= 134.1kbits/s size= 216kB time=00:00:13.18 bitrate= 134.1kbits/s size= 224kB time=00:00:13.69 bitrate= 134.1kbits/s size= 232kB time=00:00:14.19 bitrate= 134.1kbits/s size= 241kB time=00:00:14.70 bitrate= 134.1kbits/s size= 249kB time=00:00:15.20 bitrate= 134.1kbits/s size= 257kB time=00:00:15.70 bitrate= 134.1kbits/s size= 265kB time=00:00:16.21 bitrate= 134.1kbits/s size= 274kB time=00:00:16.71 bitrate= 134.1kbits/s size= 282kB time=00:00:17.21 bitrate= 134.1kbits/sgdb output:
$ gdb ./ffmpeg_g GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/adriano/ffmpeg_git/ffmpeg/ffmpeg_g...done. (gdb) r -f alsa -ar 8000 -ac 1 -i hw:1,0 -ar 8000 -acodec pcm_alaw -ab 64k -f rtp rtp://127.0.0.1:1234 Starting program: /home/adriano/ffmpeg_git/ffmpeg/ffmpeg_g -f alsa -ar 8000 -ac 1 -i hw:1,0 -ar 8000 -acodec pcm_alaw -ab 64k -f rtp rtp://127.0.0.1:1234 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1". ffmpeg version N-41796-g1bb30d0 Copyright (c) 2000-2012 the FFmpeg developers built on Jun 22 2012 10:56:44 with gcc 4.6.3 configuration: --enable-libx264 --enable-gpl libavutil 51. 59.100 / 51. 59.100 libavcodec 54. 29.100 / 54. 29.100 libavformat 54. 10.100 / 54. 10.100 libavdevice 54. 0.100 / 54. 0.100 libavfilter 2. 82.100 / 2. 82.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [alsa @ 0x8f524c0] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : mono Input #0, alsa, from 'hw:1,0': Duration: N/A, start: 1340369169.952557, bitrate: 705 kb/s Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s [aformat @ 0x8f50b00] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'aformat' [auto-inserted resampler 0 @ 0x8f519a0] chl:mono fmt:s16 r:44100Hz -> chl:mono fmt:s16 r:8000Hz [rtp @ 0x8f4c940] Cannot respect max delay: frame size = 0 Output #0, rtp, to 'rtp://127.0.0.1:1234': Metadata: encoder : Lavf54.10.100 Stream #0:0: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le -> pcm_alaw) SDP: v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Name c=IN IP4 127.0.0.1 t=0 0 a=tool:libavformat 54.10.100 m=audio 1234 RTP/AVP 8 b=AS:64 Press [q] to stop, [?] for help size= 883kB time=00:00:53.89 bitrate= 134.2kbits/s Program received signal SIGSEGV, Segmentation fault. 0x080ab79f in avfilter_copy_buffer_ref_props (dst=0x0, src=0x8f6b280) at libavfilter/buffer.c:169 169 dst->pts = src->pts; (gdb) bt #0 0x080ab79f in avfilter_copy_buffer_ref_props (dst=0x0, src=0x8f6b280) at libavfilter/buffer.c:169 #1 0x080d18c6 in filter_samples (inlink=0x8f51020, insamplesref=0x8f6b280) at libavfilter/af_aresample.c:178 #2 0x080a745a in ff_filter_samples (link=0x8f51020, samplesref=0x8f6b280) at libavfilter/audio.c:213 #3 0x080a745a in ff_filter_samples (link=0x8f50f60, samplesref=0x8f6b280) at libavfilter/audio.c:213 #4 0x080abe68 in request_frame (link=0x8f50f60) at libavfilter/buffersrc.c:445 #5 0x080a95bf in ff_request_frame (link=0x8f51020) at libavfilter/avfilter.c:325 #6 avfilter_request_frame (link=0x8f51020) at libavfilter/avfilter.c:594 #7 0x080d1744 in request_frame (outlink=0x8f517c0) at libavfilter/af_aresample.c:214 #8 0x080a880f in ff_request_frame (link=0x8f51100) at libavfilter/avfilter.c:325 #9 0x080abab8 in av_buffersink_read (ctx=0x8f50760, buf=0xbfffe518) at libavfilter/buffersink.c:109 #10 0x08095d7f in poll_filters () at ffmpeg.c:1928 #11 0x08099f64 in transcode () at ffmpeg.c:3612 #12 0x0808cf6a in main (argc=<optimized out>, argv=<optimized out>) at ffmpeg.c:5921 (gdb) disass $pc-32,$pc+32 Dump of assembler code from 0x80ab77f to 0x80ab7bf: 0x080ab77f <avfilter_unref_bufferp+15>: (bad) 0x080ab780 <avfilter_unref_bufferp+16>: (bad) 0x080ab781 <avfilter_unref_bufferp+17>: inc %edi 0x080ab783 <avfilter_unref_bufferp+19>: add (%eax),%eax 0x080ab785 <avfilter_unref_bufferp+21>: add %al,(%eax) 0x080ab787 <avfilter_unref_bufferp+23>: add %al,-0x3ca4e73c(%ebx) 0x080ab78d: lea 0x0(%esi),%esi 0x080ab790 <avfilter_copy_buffer_ref_props+0>: push %ebx 0x080ab791 <avfilter_copy_buffer_ref_props+1>: mov 0xc(%esp),%eax 0x080ab795 <avfilter_copy_buffer_ref_props+5>: mov 0x8(%esp),%edx 0x080ab799 <avfilter_copy_buffer_ref_props+9>: mov 0x48(%eax),%ecx 0x080ab79c <avfilter_copy_buffer_ref_props+12>: mov 0x4c(%eax),%ebx => 0x080ab79f <avfilter_copy_buffer_ref_props+15>: mov %ecx,0x48(%edx) 0x080ab7a2 <avfilter_copy_buffer_ref_props+18>: mov 0x50(%eax),%ecx 0x080ab7a5 <avfilter_copy_buffer_ref_props+21>: mov %ebx,0x4c(%edx) 0x080ab7a8 <avfilter_copy_buffer_ref_props+24>: mov 0x54(%eax),%ebx 0x080ab7ab <avfilter_copy_buffer_ref_props+27>: mov %ecx,0x50(%edx) 0x080ab7ae <avfilter_copy_buffer_ref_props+30>: mov 0x5c(%eax),%ecx 0x080ab7b1 <avfilter_copy_buffer_ref_props+33>: mov %ebx,0x54(%edx) 0x080ab7b4 <avfilter_copy_buffer_ref_props+36>: test %ecx,%ecx 0x080ab7b6 <avfilter_copy_buffer_ref_props+38>: jne 0x80ab7f0 <avfilter_copy_buffer_ref_props+96> ---Type <return> to continue, or q <return> to quit--- 0x080ab7b8 <avfilter_copy_buffer_ref_props+40>: mov 0x60(%eax),%eax 0x080ab7bb <avfilter_copy_buffer_ref_props+43>: mov 0x60(%edx),%edx 0x080ab7be <avfilter_copy_buffer_ref_props+46>: mov (%eax),%ecx End of assembler dump. (gdb) info all-registers eax 0x8f6b280 150385280 ecx 0x33aaa9e 54176414 edx 0x0 0 ebx 0x0 0 esp 0xbfffddc8 0xbfffddc8 ebp 0x0 0x0 esi 0x8f51020 150278176 edi 0x8f6b280 150385280 eip 0x80ab79f 0x80ab79f <avfilter_copy_buffer_ref_props+15> eflags 0x210286 [ PF SF IF RF ID ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 st0 0.0096715819061950827895124405131355161 (raw 0x3ff89e758dff365da000) st1 2.4075930937553908783854694775072858 (raw 0x40009a160157f04fb800) st2 2.4075930937553908783854694775072858 (raw 0x40009a160157f04fb800) st3 0.019157279608339034676633971798764833 (raw 0x3ff99cefba2cbd982---Type <return> to continue, or q <return> to quit--- 800) st4 -108000000000 (raw 0xc023c92a69c000000000) st5 1000000 (raw 0x4012f424000000000000) st6 4 (raw 0x40018000000000000000) st7 0.72562358276643990073750956071307883 (raw 0x3ffeb9c27795302e7000) fctrl 0x37f 895 fstat 0x120 288 ftag 0xffff 65535 fiseg 0x73 115 fioff 0x80d1892 135075986 foseg 0x7b 123 fooff 0xbfffde0c -1073750516 fop 0x35c 860 xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, ---Type <return> to continue, or q <return> to quit--- v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = { 0x8000000000000000, 0x8000000000000000}, v16_int8 = {0x0, 0x0, 0x0, 0xff <repeats 13 times>}, v8_int16 = {0x0, 0xff00, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}, v4_int32 = {0xff000000, 0xffffffff, 0xffffffff, 0xffffffff}, v2_int64 = {0xffffffffff000000, 0xffffffffffffffff}, uint128 = 0xffffffffffffffffffffffffff000000} xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, ---Type <return> to continue, or q <return> to quit--- 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} mxcsr 0x1f80 [ IM DM ZM OM UM PM ] mm0 {uint64 = 0x9e758dff365da000, v2_int32 = {0x365da000, 0x9e758dff}, v4_int16 = {0xa000, 0x365d, 0x8dff, 0x9e75}, v8_int8 = {0x0, 0xa0, 0x5d, 0x36, 0xff, 0x8d, 0x75, 0x9e}} mm1 {uint64 = 0x9a160157f04fb800, v2_int32 = {0xf04fb800, 0x9a160157}, v4_int16 = {0xb800, 0xf04f, 0x157, 0x9a16}, v8_int8 = {0x0, 0xb8, 0x4f, 0xf0, 0x57, 0x1, 0x16, 0x9a}} mm2 {uint64 = 0x9a160157f04fb800, v2_int32 = {0xf04fb800, 0x9a160157}, v4_int16 = {0xb800, 0xf04f, 0x157, 0x9a16}, v8_int8 = {0x0, 0xb8, 0x4f, 0xf0, 0x57, 0x1, 0x16, 0x9a}} mm3 {uint64 = 0x9cefba2cbd982800, v2_int32 = {0xbd982800, 0x9cefba2c}, v4_int16 = {0x2800, 0xbd98, 0xba2c, 0x9cef}, v8_int8 = {0x0, 0x28, 0x98, 0xbd, 0x2c, 0xba, 0xef, 0x9c}} mm4 {uint64 = 0xc92a69c000000000, v2_int32 = {0x0, 0xc92a69c0}, v4_int16 = {0x0, 0x0, 0x69c0, 0xc92a}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0xc0, 0x69, 0x2a, 0xc9}} mm5 {uint64 = 0xf424000000000000, v2_int32 = {0x0, 0xf4240000}, v4_int16 = {0x0, 0x0, 0x0, 0xf424}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0xf4}} mm6 {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ---Type <return> to continue, or q <return> to quit--- 0x0, 0x80}} mm7 {uint64 = 0xb9c27795302e7000, v2_int32 = {0x302e7000, 0xb9c27795}, v4_int16 = {0x7000, 0x302e, 0x7795, 0xb9c2}, v8_int8 = {0x0, 0x70, 0x2e, 0x30, 0x95, 0x77, 0xc2, 0xb9}} (gdb)