Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a 7.1 surround sound card installed and I want to split the outputs to 4 stereo outputs. That is not a problem with ALSA (or even PulseAudio), but I cannot get the Java Sound System to show me the stereo outputs separately.

What is the trick here? Is it possible to simulate hardware devices with ALSA so Java sees them?

This is what Java sees:

Found Mixer: PulseAudio Mixer, version 0.02
    Found source line: interface SourceDataLine supporting 42 audio formats, and buffers of 0 to 1000000 bytes
        Line unavailable.
    Found source line: interface Clip supporting 42 audio formats, and buffers of 0 to 1000000 bytes
        Line unavailable.
    Found target line: interface TargetDataLine supporting 42 audio formats, and buffers of 0 to 1000000 bytes
        Line unavailable.
Found Mixer: DX [default], version 1.0.21
    Found target line: interface TargetDataLine supporting 84 audio formats, and buffers of at least 32 bytes
Found Mixer: DX [plughw:0,0], version 1.0.21
    Found source line: interface SourceDataLine supporting 96 audio formats, and buffers of at least 32 bytes
    Found source line: interface Clip supporting 96 audio formats, and buffers of at least 32 bytes
    Found target line: interface TargetDataLine supporting 24 audio formats, and buffers of at least 32 bytes
Found Mixer: DX [plughw:0,1], version 1.0.21
    Found source line: interface SourceDataLine supporting 24 audio formats, and buffers of at least 32 bytes
    Found source line: interface Clip supporting 24 audio formats, and buffers of at least 32 bytes
Found Mixer: Port DX [hw:0], version 1.0.21
    Found source line: Mic source port
    Found source line: Aux source port
    Found source line: Analog Input Monitor source port
    Found target line: Master target port
    Found target line: Analog Input Monitor target port

This is my .asoundrc:

pcm_slave.eightchannels {
    pcm "surround71:DX,0"
    channels 8
}
pcm.stereo1 {
    type plughw
    slave.pcm {
        type dshare
        ipc_key 87882222
        slave eightchannels
        bindings [ 2 3 ]
    }
}
pcm.stereo2 {
    type plughw
    slave.pcm {
        type dshare
        ipc_key 87882222
        slave eightchannels
        bindings [ 4 5 ]
    }
}
pcm.stereo3 {
    type plughw
    slave.pcm {
        type dshare
        ipc_key 87882222
        slave eightchannels
        bindings [ 6 7 ]
    }
}
pcm.stereo4 {
    type plughw
    slave.pcm {
        type dshare
        ipc_key 87882222
        slave eightchannels
        bindings [ 0 1 ]
    }
}

The ALSA config works fine, as i can play sound on the stereo1...4 outputs with speaker-test -D stereo1.

Thank you!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The answer is: no. Java is not able to list the user-defined ALSA pcms, as it exposes only the hardware devices and the "default" device.

Got the info from an ALSA dev here: http://www.spinics.net/linux/fedora/alsa-user/msg10796.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.