USB speakers: a suggestion

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

 



Hi,

I'm not satisfied with the current way I use my USB speakers with ALSA.

If there's some easy way to accommodate plugging and unplugging USB speakers 
on the fly,
please let me know.

Otherwise, I  have a suggestion.

As I understand it, to use my USB speakers, I now have to either:
* enter directly the ALSA HW address of the speakers in each application
   (for the few applications that support it) or
* edit my .asoundrc file to change the default card--each time I use the 
speakers

This is messy.

Ideally:
* when the USB speakers are plugged in, all sound should immediatel to them.
    (That's how it works on Windows and the Mac!)

Failing  that,
* any newly-started application to use the USB speakers, if they are plugged 
in.

One could imagine using something like hotplug to automatically re-write the 
.asoundrc file whenever a USB change is detected.  But that is a shaky 
solution.

I have a suggestion.

By a simple change in interpretation of the .asoundrc file, new ALSA devices 
could be automatically recognized when an application is started.

Currently, only the last default entry in the .asoundrc file is used. If no 
match is found for the hardware in the last default entry, ALSA fails.

My suggestion is, instead of this behavior, that ALSA use all the default 
entries in the .asoundrc file, reading them in reverse order until it finds 
working hardware.

This way, the user could put multiple entries in the .asoundrc file, in 
inverse order of preverence, like so:
===============================
pcm.!default {
    type hw
    card 0
    device 0
}
# USB speakers
pcm.!default {
    type hw
    card 1
    device 0
}
===============================
When an application starts, it first checks to see if there is hardware 
matching the last entry.  If it finds such hardware, it uses that hardware; 
otherwise, it tries the next-to-last entry, and so on.

The effect (in my case) would be: if USB speakers are plugged in, the 
application uses them for output; if they aren't, it uses the built-in sound 
hardware.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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