Talk:.asoundrc

From the ALSA wiki

Jump to: navigation, search

[edit] Copy input and output streams into a file

This works, but it's extremely rude. I would like to have a result file with both streams mixed together, which would not overwrite itself every time, but the docs are extremely terse on this topic. I wasn't able to figure out how exactly copy is supposed to work, or how to split and join streams... I hope some brave soul takes this up and modifies it to be pretty and useful.

The conversion into wavs for me is:

sox -V -r48000 -c2 -w -s $1 $1.wav

but your stream may be at different rate etc. Would be nice to run it through a rate thingie but I didn't have the time to try to figure it out as well.

pcm.duplex {
       type asym
       playback.pcm "dmix"
       capture.pcm "dsnoop"
  }


pcm.rec_out {
       type file
       file    "/home/grin/tmp/rec_out.raw"
       slave {
               pcm duplex
       }
}

pcm.rec_mic {
       type file
       file    "/home/grin/tmp/rec_mic.raw"
       slave {
               pcm duplex
       }
}

--Grin 10:30, 22 June 2007 (EST)

[edit] Converting stereo to mono sound

There must be several ways to get this accomplished, but I wrote up a sample ~/.asoundrc file that can downmix to mono by default. Not sure if this is the best way to do it. Is it worth merging into the article?

Of course, it is often possible to tweak the applications or sound servers rather than the alsa layer itself. In "Alsa Force Mono (Ubuntu Forum)", the issue comes up and is resolved in this way. In my case, the application is a bit hard to manipulate, etc., ...


  pcm.card0 {
      type hw
      card 0
  }
  pcm.mono {
      type route
      slave.pcm card0
      slave.channels 2
      ttable.0.0 0.5
      ttable.0.1 0.5
      ttable.1.0 0.5
      ttable.1.1 0.5 
  }
  pcm.!default {
      type route
      slave.pcm card0
      slave.channels 2
      ttable.0.0 0.5
      ttable.0.1 0.5
      ttable.1.0 0.5
      ttable.1.1 0.5 
  }

-- Eolvwa 12:55, 13 April 2008 (EST)

Personal tools