Skip to contentSkip to conversation

How do I redirect sound from 1st soundacrd to 2nd soundcard?

DISCUSSION Bauke Jan Douma 2 participants 2 messages Mar 3, 2004 – Mar 5, 2004

lore
Share & tools
lore
#0 lore raw

[Sorry about those earlier mails; something went wrong with permissions on my mail-editor; the editor failed, but mail was still sent out to some bogus (and some not so bogus) addresses]

Hi,

I have two soundcards in my system, a cmipci(card) and an intel8x0 (on board).
cmicpi is /dev/dsp0, intel8x0 is /dev/dsp1.

In .asoundrc I have:
pcm.cmipci { type hw ; card 0 ; device 0 }
ctl.cmipci { type hw ; card 0 ; device 0 }
pcm.intel8x0 { type hw ; card 1 ; device 0 }
ctl.intel8x0 { type hw ; card 1 ; device 0 }

I have the audio cable of my CD/ROM drive wired onto the cmipci. Attached to line-out of the cmipci is just my headphones.

I also have a TV-card.
An audio cable runs from the TV-card to the intel8x0. Attached to line-out of the intel8x0 is a speaker set.

So when I play an audio CD (with cdctrl or xmcd or xmms) I usually listen to the audio on the headphones. This is intentional, because it suits me best. TV audio goes to the speaker set.

However, occasionally I want to have the audio from a CD redirected to the speaker set.
Right now, to accomplish this I do something like:

$> cdrdao read-cd --driver generic-mmc --device /dev/sg0 --datafile /dev/stdout dummy-toc | \
dd conv=swab | \
aplay -D intel8x0 -f cd /dev/stdin

or:

$> cdda2wav -S 1 -t 1+12 -D /dev/sg0 -O wav - | \
aplay -D intel8x0 -f cd /dev/stdin

These work without a problem, for the better part. But I was wondering if this cannot be done a bit more elegantly with some configuration in ~/.asoundrc, such that I can call aplay directly with that device as parameter to -D.

I fiddled with that a bit and using the mixer, but could not get it to work that way.

Can this be done at all, and if so is there anyone who has an ~/.asoundrc fragment that will make it work?

Thanks for any tips.

BJ

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

#1 lore raw
Quoted 20 lines · Bauke Jan Douma

I have two soundcards in my system, a cmipci(card) and an intel8x0 (on board).

I have the audio cable of my CD/ROM drive wired onto the cmipci. Attached to line-out of the cmipci is just my headphones.

I also have a TV-card.
An audio cable runs from the TV-card to the intel8x0. Attached to line-out of the intel8x0 is a speaker set.

So when I play an audio CD (with cdctrl or xmcd or xmms) I usually listen to the audio on the headphones. This is intentional, because it suits me best. TV audio goes to the speaker set.

However, occasionally I want to have the audio from a CD redirected to the speaker set.
Right now, to accomplish this I do something like:

Quoted 8 lines

$> cdda2wav -S 1 -t 1+12 -D /dev/sg0 -O wav - | \
aplay -D intel8x0 -f cd /dev/stdin

These work without a problem, for the better part. But I was wondering if this cannot be done a bit more elegantly with some configuration in ~/.asoundrc, such that I can call aplay directly with that device as parameter to -D.

aplay always reads its input from a file. IMHO, your pipe already is the most elegant way to provide a file for aplay. You can put it into a script.

I would suggest to connect all input and output devices to one card, and to change the mixer settings appropriately. At least your onboard chip should be able to do this.

HTH
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click