title: Emulate Sound Card ALSA snd-dummy (Docker - Kernel Rebuild - ALSA snd-dummy)
body: <p>I am using a docker image which does not have the ALSA's snd-dummy module available. I need to emulate a sound card. I do not need (or want) to listen to audio.</p>
  
  <p>Based on the many searches I have done I am rather certain that I want to use ALSA's snd-dummy module for emulating a sound card, which is essentially /dev/null.</p>
  
  <p>Looking over the guide for ALSA Matrix:Module-dummy, it states that if "modinfo soundcore" returns that you have this module, then you don't need to recompile your kernel.</p>
  
  <p>In my instance, I do NOT have "soundcore" or "sound" available. I gather that this means I have to recompile the kernel. Recompiling the kernel of a docker image is a new concept to me. Docker is a new concept to me.</p>
  
  <h3>In sort, I need to install ALSA's snd-dummy module onto a Linux docker image, which does NOT have soundcore/sound compiled into the kernel.</h3>
  
  <p>Docker Image:
  <a href="https://github.com/fcwu/docker-ubuntu-vnc-desktop" rel="nofollow noreferrer">https://github.com/fcwu/docker-ubuntu-vnc-desktop</a></p>
  
  <p>ALSA Matrix snd-dummy:
  <a href="https://www.alsa-project.org/main/index.php/Matrix:Module-dummy" rel="nofollow noreferrer">https://www.alsa-project.org/main/index.php/Matrix:Module-dummy</a></p>
  
  <p>Is this a potential solution for me?:
  <a href="https://github.com/torvalds/linux/blob/master/sound/drivers/dummy.c" rel="nofollow noreferrer">https://github.com/torvalds/linux/blob/master/sound/drivers/dummy.c</a></p>
  
  <h3>Edit:</h3>
  
  <p>When replacing ~/.asoundrc to the following and running "alsactl restore" I get the following output. Also, my host machine's volume is affected.</p>
  
  <pre><code># .asoundrc
  
  pcm.dummy {
     type hw
     card 0
  }
  
  ctl.dummy {
     type hw
     card 0
  }
  </code></pre>
  
  <h3> </h3>
  
  <blockquote>
    <h3>$ alsactl restore</h3>
    
    <p>alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for
    reading: No such file or directory Found hardware: "HDA-Intel"
    "Realtek ALC269VB" "HDA:10ec0269,10280446,00100100
    HDA:80862805,80860101,00100000" "0x1028" "0x0446" Hardware is</p>
    
    <h3>initialized using a generic method Found hardware: "Dummy" "Dummy</h3>
    
    <p>Mixer" "" "" "" Hardware is initialized using a generic method</p>
  </blockquote>