Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: alsa cannot open audio device hw:1,0 [Input/output error] question

  1. #1
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,211
    Distro
    Ubuntu 18.04 Bionic Beaver

    alsa cannot open audio device hw:1,0 [Input/output error] question

    I found out last year an easy way to convert VHS to an mkv file with flac sound
    but now I am getting an alsa problem everytime and have no idea why


    Nothing I can see has changed


    Code:
    cat /proc/asound/cards
     0 [PCH            ]: HDA-Intel - HDA Intel PCH
                          HDA Intel PCH at 0xdf220000 irq 130
     1 [Alpha          ]: USB-Audio - Lexicon Alpha
                          Lexicon Lexicon Alpha at usb-0000:00:14.0-6, full speed
     2 [CAMERA         ]: USB-Audio - USB2.0 PC CAMERA
                          ARKMICRO USB2.0 PC CAMERA at usb-0000:00:14.0-3, high speed








    Code:
    ffmpeg -f v4l2 -standard PAL -thread_queue_size 1024 -i /dev/video0 -f alsa -thread_queue_size 1024 -i hw:1,0  -c:v libx264  -s 720x576 -b:v 2400k -vf eq=saturation=0.5 -r 25 -aspect 4:3 -c:a flac -channels 2 -ar 48000   outfile.mkv
    ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
      built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
      configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
      WARNING: library configuration mismatch
      avcodec     configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
      libavutil      55. 78.100 / 55. 78.100
      libavcodec     57.107.100 / 57.107.100
      libavformat    57. 83.100 / 57. 83.100
      libavdevice    57. 10.100 / 57. 10.100
      libavfilter     6.107.100 /  6.107.100
      libavresample   3.  7.  0 /  3.  7.  0
      libswscale      4.  8.100 /  4.  8.100
      libswresample   2.  9.100 /  2.  9.100
      libpostproc    54.  7.100 / 54.  7.100
    [video4linux2,v4l2 @ 0x5561a6784bc0] This device does not support any standard
    [mjpeg @ 0x5561a6785f60] EOI missing, emulating
    Input #0, video4linux2,v4l2, from '/dev/video0':
      Duration: N/A, start: 3412.361590, bitrate: N/A
        Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    [alsa @ 0x5561a678ba00] cannot open audio device hw:1,0 (Device or resource busy)    BUT IT IS NOT BUSY WITH any process i can see
    hw:1,0: Input/output error
    Last edited by shantiq; May 7th, 2020 at 08:09 AM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  2. #2
    Join Date
    Jun 2007
    Beans
    14,082

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    BUT IT IS NOT BUSY WITH any process i can see
    So you looked at?:
    Code:
    lsof /dev/snd/*
    Have you considered trying '-f pulse' instead of '-f alsa'?
    https://ffmpeg.org/ffmpeg-devices.html#pulse

  3. #3
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,211
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    thanx Pasque

    ➊ had looked at
    Code:
    lsof /dev/snd/*
    which i take it shows processes still alive? and then to kill them with
    Code:
    sudo kill -15 pid
    or
    Code:
    sudo kill -9 pid
    I suppose?

    ➋ As regards pulse yes that sounds good but requires a reconfig

    Code:
    To enable this output device you need to configure FFmpeg with --enable-libpulse.
    There must a way to reset alsa so it does not glitch like this maybe here altho a tad loath to try those routes as many say they often worsen matters

    PS =====

    i used same command on an older PC I have got with Slackware installed and it is working with same ffmpeg command and fine there altho once it also gave me the
    Code:
    (Device or resource busy)
    runaround


    Sound is often a puzzle on Linux :]



    Anyway many thanx you have provided food for thought here ... will play further and see
    Last edited by shantiq; May 9th, 2020 at 08:47 AM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  4. #4
    Join Date
    Jun 2007
    Beans
    14,082

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    Quote Originally Posted by shantiq View Post
    To enable this output device you need to configure FFmpeg with --enable-libpulse.
    You don't have to worry about that. ffmpeg is already built with --enable-libpulse

    There must a way to reset alsa so it does not glitch
    Well, if something is really using the device, then it is not a "glitch". And no, I wouldn't try random commands to fix it.
    As for lsof, you'll probably find that pulseaudio itself is responsible for "grabbing" the hw:x,y device. You don't want to kill that. Are you sure that all applications using/playing audio are stopped before you attempt to use ffmpeg?

  5. #5
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,211
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    OK

    so
    Code:
    --enable-libpulse
    does not appear on my ffmpeg installed on my system or do you mean it is there but not spelt out


    Code:
    --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-openssl --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree

    And as re: all audio turned off YES emphatically
    Last edited by shantiq; May 9th, 2020 at 11:38 AM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  6. #6
    Join Date
    Jun 2007
    Beans
    14,082

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    Look at your ffmpeg configuration line:
    configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared

  7. #7
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,211
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    hi again if i choose pulse it does [as you can see in config not installed here]


    Code:
    ffmpeg -f v4l2 -standard PAL -thread_queue_size 1024 -i /dev/video0 -f pulse -thread_queue_size 1024 -i hw:1,0  -c:v libx264  -s 720x576 -b:v 2400k -vf eq=saturation=0.5 -r 25 -aspect 4:3 -c:a flac -channels 2 -ar 48000  ~/Desktop/floyd.mkvffmpeg version N-91586-g90dc584 Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
      configuration: --prefix=/home/shan/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/shan/ffmpeg_build/include --extra-ldflags=-L/home/shan/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/shan/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-openssl --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
      libavutil      56. 18.102 / 56. 18.102
      libavcodec     58. 22.101 / 58. 22.101
      libavformat    58. 17.101 / 58. 17.101
      libavdevice    58.  4.101 / 58.  4.101
      libavfilter     7. 26.100 /  7. 26.100
      libswscale      5.  2.100 /  5.  2.100
      libswresample   3.  2.100 /  3.  2.100
      libpostproc    55.  2.100 / 55.  2.100
    [video4linux2,v4l2 @ 0x55eefd7f5f00] This device does not support any standard
    [mjpeg @ 0x55eefd7f7500] EOI missing, emulating
    Input #0, video4linux2,v4l2, from '/dev/video0':
      Duration: N/A, start: 15065.860398, bitrate: N/A
        Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    Unknown input format: 'pulse'

    with

    Code:
    cat /proc/asound/cards 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                          HDA Intel PCH at 0xdf220000 irq 130
     1 [Alpha          ]: USB-Audio - Lexicon Alpha
                          Lexicon Lexicon Alpha at usb-0000:00:14.0-6, full speed
     2 [CAMERA         ]: USB-Audio - USB2.0 PC CAMERA
                          ARKMICRO USB2.0 PC CAMERA at usb-0000:00:14.0-3, high speed

    and

    Code:
    aplay -l**** List of PLAYBACK Hardware Devices ****
    card 0: PCH [HDA Intel PCH], device 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: Alpha [Lexicon Alpha], device 0: USB Audio [USB Audio]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    Last edited by shantiq; May 9th, 2020 at 12:01 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  8. #8
    Join Date
    Jun 2007
    Beans
    14,082

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    configuration: --prefix=/home/shan/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/shan/ffmpeg_build/include
    You seem to have two copies of ffmpeg installed, and your local/home copy looks like it's missing libpulse (and a bunch of other dependencies) for some reason. I honestly don't know what you're doing there.
    Also, if you're going to use '-f pulse', you need to use a pulse device (not hw:x,y).
    https://ffmpeg.org/ffmpeg-devices.html#pulse

  9. #9
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan
    Beans
    2,211
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    ok so pulse not an option as no wish to reinstall ffmpeg if avoidable
    was really more wanting to get alsa to "behave" here as it thinks there is a process going on
    so my question really is how to prod deeper into alsa so that it reveals where it thinks it is "busy"
    Anyone knows of ways of doing this ? I have read around a lot and far come up empty as to a way to "see" what it is doing

    Thank you so much for your help thus far

    I know the command is fine as is as it used to work and works on my Slackware oldie so the kink is with alsa here
    Last edited by shantiq; May 9th, 2020 at 02:29 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community
    Playing with Slackware too now ...
    ShanArt

  10. #10
    Join Date
    Jun 2007
    Beans
    14,082

    Re: alsa cannot open audio device hw:1,0 [Input/output error] question

    so my question really is how to prod deeper into alsa so that it reveals where it thinks it is "busy"
    Again,
    Code:
    lsof /dev/snd/*
    Please give the output!

    ok so pulse not an option as no wish to reinstall ffmpeg if avoidable
    There is no need to reinstall ffmpeg to use pulse. However, you do need to make sure you're using the system copy of ffmpeg (like you did in your initial post) and not the copy of ffmpeg you have in your /home.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •