4

I am looking for a way to create a virtual sound device in Linux, which would use channel outputs of my sound card.

I have no experience in Linux and therefore am asking more experienced users for help. I have latest Ubuntu Desktop 10.10 installed on my VirtualBox machine. What I want to do is to be able to create multiple virtual audio devices and then configure them to use different output channels of my M-Audio ProFire 610 sound card. The reason I want to do it is that I will use these devices in Java afterwards, and Java doesn't support directly selecting channels in the sound card, therefore I need to do it outside of Java.

In OS X I can do this by messing arround with Audio MIDI Setup utility, maybe there is something ready made for Linux, too? This is how it looks on OS X:

enter image description here

enter image description here

I am looking for any help, hints, tips - well anything that will help me achieve this.

Gareth
  • 19,080
rkrv.
  • 163
  • 1
  • 2
  • 7

1 Answers1

2

You will have to edit ALSA configuration files in order to achieve this, which unfortunately involves a significant amount of black magic.

Here's an example taken from the ALSA wiki showing how to split a card's front and rear stereo outputs into two independent audio devices:

pcm.dshare {
    type dmix
    ipc_key 2048
    slave {
        pcm "hw:0"
        rate 44100
        period_time 0
        period_size 1024
        buffer_size 8192
        channels 4
    }
    bindings {
        0 0
        1 1
        2 2
        3 3
    }
}
pcm.frontx {
    type plug
    slave {
        pcm "dshare"
        channels 4
    }
    ttable.0.0 1
    ttable.1.1 1
}
pcm.rearx {
    type plug
    slave {
        pcm "dshare"
        channels 4
    }
    ttable.0.2 1
    ttable.1.3 1
}
Malvineous
  • 2,798