Friday, January 28, 2011

Alsa Device Widget

As part of the work to make alsa and pulse audio device selection working. I created a widget that gets a list of alsa devices. I'm planning on extending this to pulse devices as well. Not sure how I want to do this completely yet. But I have some ideas forming.

I think the main idea may be that rather than selecting the mplayer ao device. The user would just pick the device from list and would not need to worry if it was a pulse or alsa device. I plan to have a "Default" option that will use whatever mplayer is either configured for or whatever it detects. That allows legacy stuff to work correctly.

Screen shot, showing the widget with the devices it found on my computer. I have noticed that the order of the devices may change from boot to boot, so I may need to sort the list.

Thursday, January 27, 2011

Alsa and Pulse Output Devices

So over Christmas I got myself a Logitech Clear Chat Wireless Headset. It is a really nice headset for listening to music, and I really like that it doesn't have a cord.

Selecting the headset for audio playback is kind of a pain, you have to go through a couple of menus in pulse and for alsa it is even worse. So I have been experimenting with how can I select this device in Gnome Mplayer using a menu or preference.

After a few hours here and there I have figured out how to get the device lists from both Alsa and Pulse. So I have the foundation set, now I just need to work on integrating it into Gnome Mplayer. The bad part of this, is that it is going to make me rethink sound defaults again. My plan is this..

1. Detect if pulse can be connected to, if not default to alsa playback
2. Get the volume from the sound server (I have existing code for alsa in gnome-mplayer, but for pulse I have it is a test program).
3. Under the audio preference dialog create a new drop down, which contains default and then the list of devices
4. On the plugin preference page, reuse the same data to create a possible different setting (you may want to have webpages play out the speakers, but audio come out headphones)
5. Create a quick select menu under the edit menu if more than one device is found. Using the quick select will require an Mplayer restart of the current media, as it does not have a way to switch outputs that I see via the slave interface.

Now I just need 8 - 10 hours to put this all together...