Cannot set ALSA buffer size (Invalid argument) during capture
Hello! I am trying to capture audio from an ATI Wonder 600 USB adapter using ffmpeg -f alsa -ac 2 -ar 48000 -i hw:1,0 -t 10 a.wav but I receive the error [alsa @ 0x555d7c2850a0] cannot set ALSA buffer size (Invalid argument) hw:1,0: Input/output error using - ffmpeg version 3.3.4-2+b3 - alsa k4.13.0-1-amd64 - linux 4.13.0-1-amd64 Note that `arecord -l` gives: card 0: PCH [HDA Intel PCH], device 0: ALC1220 Analog [ALC1220 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 2: ALC1220 Alt Analog [ALC1220 Alt Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Em28xxAudio [Em28xx Audio], device 0: Em28xx Audio [Empia 28xx Capture] Subdevices: 1/1 Subdevice #0: subdevice #0 and I can capture audio/video without problems using the `qv4l2` test bench. Thanks! Marco
2017-11-26 13:06 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
Hello!
I am trying to capture audio from an ATI Wonder 600 USB adapter using
ffmpeg -f alsa -ac 2 -ar 48000 -i hw:1,0 -t 10 a.wav
but I receive the error
[alsa @ 0x555d7c2850a0] cannot set ALSA buffer size (Invalid argument) hw:1,0: Input/output error
It appears that this call and check are there for many years. Feel free to test a very old version of FFmpeg like 0.6 to find out if this is a regression.
using - ffmpeg version 3.3.4-2+b3
And please test current vanilla FFmpeg git head, nothing else is supported here. Carl Eugen
Hi Carl, Thank you for the help! I now compiled ffmpeg from sources (btw, the online doc was great) but I get the same error: $ ffmpeg -f alsa -i hw:1,0 -t 30 out.wav ffmpeg version N-89254-g37c57df Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7 (Debian 7.2.0-14) configuration: --prefix=/home/marco/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/marco/ffmpeg_build/include --extra-ldflags=-L/home/marco/ffmpeg_build/ lib --extra-libs='-lpthread -lm' --bindir=/home/marco/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enabl e-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree libavutil 56. 3.100 / 56. 3.100 libavcodec 58. 3.105 / 58. 3.105 libavformat 58. 2.102 / 58. 2.102 libavdevice 58. 0.100 / 58. 0.100 libavfilter 7. 5.100 / 7. 5.100 libswscale 5. 0.101 / 5. 0.101 libswresample 3. 0.101 / 3. 0.101 libpostproc 55. 0.100 / 55. 0.100 [alsa @ 0x55ac278ba740] cannot set ALSA buffer size (Invalid argument) hw:1,0: Input/output error I tried to compile ffmpeg 0.6.7 from GitHub, but without success; it gives the error: libavcodec/vaapi_mpeg4.c:89:73: error: implicit declaration of function ‘ff_h263_get_gob_height’; did you mean ‘ff_h261_encode_init’? Probably, I'm missing some old dependency? Thanks, Marco On Sun, Nov 26, 2017 at 4:17 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
2017-11-26 13:06 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
Hello!
I am trying to capture audio from an ATI Wonder 600 USB adapter using
ffmpeg -f alsa -ac 2 -ar 48000 -i hw:1,0 -t 10 a.wav
but I receive the error
[alsa @ 0x555d7c2850a0] cannot set ALSA buffer size (Invalid argument) hw:1,0: Input/output error
It appears that this call and check are there for many years.
Feel free to test a very old version of FFmpeg like 0.6 to find out if this is a regression.
using - ffmpeg version 3.3.4-2+b3
And please test current vanilla FFmpeg git head, nothing else is supported here.
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2017-11-26 22:51 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
Hi Carl,
Thank you for the help! I now compiled ffmpeg from sources (btw, the online doc was great) but I get the same error:
$ ffmpeg -f alsa -i hw:1,0 -t 30 out.wav ffmpeg version N-89254-g37c57df Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7 (Debian 7.2.0-14) configuration: --prefix=/home/marco/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/marco/ffmpeg_build/include --extra-ldflags=-L/home/marco/ffmpeg_build/ lib --extra-libs='-lpthread -lm' --bindir=/home/marco/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enabl e-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
Great if that worked for you, if you don't plan to distribute, installing libraries into /usr/local and running without extra-options may be simpler.
libavutil 56. 3.100 / 56. 3.100 libavcodec 58. 3.105 / 58. 3.105 libavformat 58. 2.102 / 58. 2.102 libavdevice 58. 0.100 / 58. 0.100 libavfilter 7. 5.100 / 7. 5.100 libswscale 5. 0.101 / 5. 0.101 libswresample 3. 0.101 / 3. 0.101 libpostproc 55. 0.100 / 55. 0.100 [alsa @ 0x55ac278ba740] cannot set ALSA buffer size (Invalid argument) hw:1,0: Input/output error
I tried to compile ffmpeg 0.6.7 from GitHub, but without success; it gives the error:
libavcodec/vaapi_mpeg4.c:89:73: error: implicit declaration of function ‘ff_h263_get_gob_height’; did you mean ‘ff_h261_encode_init’?
Probably, I'm missing some old dependency?
Unlikely, but try --disable-vaapi Please do not top-post here, Carl Eugen
On Sun, Nov 26, 2017 at 2:13 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
I tried to compile ffmpeg 0.6.7 from GitHub, but without success; it gives the error:
libavcodec/vaapi_mpeg4.c:89:73: error: implicit declaration of function ‘ff_h263_get_gob_height’; did you mean ‘ff_h261_encode_init’?
Probably, I'm missing some old dependency?
Unlikely, but try --disable-vaapi
It worked, but then I hit: ffserver.c: In function ‘rtsp_cmd_describe’: ffserver.c:2987:5: error: implicit declaration of function ‘ff_url_split’ [-Werror=implicit-function-declaration] So I tried to add '--disable-ffserver'; and it finished! Now, it gives a different error: ~/bin$ ./ffmpeg -f alsa -i hw:1,0 -t 30 out.wav FFmpeg version 0.6.7, Copyright (c) 2000-2010 the FFmpeg developers built on Nov 26 2017 18:07:01 with gcc 7.2.0 configuration: --disable-vaapi --disable-ffserver --prefix=/home/marco/ffmpeg_build --extra-cflags=-I/home/marco/ffmpeg_build/include --bindir=/home/marco/bin libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.11. 0 / 0.11. 0 [alsa @ 0x558ad41be420]cannot set channel count to 1 (Invalid argument) hw:1,0: Input/output error This gives maybe more insight! The USB capture card is stereo (two RCA connectors), but I'm capturing from a mono source (only one RCA connector is plugged into the USB device). Is there some additional option I should pass to ffmpeg? With qv4l2, I simply get audio only in one channel (right).
Please do not top-post here, Carl Eugen Apologies; I wasn't aware of the etiquette :-)
-- Marco
2017-11-27 3:14 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
Now, it gives a different error:
~/bin$ ./ffmpeg -f alsa -i hw:1,0 -t 30 out.wav FFmpeg version 0.6.7, Copyright (c) 2000-2010 the FFmpeg developers built on Nov 26 2017 18:07:01 with gcc 7.2.0 configuration: --disable-vaapi --disable-ffserver
--prefix=/home/marco/ffmpeg_build --extra-cflags=-I/home/marco/ffmpeg_build/include --bindir=/home/marco/bin
You can avoid these extra options by not installing and running the binary from the build directory (I never install).
libavutil 50.15. 1 / 50.15. 1 libavcodec 52.72. 2 / 52.72. 2 libavformat 52.64. 2 / 52.64. 2 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0.11. 0 / 0.11. 0 [alsa @ 0x558ad41be420]cannot set channel count to 1 (Invalid argument) hw:1,0: Input/output error
$ ffmpeg -f alsa -ac 2 -i hw:1,0 -t 30 out.wav Carl Eugen
$ ffmpeg -f alsa -ac 2 -i hw:1,0 -t 30 out.wav
Thanks! With this, 0.6.7 runs but newer versions still complain about: [alsa @ 0x55eb8e2a6780] cannot set ALSA buffer size (Invalid argument) hw:1,0: Input/output error Any idea? -- Marco
Thanks! With this, 0.6.7 runs
Sorry, I don't understand this sentence.
Using the option '-ac 2', ffmpeg 0.6.7 works. But, using the same option, the current version from the master git branch doesn't work. -- Marco
2017-11-27 4:45 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
Thanks! With this, 0.6.7 runs
Sorry, I don't understand this sentence.
Using the option '-ac 2', ffmpeg 0.6.7 works.
Then please use git bisect to find the change introducing the regression. Carl Eugen
On Sun, Nov 26, 2017 at 8:02 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
Then please use git bisect to find the change introducing the regression.
I'm trying, but many commits do not compile properly. Specifically, I'm stuck with: make: *** No rule to make target 'libavutil/macros.h', needed by 'libswscale/options.o'. Stop. at ddb630177a01609913c22ed03a7c9286231da892. Any idea on how to solve it? If I disable swscale, then I cannot compile the ffmpeg binary. Thanks.
e35c674d13a7f180412cfe058530a2e7f1d49a90 is the first bad commit commit e35c674d13a7f180412cfe058530a2e7f1d49a90 Author: Justin Ruggles <justin.ruggles@gmail.com> Date: Wed Jun 22 16:38:20 2011 -0400 alsa: limit buffer_size to 32768 frames. In testing, the file output plugin gave a max buffer size of about 20 million frames, which is way more than what is really needed and causes a memory allocation error on my system. :040000 040000 bc8ae5608ccfe6b46dc90633c535d91b4c6c0e2b 88c1baef83722b3310430a9933221876d0db6095 M libavdevice Best, Marco
2017-11-27 10:55 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
e35c674d13a7f180412cfe058530a2e7f1d49a90 is the first bad commit commit e35c674d13a7f180412cfe058530a2e7f1d49a90 Author: Justin Ruggles <justin.ruggles@gmail.com> Date: Wed Jun 22 16:38:20 2011 -0400
alsa: limit buffer_size to 32768 frames.
Great! Please double the definition of ALSA_BUFFER_SIZE_MAX on top of libavdevice/alsa.h until the device works for you and report back so I can commit the new value! Thank you, Carl Eugen
On Mon, Nov 27, 2017 at 2:43 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
Please double the definition of ALSA_BUFFER_SIZE_MAX on top of libavdevice/alsa.h until the device works for you and report back so I can commit the new value!
Doubling once from 65536 to 131072 was enough. -- Marco
2017-11-27 13:13 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
On Mon, Nov 27, 2017 at 2:43 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
Please double the definition of ALSA_BUFFER_SIZE_MAX on top of libavdevice/alsa.h until the device works for you and report back so I can commit the new value!
Doubling once from 65536 to 131072 was enough.
Should be fixed, thank you for the report! Carl Eugen
Well, thank you! FFmpeg is an impressive project. -- Marco
2017-11-27 8:34 GMT+01:00 Marco Paolieri <paolieri@gmail.com>:
On Sun, Nov 26, 2017 at 8:02 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
Then please use git bisect to find the change introducing the regression.
I'm trying, but many commits do not compile properly. Specifically, I'm stuck with:
make: *** No rule to make target 'libavutil/macros.h', needed by 'libswscale/options.o'. Stop.
Just for completeness: $ rm libswscale/options.d You forgot to use make distclean, needed for bisecting. Carl Eugen
participants (2)
-
Carl Eugen Hoyos -
Marco Paolieri