#pcm.test {
#	type copy
#	slave hw:3,0,0
#}

pcm.!default {
  type plug
  #slave.pcm "hw:1,0";
# playback/capture pcm?
  #slave.pcm "dmixBoth"; # For OBS. Also modprobe the loopback device.
  #slave.pcm "both" # For OBS. Also modprobe the loopback device.
  #slave.pcm "dmixPCH";
  #slave.pcm "dsnoopPCH";
  route_policy default;
  slave.pcm "unified";
}

pcm.unified {
  type asym;
  capture.pcm "dsnoopAudio";
  #playback.pcm "plug:dmix:Audio";
  #playback.pcm "plug:dmix:PCH";
  #playback.pcm "plug:dmix:Loopback";
  playback.pcm "both";
}

#pcm.!default plug:both
#defaults.pcm.dmix.rate 48000;
#defaults.pcm.dmix.period_size 2048;

pcm.dmixBoth {
      type dmix
      ipc_key 100
      slave {
        pcm "both";
	rate 48000;
	period_size 2048;
      }

}

pcm.dmixAudio {
      type dmix
      ipc_key 130
      slave {
        pcm "hw:CARD=Audio,DEV=0";
	rate 48000;
	period_size 2048;
      }
}

pcm.dmixPCH {
      type dmix
      ipc_key 120
      slave {
        pcm "hw:CARD=PCH,DEV=0";
	rate 48000;
	period_size 2048;
      }
}


pcm.dmixLoopback {
      type dmix
      ipc_key 110
      slave {
        pcm "hw:CARD=Loopback,DEV=1";
	rate 48000;
	period_size 2048;
      }
}
pcm.dsnoopLoopback {
	type dsnoop;
	ipc_key 230;
	slave {
		pcm "hw:CARD=Loopback,DEV=1";
		rate 48000;
		period_size 2048;
	}
}

pcm.dsnoopAudio {
	type dsnoop;
	ipc_key 250;
	slave {
		pcm "hw:CARD=Audio,DEV=0";
		rate 48000;
		period_size 2048;
	}
}

pcm.dsnoopPCH {
	type dsnoop;
	ipc_key 240;
	slave {
		pcm "hw:CARD=PCH,DEV=0";
		rate 48000;
		period_size 2048;
	}
}

# this shows up as a 4-channel device, which breaks some applications?

pcm.both {
  type route;
  slave.pcm {
    type multi;
    slaves {
      #a.pcm "dmixLoopback";
      #b.pcm "dmixPCH";
      #b.pcm "null";
      #b.pcm "dmixAudio";
      a.pcm "plug:dmix:Loopback";
      #b.pcm "plug:dmix:Audio";
      b.pcm "plug:dmix:PCH";
      #c.pcm "null";
      a.channels 2;
      b.channels 2;
#      c.channels 2;
    }
    bindings {
      0 { slave a; channel 0 }
      1 { slave a; channel 1 }
      2 { slave b; channel 0 }
      3 { slave b; channel 1 }
#      4 { slave c; channel 0 }
#      5 { slave c; channel 1 }
    }
  }
  ttable {
#    0 { 0 1; 2 1; 4 1; }
#    1 { 1 1; 3 1; 5 1; }
    0 { 0 1; 2 1; }
    1 { 1 1; 3 1; }
  }
}


pcm.btcar {
	profile a2dp
	type bluetooth
	device 00:00:00:66:6F:73
}

pcm.bthome {
	profile a2dp
	type bluetooth
	device C8:84:47:03:B4:54
}
