I have M-Audio M-Track Eight, a USB based soundcard that I use to play and record audio files using a python based tool I wrote. My device definitions in .asoundrc looks like this:
pcm.!default {
type plug slave { pcm "hw:1,0" } } ctl.!default { type hw card 1 } pcm_slave.m-audio_m-track_eight_1 { pcm "hw:1,0" channels 8 rate 44100 buffer_size 4096 period_size 1024 } pcm.outch1 { type dshare ipc_key 1111 slave m-audio_m-track_eight_1 bindings [ 0 ] hint.description "M-Audio M-Track Eight output/playback channel 1 (from output port 1)" } pcm.inch1 { type dsnoop ipc_key 2111 slave m-audio_m-track_eight_1 bindings [ 0 ] hint.description "M-Audio M-Track Eight input/capture channel 1 (from input port 1)" } pcm.outch2 { type dshare ipc_key 1112 slave m-audio_m-track_eight_1 bindings [ 1 ] hint.description "M-Audio M-Track Eight output/playback channel 2 (from output port 2)" } pcm.inch2 { type dsnoop ipc_key 2112 slave m-audio_m-track_eight_1 bindings [ 1 ] hint.description "M-Audio M-Track Eight input/capture channel 2 (from input port 2)" } pcm.outch3 { type dshare ipc_key 1113 slave m-audio_m-track_eight_1 bindings [ 2 ] hint.description "M-Audio M-Track Eight output/playback channel 3 (from output port 3)" } pcm.inch3 { type dsnoop ipc_key 2113 slave m-audio_m-track_eight_1 bindings [ 2 ] hint.description "M-Audio M-Track Eight input/capture channel 3 (from input port 3)" } pcm.outch4 { type dshare ipc_key 1114 slave m-audio_m-track_eight_1 bindings [ 3 ] hint.description "M-Audio M-Track Eight output/playback channel 4 (from output port 4)" } pcm.inch4 { type dsnoop ipc_key 2114 slave m-audio_m-track_eight_1 bindings [ 3 ] hint.description "M-Audio M-Track Eight input/capture channel 4 (from input port 4)" } pcm.outch5 { type dshare ipc_key 1115 slave m-audio_m-track_eight_1 bindings [ 4 ] hint.description "M-Audio M-Track Eight output/playback channel 5 (from output port 5)" } pcm.inch5 { type dsnoop ipc_key 2115 slave m-audio_m-track_eight_1 bindings [ 4 ] hint.description "M-Audio M-Track Eight input/capture channel 5 (from input port 5)" } pcm.outch6 { type dshare ipc_key 1116 slave m-audio_m-track_eight_1 bindings [ 5 ] hint.description "M-Audio M-Track Eight output/playback channel 6 (from output port 6)" } pcm.inch6 { type dsnoop ipc_key 2116 slave m-audio_m-track_eight_1 bindings [ 5 ] hint.description "M-Audio M-Track Eight input/capture channel 6 (from input port 6)" } pcm.outch7 { type dshare ipc_key 1117 slave m-audio_m-track_eight_1 bindings [ 6 ] hint.description "M-Audio M-Track Eight output/playback channel 7 (from output port 7)" } pcm.inch7 { type dsnoop ipc_key 2117 slave m-audio_m-track_eight_1 bindings [ 6 ] hint.description "M-Audio M-Track Eight input/capture channel 7 (from input port 7)" } pcm.outch8 { type dshare ipc_key 1118 slave m-audio_m-track_eight_1 bindings [ 7 ] hint.description "M-Audio M-Track Eight output/playback channel 8 (from output port 8)" } pcm.inch8 { type dsnoop ipc_key 2118 slave m-audio_m-track_eight_1 bindings [ 7 ] hint.description "M-Audio M-Track Eight input/capture channel 8 (from input port 8)" }
But, with the above, I figured out that it is not possible to play and record on multiple channels simultaneously. I do this by executing the following command in separate threads in a python script:
where `in_id` is the input channel variable that I pass to each of the threads.
" arecord: main:722: audio open error: Device or resource busy"
|
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user