pcm.!default {
    type plug
    slave {
        pcm "vis"
        format S16_LE
        rate 48000
    }
}

pcm.vis {
    type file
    slave.pcm "tocopy"
    file "|safe_fifo /tmp/vis_audio.fifo /tmp/mis_audio.fifo"
}

pcm.tocopy {
    type copy
    slave {
        pcm "Playback"
    }
}

pcm.Playback {
    type plug
    slave.pcm {
        type softvol
        slave.pcm "dmixer"
        control {
            name "mysoftvol"
            card 0
        }
        min_dB -51.0
        max_dB 0.0
    }
}

pcm.usb_up {
    type plug
    slave {
        pcm "hw:UAC2Gadget"
        rate 48000
        format S16_LE
        channels 2
    }
}

pcm.CaptureUsbDown {
    type plug
    slave.pcm {
        type dsnoop
        ipc_key 3333
        ipc_perm 0666
        slave {
            pcm "hw:UAC2Gadget"
            rate 48000
            format S16_LE
            channels 2
            period_size 480
            periods 8
        }
    }
}

pcm.notify {
    type plug
    slave {
        pcm {
            type softvol
            slave.pcm dmixer
            control {
                name "notifyvol"
                card 0
            }
            min_dB -51.0
            max_dB 0.0
        }
        channels 2
        format S16_LE
        rate 48000
    }
}

pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,2"
        format S16_LE
        period_size 480
        buffer_size 4800
        rate 48000
    }
    bindings {
        0 0
        1 1
    }
}

ctl.dmixer {
    type hw
    card 0
    device 1
}

pcm.dsp {
    type plug
    slave.pcm "dmixer"     # use our new PCM here
}

ctl.mixer {
    type hw
    card 0
}

pcm.dis {
    type plug
    slave.pcm noop
}

pcm.mico_record {
    type plug
    slave.pcm Capture
}

pcm.noop {
    type plug
    slave.pcm Capture
}

pcm.Capture {
    type plug
    slave.pcm {
        type dsnoop
        ipc_key 1024
        ipc_perm 0666
        slave {
            pcm "hw:0,3"
            rate 48000
            format S32_LE
            channels 4
            period_size 384
            buffer_size 6144
        }
    }
}

defaults.pcm.rate_converter "speexrate_medium"