You are not logged in.

#1 2011-03-14 12:46:15

Azriel
Member
Registered: 2008-01-23
Posts: 58

Split sound on devices depending of source.

Hi,

I've just bought a headset in order to play and chat online, and i'd like to be able to have the game sound on my speaker, and the voices in my headset. I'm using mumble to voice chat, which is supposed to be able to let me choose my audio output...

So I plugged my speaker on the green jack, and my headset one the black one, but i get all the sound on both my speaker and my headset... Which is not really convenient.

I don't know much about sound, but I guess that since I plug my devices it should be doable to send one output on one particular device... I just want to send mumble on my headset, and every other sound on my speakers.

Any idea anyone ?

Offline

#2 2011-03-14 13:03:02

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Split sound on devices depending of source.

Pulseaudio MAY be able to help you. It would for sure if those were two different devices, but the way you describe it sounds like both speaker and headset are the same soundcard. In that case, no there would probably not be possible. Check how many alsa devices you have.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2011-03-15 01:29:17

Azriel
Member
Registered: 2008-01-23
Posts: 58

Re: Split sound on devices depending of source.

Well i'll give pulseaudio a shot, but i confirm what you said, there is only one soundcard (actually integrated to the motherboard).

As for the alsa devices, there actually are a lot of them with seemengly many redudancies, but that's always been the case, so it makes it a little tough to sort through them, but i'll try next time.

What is weird is that i seem to remember being able to do what i wanted a few years ago on another comp, by just plugging headset and speakers on different jack...

Offline

#4 2011-03-15 01:56:18

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Split sound on devices depending of source.

Azriel wrote:

Well i'll give pulseaudio a shot, but i confirm what you said, there is only one soundcard (actually integrated to the motherboard).

As for the alsa devices, there actually are a lot of them with seemengly many redudancies, but that's always been the case, so it makes it a little tough to sort through them, but i'll try next time.

What is weird is that i seem to remember being able to do what i wanted a few years ago on another comp, by just plugging headset and speakers on different jack...

Perhaps the different jacks were (for example) front and rear speakers? If that's the case, and your system actually can do 5.1 or something, then yes it would make it possible. Pulseaudio doesn't really handle such a case (I'm sure it could do some remapping, but might be a bit arcane). JACK would be able to do it as well, since its made for such rewiring, but not every application supports JACK. Finally, you could probably configure it in .asoundrc, but documentation for that is scattered everywhere.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#5 2011-03-18 17:49:00

Azriel
Member
Registered: 2008-01-23
Posts: 58

Re: Split sound on devices depending of source.

Ok i've been able to take a good look at the ALSA devices, and noticed there was a "headphone" entry.

The thing is, I can mute the headphone, and still have sound on my speakers, but not the opposite.

Since the devices are still sorted somewhat separatly in alsamixer, shouldn't there be a way to send each sond to its rightful place ?

I'm still looking up that pulseaudio option, but it seems fairly hard to replace ALSA by pulseaudio and i'm a bit scared to break something...

[EDIT] I actually found two may to plug my mic, one on the front, which seems to be correspond to the "headphone" input, and one on the back, which is apparently the surround one in alsamixer. In the second case I can change independantly of the other the sound of my speakers or of my headset.

I really don't get why this is such a hassle, I can't be the only one wanting to have my game's sound and listen to my gamemates at the same time, but i've been googling that for days and still haven't found a way which doesn't imply installing a second sound card...

Shouldn't there be a way to restrict the channel a program has access to ?

Last edited by Azriel (2011-03-18 17:58:51)

Offline

#6 2011-03-22 13:24:19

jlindgren
Member
Registered: 2011-02-27
Posts: 260

Re: Split sound on devices depending of source.

You can create two virtual PCM devices which map to different channels of the real device in .asoundrc.  The syntax is unfortunately a bit hard to learn.

Offline

#7 2011-03-22 14:40:19

Azriel
Member
Registered: 2008-01-23
Posts: 58

Re: Split sound on devices depending of source.

jlindgren wrote:

You can create two virtual PCM devices which map to different channels of the real device in .asoundrc.  The syntax is unfortunately a bit hard to learn.

I'm looking at it right now, and it is indeed quite hard. I've been unable to find a .asoundrc containing the equivalent of what I'm asking that I could just adapt...

I've tried identifying my sound devices using aplay, but I don't seem to understand that either, here is my aplay -L output:

user@Arch:~$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Intel
    HDA Intel, ALC888 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC888 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, ALC888 Digital
    IEC958 (S/PDIF) Digital Audio Output

But if I try to play a file using aplay -D and any of those device name, I get "aplay: main:660: audio open error: Device or resource busy". It only works with iec958 (but doesn't produce any sound, since I don't have any sound output plugged on my digital output), or default, which doesn't really help me. I also don't seem to be able to play any sound using the -D flag if I try to select device with hw:x,y except with hw:0,1, which doesn't produce any sound.

aplay -l doesn't help a lot either:

user@Arch:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC888 Digital [ALC888 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I really don't get what I'm supposed to do, I thought this was a matter of identifying devices name using aplay, then creating virtual slave sound devices using the .asoundrc file, but I don't seem to get how to do any of those things.

I've still been able to piece together a little draft of .asoundrc using the documentation i found here, here is what I have now:

pcm_slave.sl2 {
    pcm surround41
    rate 44100
}

pcm.rate_convert {
    type rate
    slave sl2
}

This way if I understand things correctly I have created a virtual device which (should, but doesn't) use only the surround output (the one my headphone's plugged in), but I just get the same error I get when I use aplay -D surround41 test.wav.


I'm really starting to lose my mind on this, it seemed like an easy thing to do, and I swear I'm really trying my best to do it myself and read all the documentation available.

Last edited by Azriel (2011-03-22 14:43:19)

Offline

Board footer

Powered by FluxBB