You are not logged in.
Hi all ![]()
After a long and unsuccessful search on the net I decide to post my question here.
I have a motherboard with the HDA chipset (4 output in the back) and I want to choose for each application the output.
For example : my music on the Master output (plugged to amp), my video on the Suround output (plugged to a helmet), all the other apps on the Side output (plugged to speakers) ...
I am actually whith ALSA and Pulseaudio, but I am ready to change all to do that (except the ditrib
)
Thanks in advance ![]()
(sorry if my english is poor, I am french)
Last edited by sauliwx (2014-09-12 13:43:09)
Offline
I have only played with it, but you might look into Jack
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Online
@OP You should be able to achieve this using either one pulseaudio or alsa. But jack can be used for a more graphical and convenient way using qjackctl/patchage to set up your desired configuration.
Offline
After a long time on ALSA wiki about .asoundrc, I did that :
# 0 - Front Left - Green L
# 1 - Front Right - Green R
# 2 - Rear Left - Black L
# 3 - Rear Right - Black R
# 4 - Front Center - Orange L
# 5 - LFE - Orange R
# 6 - Side Left - Grey L
# 7 - Side Right - Grey R
pcm.!default {
type dmix
ipc_key 1024
slave {
pcm "hw:0"
channels 8
}
}
pcm.green {
type route
slave.pcm default
ttable.0.0 1
ttable.1.1 1
ttable.2.0 1
ttable.3.1 1
ttable.4.0 1
ttable.5.1 1
ttable.6.1 1
ttable.7.1 1
}
pcm.black {
type route
slave.pcm default
ttable.0.2 1
ttable.1.3 1
ttable.2.2 1
ttable.3.3 1
ttable.4.2 1
ttable.5.3 1
ttable.6.2 1
ttable.7.3 1
}
pcm.orange {
type route
slave.pcm default
ttable.0.4 1
ttable.1.5 1
ttable.2.4 1
ttable.3.5 1
ttable.4.4 1
ttable.5.5 1
ttable.6.4 1
ttable.7.5 1
}
pcm.grey {
type route
slave.pcm default
ttable.0.6 1
ttable.1.7 1
ttable.2.6 1
ttable.3.7 1
ttable.4.6 1
ttable.5.7 1
ttable.6.6 1
ttable.7.7 1
}This code allow you to have as much ALSA (stereo) devices as jack on your PC ![]()
After, in many applications config we can choose the output device of our choice.
Last edited by sauliwx (2014-09-12 13:42:30)
Offline
If it works well, you can leave the type route, should there be problems change type route to type plug, it also accepts ttable. The default alsa configuration for pcm.default does not work? What if you comment out the pcm.default definition? I would be interested in the result.
You use dmix, but with default settings, so sample rate might not be optimal and the format also.
Note that the dmix plugin itself supports only a single configuration. That is, it supports only the fixed rate (default 48000), format (S16), channels (2), and period_time (125000). For using other configuration, you have to set the value explicitly in the slave PCM definition.
But some values should be referenced from defaults node, like defaults.pcm.dmix.rate.
Offline
The default ALSA configuration for pcm.default works, but with it I can not use multiple devices at the same time. That's why I use "type dmix".
But I understood it wasn't a good idea to modify pcm.default so I made a special pcm.dmix44 device to replace my previous pcm.default.
About the type Plug, I'll see it later ![]()
Offline
Then try this for the default dmix, since you use 8 channels it should work without modification. You can add it to your ~/.asoundrc by adding this line:
<~/.asoundrc-dmix>
<$HOME/.asoundrc-dmix>
<.asoundrc-dmix> # Tell me which one worksThe new dmix configuration obviously needs to be stored in ~/.asoundrc-dmix. Of course you can overwrite pcm.default, it would be wise to add dsnoop to the new definition however. Read /usr/share/alsa/pcm/default.conf. You also loose runtime arguments, although apparently most do not use them.
Edit: Wrong link.
Last edited by emeres (2014-09-17 15:11:46)
Offline
Are you sure about your link ? There is no relation with ALSA.
Now, my .asoundrc is like :
<.asoundrc-dmix> #This one worksMy .asoundrc-dmix is :
pcm.dmix1 {
type dmix
ipc_key 1024
slave {
pcm "hw:0"
channels 8
}
}
pcm.dsnoop1 {
type dsnoop
ipc_key 2048
slave {
pcm "hw:0"
channels 8
}
}
pcm.green {
type plug
slave.pcm "dmix1"
ttable.0.0 1
ttable.1.1 1
ttable.2.0 1
ttable.3.1 1
ttable.4.0 1
ttable.5.1 1
ttable.6.1 1
ttable.7.1 1
}
pcm.black {
type plug
slave.pcm "dmix1"
ttable.0.2 1
ttable.1.3 1
ttable.2.2 1
ttable.3.3 1
ttable.4.2 1
ttable.5.3 1
ttable.6.2 1
ttable.7.3 1
}
pcm.orange {
type plug
slave.pcm "dmix1"
ttable.0.4 1
ttable.1.5 1
ttable.2.4 1
ttable.3.5 1
ttable.4.4 1
ttable.5.5 1
ttable.6.4 1
ttable.7.5 1
}
pcm.grey {
type plug
slave.pcm "dmix1"
ttable.0.6 1
ttable.1.7 1
ttable.2.6 1
ttable.3.7 1
ttable.4.6 1
ttable.5.7 1
ttable.6.6 1
ttable.7.7 1
}Is that good ?
But, I want my pcm.default point on my pcm.green. Should I do that :
pcm.!default {
type plug
slave.pcm "green"Or there is a more elegant way ?
And I don't understand what you said about runtime arguments.
Offline
My bad, clipboard must have been turned off or I simply confused the links. Here the correct one, once again. Runtime arguments allow you to specify a pcm with parameters set upon execution:
speaker-test -c 2 -t wav -D plug:"dmix:{CARD DG DEV 0}"
# CARD D is one argument and DEV 0 the other. The original dmix takes more arguments
# see /usr/share/alsa/pcm/dmix.conf
# The one I proposed takes also channels number as runtime argument like so
speaker-test -c 8 -t wav -D plug:"dmix:{CARD SB DEV 0 SUBDEV -1 FORMAT S32_LE RATE 192000 CHANNELS 8}"The more important thing is dsnoop, otherwise you might have problems when recording. This kind of configuration may end up similar to this proposed one. Similar when it comes to logical structure that is. You might want to try build your configuration into the latter one. Instead of this:
default {
# use pulse as default
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
}try this based on your part:
default {
type asym;
playback.pcm "green";
capture.pcm "dsnoop1";
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently green)"
}You had no asym type plugin in there.
Edit: "fallback" might not only be unnecessary, it might conflict or cause an error within the configuration. Untested.
Last edited by emeres (2014-09-17 16:13:40)
Offline
Ok !
Thank a lot, you enlighten me on the ALSA audio's darknesses ![]()
Offline