[FFmpeg-trac] #1570(avdevice:closed): libv4l2: error dequeuing buf: Resource temporarily unavailable

FFmpeg trac at avcodec.org
Sun Mar 3 20:15:35 CET 2013


#1570: libv4l2: error dequeuing buf: Resource temporarily unavailable
-------------------------------------+-------------------------------------
             Reporter:  llarevo      |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  important    |                Component:  avdevice
              Version:  git-master   |               Resolution:  fixed
             Keywords:  v4l2         |               Blocked By:
  regression                         |  Reproduced by developer:  1
             Blocking:               |
Analyzed by developer:  1            |
-------------------------------------+-------------------------------------

Comment (by llarevo):

 Further tests show, that it's not possible to capture audio (i'm not
 familiar with ffmpeg, so i'm unsure if I did everything right)

 Both tests create mpegs with a sound stream, but this is completely
 silent.

 Capturing with mencoder and these settings works without any problems, I
 also have sound when watching tv with mplayer.

 ################## Prererquisits ######################
 ### setting up v4l ###
 {{{
 v4lctl -c /dev/video0 setchannel E6
 v4lctl -c /dev/video0 setnorm PAL-BG
 v4lctl -c /dev/video0 setinput 0
 v4lctl -c /dev/video0 setattr mute off
 v4lctl -c /dev/video0 volume 15
 v4lctl -c /dev/video0 setattr automute off
 v4lctl -c /dev/video0 setattr "audio mode" stereo
 v4lctl -c /dev/video0 show
 norm: PAL-BG
 input: Television
 audio mode: stereo
 bright: 128
 contrast: 68
 color: 64
 hue: 0
 volume: 15
 mute: off
 Mirror: off
 Invert: off
 y offset odd field: 0
 y offset even field: 0
 automute: off
 }}}

 ### looking for the right hardware ###
 {{{
 arecord -l
 **** List of CAPTURE Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 0: PCH [HDA Intel PCH], device 2: ALC892 Analog [ALC892 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 card 1: SAA7134 [SAA7134], device 0: SAA7134 PCM [SAA7134 PCM]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
 }}}

 ### look for soundcard controls ###
 {{{
 amixer -c1 controls
 numid=2,iface=MIXER,name='Line Volume',index=1
 numid=3,iface=MIXER,name='Line Volume',index=2
 numid=5,iface=MIXER,name='Line Capture Switch',index=1
 numid=6,iface=MIXER,name='Line Capture Switch',index=2
 numid=1,iface=MIXER,name='Video Volume'
 numid=4,iface=MIXER,name='Video Capture Switch'
 }}}

 ### set soundcard unmute and 100 % ###
 {{{
 amixer -c 1 sset Video,0 100%,100% unmute cap
 Simple mixer control 'Video',0
   Capabilities: volume cswitch
   Playback channels: Front Left - Front Right
   Capture channels: Front Left - Front Right
   Limits: 0 - 20
   Front Left: 20 [100%] Capture [on]
   Front Right: 20 [100%] Capture [on]
 }}}


 ################## Capturing after setting prerequisits
 ######################

 ### start recording ffmpeg without --enable-libv4l2: video OK, no sound
 ###
 {{{
 ffmpeg -loglevel debug -f alsa -ac 2 -i hw:SAA7134 -f video4linux2 -i
 /dev/video0 -flags +ilme+ildct -aspect 4/3 -target pal-dvd -y test.mpeg >
 test.log 2>&1
 ffmpeg version N-50436-g1d5b35c Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Mar  2 2013 20:07:18 with gcc 4.7.2 (GCC) 20121109 (Red Hat
 4.7.2-8)
   configuration: --prefix=/usr/local --enable-ffplay
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.102 / 54. 63.102
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 41.100 /  3. 41.100
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
 Splitting the commandline.
 Reading option '-loglevel' ... matched as option 'loglevel' (set libav*
 logging level) with argument 'debug'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'alsa'.
 Reading option '-ac' ... matched as option 'ac' (set number of audio
 channels) with argument '2'.
 Reading option '-i' ... matched as input file with argument 'hw:SAA7134'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'video4linux2'.
 Reading option '-i' ... matched as input file with argument '/dev/video1'.
 Reading option '-flags' ... matched as AVOption 'flags' with argument
 '+ilme+ildct'.
 Reading option '-aspect' ... matched as option 'aspect' (set aspect ratio
 (4:3, 16:9 or 1.3333, 1.7777)) with argument '4/3'.
 Reading option '-target' ... matched as option 'target' (specify target
 file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd",
 ...)) with argument 'pal-dvd'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option 'test.mpeg' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option loglevel (set libav* logging level) with argument debug.
 Applying option y (overwrite output files) with argument 1.
 Successfully parsed a group of options.
 Parsing a group of options: input file hw:SAA7134.
 Applying option f (force format) with argument alsa.
 Applying option ac (set number of audio channels) with argument 2.
 Successfully parsed a group of options.
 Opening an input file: hw:SAA7134.
 [alsa @ 0x3383680] All info found
 [alsa @ 0x3383680] Estimating duration from bitrate, this may be
 inaccurate
 Guessed Channel Layout for  Input Stream #0.0 : stereo
 Input #0, alsa, from 'hw:SAA7134':
   Duration: N/A, start: 1362330450.898367, bitrate: 1024 kb/s
     Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 32000 Hz, stereo, s16,
 1024 kb/s
 Successfully opened the file.
 Parsing a group of options: input file /dev/video1.
 Applying option f (force format) with argument video4linux2.
 Successfully parsed a group of options.
 Opening an input file: /dev/video1.
 [video4linux2,v4l2 @ 0x3395100] fd:3 capabilities:5010015
 [video4linux2,v4l2 @ 0x3395100] Selecting input_channel: 0
 [video4linux2,v4l2 @ 0x3395100] input_channel: 0, input_name: Television
 [video4linux2,v4l2 @ 0x3395100] Querying the device for the current frame
 size
 [video4linux2,v4l2 @ 0x3395100] Setting frame size to 720x576
 [video4linux2,v4l2 @ 0x3395100] The V4L2 driver is using the interlaced
 mode
 [video4linux2,v4l2 @ 0x3395100] Current standard: PAL-BG, id: 7,
 frameperiod: 1/25
 [video4linux2,v4l2 @ 0x3395100] All info found
 [video4linux2,v4l2 @ 0x3395100] Estimating duration from bitrate, this may
 be inaccurate
 Input #1, video4linux2,v4l2, from '/dev/video1':
   Duration: N/A, start: 1362330450.970108, bitrate: 124416 kb/s
     Stream #1:0, 1, 1/1000000: Video: rawvideo (I420 / 0x30323449),
 yuv420p, 720x576, 1/1000000, 124416 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k
 tbc
 Successfully opened the file.
 Parsing a group of options: output file test.mpeg.
 Applying option aspect (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777))
 with argument 4/3.
 Applying option target (specify target file type ("vcd", "svcd", "dvd",
 "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)) with argument pal-dvd.
 Successfully parsed a group of options.
 Opening an output file: test.mpeg.
 Successfully opened the file.
 [buffer @ 0x3366180] Setting entry with key 'video_size' to value
 '720x576'
 [buffer @ 0x3366180] Setting entry with key 'pix_fmt' to value '0'
 [buffer @ 0x3366180] Setting entry with key 'time_base' to value
 '1/1000000'
 [buffer @ 0x3366180] Setting entry with key 'pixel_aspect' to value '0/1'
 [buffer @ 0x3366180] Setting entry with key 'sws_param' to value 'flags=2'
 [buffer @ 0x3366180] Setting entry with key 'frame_rate' to value '25/1'
 [graph 0 input from stream 1:0 @ 0x3383560] w:720 h:576 pixfmt:yuv420p
 tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
 [scale @ 0x3396000] Setting 'w' to value '720'
 [scale @ 0x3396000] Setting 'h' to value '576'
 [scale @ 0x3396000] Setting 'flags' to value '0x4'
 [scaler for output stream 0:0 @ 0x3395c80] w:720 h:576 flags:'0x4'
 interl:0
 [scaler for output stream 0:0 @ 0x3395c80] w:720 h:576 fmt:yuv420p sar:0/1
 -> w:720 h:576 fmt:yuv420p sar:0/1 flags:0x4
 [abuffer @ 0x3367e60] Setting entry with key 'time_base' to value
 '1/32000'
 [abuffer @ 0x3367e60] Setting entry with key 'sample_rate' to value
 '32000'
 [abuffer @ 0x3367e60] Setting entry with key 'sample_fmt' to value 's16'
 [abuffer @ 0x3367e60] Setting entry with key 'channel_layout' to value
 '0x3'
 [graph 1 input from stream 0:0 @ 0x3366960] tb:1/32000 samplefmt:s16
 samplerate:32000 chlayout:0x3
 [aformat @ 0x3367060] Setting entry with key 'sample_fmts' to value 'fltp'
 [aformat @ 0x3367060] Setting entry with key 'sample_rates' to value
 '48000'
 [aformat @ 0x3367060] Setting entry with key 'channel_layouts' to value
 '0x4,0x3,0x103,0x7,0x603,0x33,0x107,0x607,0x37,0xc,0xb,0x10b,0xf,0x60b,0x3b,0x10f,0x60f,0x3f'
 [audio format for output stream 0:1 @ 0x3383ee0] auto-inserting filter
 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the
 filter 'audio format for output stream 0:1'
 [auto-inserted resampler 0 @ 0x33696c0] ch:2 chl:stereo fmt:s16 r:32000Hz
 -> ch:2 chl:stereo fmt:fltp r:48000Hz
 [mpeg2video @ 0x3396e00] detected 4 logical cores
 [mpeg2video @ 0x3396e00] intra_quant_bias = 96 inter_quant_bias = 0
 Output #0, dvd, to 'test.mpeg':
   Metadata:
     encoder         : Lavf54.63.102
     Stream #0:0, 0, 1/90000: Video: mpeg2video, yuv420p, 720x576 [SAR
 16:15 DAR 4:3], 1/25, q=2-31, 6000 kb/s, 90k tbn, 25 tbc
     Stream #0:1, 0, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s
 Stream mapping:
   Stream #1:0 -> #0:0 (rawvideo -> mpeg2video)
   Stream #0:0 -> #0:1 (pcm_s16le -> ac3)
 Press [q] to stop, [?] for help
 [dvd @ 0x33965a0] First SCR: 0 First DTS: 45000
 frame=  131 fps= 25 q=2.9 Lsize=    4216kB time=00:00:05.27
 bitrate=6545.9kbits/s
 video:3850kB audio:289kB subtitle:0 global headers:0kB muxing overhead
 1.871097%
 }}}



 ### start recording ffmpeg with --enable-libv4l2: video OK, no sound, lots
 of v4l2-errors ###
 {{{
 ffmpeg -loglevel debug -f alsa -ac 2 -i hw:SAA7134 -f video4linux2 -i
 /dev/video0 -flags +ilme+ildct -aspect 4/3 -target pal-dvd -y test.mpeg >
 test.log 2>&1
 ffmpeg version N-50436-g1d5b35c Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Mar  3 2013 19:03:18 with gcc 4.7.2 (GCC) 20121109 (Red Hat
 4.7.2-8)
   configuration: --prefix=/usr/local --enable-ffplay --enable-libv4l2
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.102 / 54. 63.102
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 41.100 /  3. 41.100
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
 Splitting the commandline.
 Reading option '-loglevel' ... matched as option 'loglevel' (set libav*
 logging level) with argument 'debug'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'alsa'.
 Reading option '-ac' ... matched as option 'ac' (set number of audio
 channels) with argument '2'.
 Reading option '-i' ... matched as input file with argument 'hw:SAA7134'.
 Reading option '-f' ... matched as option 'f' (force format) with argument
 'video4linux2'.
 Reading option '-i' ... matched as input file with argument '/dev/video0'.
 Reading option '-flags' ... matched as AVOption 'flags' with argument
 '+ilme+ildct'.
 Reading option '-aspect' ... matched as option 'aspect' (set aspect ratio
 (4:3, 16:9 or 1.3333, 1.7777)) with argument '4/3'.
 Reading option '-target' ... matched as option 'target' (specify target
 file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd",
 ...)) with argument 'pal-dvd'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option 'test.mpeg' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option loglevel (set libav* logging level) with argument debug.
 Applying option y (overwrite output files) with argument 1.
 Successfully parsed a group of options.
 Parsing a group of options: input file hw:SAA7134.
 Applying option f (force format) with argument alsa.
 Applying option ac (set number of audio channels) with argument 2.
 Successfully parsed a group of options.
 Opening an input file: hw:SAA7134.
 [alsa @ 0x2b58680] All info found
 [alsa @ 0x2b58680] Estimating duration from bitrate, this may be
 inaccurate
 Guessed Channel Layout for  Input Stream #0.0 : stereo
 Input #0, alsa, from 'hw:SAA7134':
   Duration: N/A, start: 1362333848.816497, bitrate: 1024 kb/s
     Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 32000 Hz, stereo, s16,
 1024 kb/s
 Successfully opened the file.
 Parsing a group of options: input file /dev/video0.
 Applying option f (force format) with argument video4linux2.
 Successfully parsed a group of options.
 Opening an input file: /dev/video0.
 [video4linux2,v4l2 @ 0x2b6a100] fd:3 capabilities:5010015
 [video4linux2,v4l2 @ 0x2b6a100] Selecting input_channel: 0
 [video4linux2,v4l2 @ 0x2b6a100] input_channel: 0, input_name: Television
 [video4linux2,v4l2 @ 0x2b6a100] Querying the device for the current frame
 size
 [video4linux2,v4l2 @ 0x2b6a100] Setting frame size to 720x576
 [video4linux2,v4l2 @ 0x2b6a100] The V4L2 driver is using the interlaced
 mode
 [video4linux2,v4l2 @ 0x2b6a100] Current standard: PAL-BG, id: 7,
 frameperiod: 1/25
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 =========> many more libv4l2-errors <===========
 [video4linux2,v4l2 @ 0x2b6a100] All info found
 [video4linux2,v4l2 @ 0x2b6a100] Estimating duration from bitrate, this may
 be inaccurate
 Input #1, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 1362333848.912498, bitrate: 124416 kb/s
     Stream #1:0, 1, 1/1000000: Video: rawvideo (I420 / 0x30323449),
 yuv420p, 720x576, 1/1000000, 124416 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k
 tbc
 Successfully opened the file.
 Parsing a group of options: output file test.mpeg.
 Applying option aspect (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777))
 with argument 4/3.
 Applying option target (specify target file type ("vcd", "svcd", "dvd",
 "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)) with argument pal-dvd.
 Successfully parsed a group of options.
 Opening an output file: test.mpeg.
 Successfully opened the file.
 [buffer @ 0x2b6e380] Setting entry with key 'video_size' to value
 '720x576'
 [buffer @ 0x2b6e380] Setting entry with key 'pix_fmt' to value '0'
 [buffer @ 0x2b6e380] Setting entry with key 'time_base' to value
 '1/1000000'
 [buffer @ 0x2b6e380] Setting entry with key 'pixel_aspect' to value '0/1'
 [buffer @ 0x2b6e380] Setting entry with key 'sws_param' to value 'flags=2'
 [buffer @ 0x2b6e380] Setting entry with key 'frame_rate' to value '25/1'
 [graph 0 input from stream 1:0 @ 0x2b58560] w:720 h:576 pixfmt:yuv420p
 tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
 [scale @ 0x2b6ea00] Setting 'w' to value '720'
 [scale @ 0x2b6ea00] Setting 'h' to value '576'
 [scale @ 0x2b6ea00] Setting 'flags' to value '0x4'
 [scaler for output stream 0:0 @ 0x2b6e5a0] w:720 h:576 flags:'0x4'
 interl:0
 [scaler for output stream 0:0 @ 0x2b6e5a0] w:720 h:576 fmt:yuv420p sar:0/1
 -> w:720 h:576 fmt:yuv420p sar:0/1 flags:0x4
 [abuffer @ 0x2b3c180] Setting entry with key 'time_base' to value
 '1/32000'
 [abuffer @ 0x2b3c180] Setting entry with key 'sample_rate' to value
 '32000'
 [abuffer @ 0x2b3c180] Setting entry with key 'sample_fmt' to value 's16'
 [abuffer @ 0x2b3c180] Setting entry with key 'channel_layout' to value
 '0x3'
 [graph 1 input from stream 0:0 @ 0x2b6ebc0] tb:1/32000 samplefmt:s16
 samplerate:32000 chlayout:0x3
 [aformat @ 0x2b3b920] Setting entry with key 'sample_fmts' to value 'fltp'
 [aformat @ 0x2b3b920] Setting entry with key 'sample_rates' to value
 '48000'
 [aformat @ 0x2b3b920] Setting entry with key 'channel_layouts' to value
 '0x4,0x3,0x103,0x7,0x603,0x33,0x107,0x607,0x37,0xc,0xb,0x10b,0xf,0x60b,0x3b,0x10f,0x60f,0x3f'
 [audio format for output stream 0:1 @ 0x2b3c400] auto-inserting filter
 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the
 filter 'audio format for output stream 0:1'
 [auto-inserted resampler 0 @ 0x2b3e760] ch:2 chl:stereo fmt:s16 r:32000Hz
 -> ch:2 chl:stereo fmt:fltp r:48000Hz
 [mpeg2video @ 0x2b6f880] detected 4 logical cores
 [mpeg2video @ 0x2b6f880] intra_quant_bias = 96 inter_quant_bias = 0
 Output #0, dvd, to 'test.mpeg':
   Metadata:
     encoder         : Lavf54.63.102
     Stream #0:0, 0, 1/90000: Video: mpeg2video, yuv420p, 720x576 [SAR
 16:15 DAR 4:3], 1/25, q=2-31, 6000 kb/s, 90k tbn, 25 tbc
     Stream #0:1, 0, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s
 Stream mapping:
   Stream #1:0 -> #0:0 (rawvideo -> mpeg2video)
   Stream #0:0 -> #0:1 (pcm_s16le -> ac3)
 Press [q] to stop, [?] for help
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 ==============>many more libv4l2-errors<===========
 [dvd @ 0x2b6f080] First SCR: 0 First DTS: 45000
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 ==============>many more libv4l2-errors<===========
 frame=   13 fps=0.0 q=2.7 size=     526kB time=00:00:00.57
 bitrate=7536.3kbits/s
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 frame=   26 fps= 26 q=3.6 size=     912kB time=00:00:01.08
 bitrate=6894.0kbits/s
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 ==============>many more libv4l2-errors<===========
 (...)
 frame= 1641 fps= 25 q=4.3 size=   52626kB time=00:01:05.69
 bitrate=6562.6kbits/s
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 ==============>many more libv4l2-errors<===========
 frame= 1654 fps= 25 q=5.4 size=   53106kB time=00:01:06.20
 bitrate=6571.2kbits/s
 libv4l2: error dequeuing buf: Resource temporarily unavailable
 ==============>many more libv4l2-errors<===========
 video:49103kB audio:3654kB subtitle:0 global headers:0kB muxing overhead
 1.882066%
 Received signal 2: terminating.
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1570#comment:21>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list