Controlling assigned device indexes (rather than assigned card indexes...)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Our Java application uses the Java Sound API to play audio clips.  On
Linux, the Java Sound API uses ALSA.  Unfortunately, however, it is
hard-coded to always use ALSA card 0, device 0 ("hw:0,0").  We need it
to use the system's HDMI output, which ALSA is assigning card 0,
device 3 ("hw:0,3").  Because the Java Sound API is hard-coded to use
"hw:0,0", an ALSA config. file such as the following which makes
"hw:0,3" the default output does NOT result in in the Java Sound API
sending its output to "hw:0,3":

pcm.!default {
    type hw
    card 0
    device 3
}

The Java Sound API ignores the default device and sends its output
straight to "hw:0,0".  It doesn't matter what is in the asound.conf.
If I can get ALSA to assign "hw:0,0" to the HDMI output rather than
"hw:0,3", sounds played via the Java Sound API *should* come through
the HDMI output.  I am aware that there is an "index" option for
ALSA's kernel modules that can be used to control the card index
assigned by ALSA when there are multiple cards in the system.
However, in my situation the card index being assigned by default is
what I want (0).  What I need to control is the device index.  I have
not yet found a way to do so.

Is there a way that I can force ALSA to assign "hw:0,0" to the device
it normally assigns "hw:0,3"?

If not, does anyone have any ideas for an alternative workaround for
this issue with the Java Sound API?  I have considered dropping our
use of the Java Sound API altogether and just doing a Runtime.exec()
to run aplay or some other command-line audio player instead.

Regards,
Matt Hurne

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux