title: 'arecord' works but FFMPEG 'cannot open audio device'
body: <p>On my Linux-based QNAP NAS, I can successfully record my Loopback audio device using:</p>
  
  <pre><code># arecord -D default:CARD=Loopback test.wav
  </code></pre>
  
  <p>However, FFMPEG cannot use this same audio device. It returns:</p>
  
  <pre><code>    [alsa @ 0x5a45880] cannot open audio device hw:default:CARD=Loopback (No such file or directory)
  hw:default:CARD=Loopback: Input/output error
  </code></pre>
  
  <p>I've also tried any number of <code>hw:</code> options in FFMPEG. For what it's worth, the arecord -l command returns:</p>
  
  <pre><code>**** List of CAPTURE Hardware Devices ****
  card 0: PCH [HDA Intel PCH], device 0: ALC262 Analog [ALC262 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  </code></pre>
  
  <p>arecord -L returns:</p>
  
  <pre><code>[~] # arecord -L
  null
      Discard all samples (playback) or generate zero samples (capture)
  sysdefault:CARD=PCH
      HDA Intel PCH, ALC262 Analog
      Default Audio Device
  front:CARD=PCH,DEV=0
      HDA Intel PCH, ALC262 Analog
      Front speakers
  sysdefault:CARD=Loopback
      Loopback, Loopback PCM
      Default Audio Device
  front:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      Front speakers
  surround21:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      2.1 Surround output to Front and Subwoofer speakers
  surround40:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      4.0 Surround output to Front and Rear speakers
  surround41:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      4.1 Surround output to Front, Rear and Subwoofer speakers
  surround50:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      5.0 Surround output to Front, Center and Rear speakers
  surround51:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      5.1 Surround output to Front, Center, Rear and Subwoofer speakers
  surround71:CARD=Loopback,DEV=0
      Loopback, Loopback PCM
      7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
  </code></pre>
  
  <p>FFMPEG command and response is:</p>
  
  <pre><code>[~] # /share/CACHEDEV1_DATA/.qpkg/ffmpeg/ffmpeg -f alsa -i hw:default:CARD=Loopback test.mp3
  ffmpeg version 4.2.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
    configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
    libavutil      56. 31.100 / 56. 31.100
    libavcodec     58. 54.100 / 58. 54.100
    libavformat    58. 29.100 / 58. 29.100
    libavdevice    58.  8.100 / 58.  8.100
    libavfilter     7. 57.100 /  7. 57.100
    libswscale      5.  5.100 /  5.  5.100
    libswresample   3.  5.100 /  3.  5.100
    libpostproc    55.  5.100 / 55.  5.100
  ALSA lib ../../../src/pcm/pcm.c:2564:(snd_pcm_open_noupdate) Unknown PCM hw:default:CARD=Loopback
  [alsa @ 0x5f64800] cannot open audio device hw:default:CARD=Loopback (No such file or directory)
  hw:default:CARD=Loopback: Input/output error
  </code></pre>
  
  <p>FFMPEG -sources alsa gives:</p>
  
  <pre><code>[~] # /share/CACHEDEV1_DATA/.qpkg/ffmpeg/ffmpeg -sources alsa
  ffmpeg version 4.2.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
    configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
    libavutil      56. 31.100 / 56. 31.100
    libavcodec     58. 54.100 / 58. 54.100
    libavformat    58. 29.100 / 58. 29.100
    libavdevice    58.  8.100 / 58.  8.100
    libavfilter     7. 57.100 /  7. 57.100
    libswscale      5.  5.100 /  5.  5.100
    libswresample   3.  5.100 /  3.  5.100
    libpostproc    55.  5.100 / 55.  5.100
  Auto-detected sources for alsa:
  ALSA lib ../../../src/control/control.c:1375:(snd_ctl_open_noupdate) Invalid CTL hw:0
  Cannot list sources.
  </code></pre>
  
  <p>Can anyone shed some light on why this is impossible in FFMPEG and suggest what I'm doing wrong here? FFMPEG includes the ALSA module, and is version 4.2.1. Thanks!</p>