Page 1 of 1

How to setup multiple sound card I/O for ALSA apps?

Posted: Sat Apr 17, 2010 8:56 am
by tl1
I use the following /etc/asound.conf to have ALSA apps output sound to my second sound card:

Code: Select all

pcm.!default {
  type oss
  device /dev/dsp6
}

ctl.!default {
  type oss
  device /dev/mixer2
}


But, is it possible to add one more sound output and 2 sound inputs? Quick googling somehow didn't help.

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Mon Apr 19, 2010 10:13 am
by cesium
Maybe defining more than one "card" in .asoundrc would help? I know that's possible, but not sure about syntax. Possibly replacing "!default" with NAME or something. You may still have to select the new "card" manually in the app...

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Mon Apr 19, 2010 2:56 pm
by tl1
Yes it works (mostly)!
BTW, here's a page about the file on ALSA Wiki, it doesn't mention OSS output but there's another useful info, like creating multi channel devices and etc.: http://alsa.opensrc.org/index.php/.asoundrc
Here's what I have now:

Code: Select all

pcm.!default {
  type oss
  device /dev/dsp4
}

pcm.HD_Front {
  type oss
  device /dev/dsp4
}

pcm.HD_CenterLFE {
  type oss
  device /dev/dsp5
}

pcm.HD_Rear {
  type oss
  device /dev/dsp6
}

pcm.HD_Side {
  type oss
  device /dev/dsp7
}





pcm.HD_Rec1Src {
  type oss
  device /dev/dsp10
}

pcm.HD_Rec2Src {
  type oss
  device /dev/dsp11
}

pcm.HD_Rec3Src {
  type oss
  device /dev/dsp12
}




pcm.Audiophile {
  type oss
  device /dev/dsp0
}

pcm.Audiophile_In {
  type oss
  device /dev/dsp2
}



ctl.!default {
  type oss
  device /dev/mixer1
}

ctl.Audiophile {
  type oss
  device /dev/mixer0
}


It correctly lists the "cards" and automatically separates input from output.
For some reason, audio recording is not working but output is fine.
Finally, I got sound from Audacity (it didn't want to select ALSA because there was no input and could not output to OSS).

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Mon Apr 19, 2010 3:16 pm
by tl1
This also does NOT work:

Code: Select all

arecord -r 48000 -c 2 -f S16_LE --device=pcm.HD_Rec1Src test.wav

Like Audacity, it "starts" recording but does not receive any sound data.

Any ideas, how to record sound from ALSA app? ;-)

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Mon Apr 19, 2010 7:12 pm
by igorzwx
tl1 wrote:This also does NOT work:

Code: Select all

arecord -r 48000 -c 2 -f S16_LE --device=pcm.HD_Rec1Src test.wav

Like Audacity, it "starts" recording but does not receive any sound data.

Any ideas, how to record sound from ALSA app? ;-)


Have you installed OSS4, or you have ALSA?

Do you have Ubuntu, Debian, Arch Linux, or else?

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Mon Apr 19, 2010 8:24 pm
by cesium
He's trying to use pcm-oss ALSA-plugin for compat... I don't think input works with it though. I should check why new portaudio (audacity uses portaudio) has issues with OSS4 - it used to work well.

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Mon Apr 19, 2010 9:38 pm
by igorzwx
cesium wrote:He's trying to use pcm-oss ALSA-plugin for compat... I don't think input works with it though. I should check why new portaudio (audacity uses portaudio) has issues with OSS4 - it used to work well.


There were problems with Audacity and OSS4. They were fixed on Ubuntu 9.10.
On Arch Linux, Audacity works well with OSS4 (playback and recording).

You can also record sound with Ardour through the help of JACK.

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Tue Apr 20, 2010 1:12 pm
by tl1
ASP Linux 14 (FC9-based), OSS 4.
I use bash scripts based on ossrecord.
mencoder also does the job perfectly.
But recording via Audacity would be handy, occasionally.
If you say it was fixed recently in Ubuntu, probably the next ASP will also have it - let's see.

P.S.
OSS 4.2 (b 2002/200911060811) (0x00040100) TRIAL
kernel-2.6.27.25
portaudio-19-6.0.140asp.i386
audacity-1.3.7-0.4.beta.0.140asp.2.i386
alsa-tools-firmware-1.0.17-1.0.140asp.i386
alsa-utils-1.0.20-3.0.140asp.i386
alsa-plugins-upmix-1.0.16-4.0.140asp.i386
alsa-plugins-jack-1.0.16-4.0.140asp.i386
alsa-tools-1.0.17-1.0.140asp.i386
alsa-lib-devel-1.0.20-1.0.140asp.i386
alsa-plugins-pulseaudio-1.0.16-4.0.140asp.i386
alsa-plugins-samplerate-1.0.16-4.0.140asp.i386
alsa-firmware-1.0.17-1.0.140asp.noarch
alsa-plugins-vdownmix-1.0.16-4.0.140asp.i386
alsa-plugins-oss-1.0.16-4.0.140asp.i386
alsa-lib-1.0.20-1.0.140asp.i386

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Tue Apr 20, 2010 1:31 pm
by igorzwx
tl1 wrote:But recording via Audacity would be handy, occasionally.
If you say it was fixed recently in Ubuntu, probably the next ASP will also have it - let's see.


How long are you going to wait? 5 years, or more?

On Arch Linux, you can now install Audacity 1.3.12-3 from official repositories.
Everything works perfectly.

Re: How to setup multiple sound card I/O for ALSA apps?

Posted: Tue Apr 20, 2010 2:24 pm
by tl1
I am not really waiting because I don't actually need Audacity to record. And everything else works just fine. Maybe I'm a bit uncomfortable about being stuck with Skype 2.0 OSS static but that's not related to distro.
PS If you seriously want to know ASP release schedule please ask ASP about that.