[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: alsa and default sound input/output



> 
> Thank for the reply.
> 
> I found out that /etc/asound.conf is *the place* to look.
> 
> Apparently it is possible to talk to soundcards by some id:
> 
> # more /proc/asound/cards
>  0 [I82801DBICH4   ]: ICH4 - Intel 82801DB-ICH4
>                       Intel 82801DB-ICH4 with STAC9750,51 at irq 7
> 
> 
> Gives e.g. an entry in /etc/asound.conf :
> 
> pcm.!default {
>     type hw
>     card "I82801DBICH4"
> }

This is possible, yes.

> 
> For the moment, I configured dmix into asound.conf, and it appears that
> dsnoop is the equivalent for sound routing the other direction.
> 

Yes, I have put in my .asoundrc long time ago following entries to have a
duplex device using the alsa docs and different forumes. This I did because
time ago the flash player was playing only at 44100Hz and alsa was
configured at 48000. So I played with it pretty long to understand what was
the issue and did this configuration. I'm not that sure if everything is
fine there, but it seems to work for me.

<code>
# Allow mixing of multiple output streams to this device
pcm.dmixer {
     type dmix
     ipc_key 1024
#     ipc_perm 0660
#     ipc_key_add_uid true
#     slave.pcm "hw:0,0"
    slave {
        pcm "hw:0,0"      # you cannot use a "plug" device here, darn.
        period_time 0
        period_size 1024 # must be power of 2
        buffer_size 8192  # dito. It
       #format "S32_LE"
       #periods 128 # dito.
       rate 44100 # with rate 8000 you *will* hear, 44100
       # if ossmix is used :)
    }
    # bindings are cool. This says, that only the first
    # two channels are to be used by dmix, which is
    # enough for (most) oss apps and also lets
    # multichannel chios work much faster:
    bindings {
        0 0 # from 0 => to 0
        1 1 # from 1 => to 1
    }
}


# Allow reading from the default device.
# Also known as record or capture.
pcm.dsnooper {
     type dsnoop
     ipc_key 2048
#     ipc_perm 0660
#     ipc_key_add_uid true
     slave.pcm "hw:0"
     bindings {
          0 0
          1 1
     }
}


It's fun to play with alsa if you have time bad weather outside and boring
tv or a woman around doing her own kind of things ;-)


# This is what we want as our default device
# a fully duplex (read/write) audio device.
pcm.duplex {
     type asym
     playback.pcm "dmixer"
     capture.pcm "dsnooper"
}


pcm.!default {
     type asym
# you could replace this with a route to duplex
     playback.pcm "dmixer"
     capture.pcm "dsnooper"
}

</code>


Reply to: