2009-09-13, 18:52
I was wondering about how it might be easier on a user if some of the Audio settings were handled in an automated fashion, specifically the settings of "Audio Output", and "Audio Output Device"
Many users especially new to linux don't understand the complexities of the ALSA sound system (especially when involving pulseaudio). Since pulseaudio doesn't support passthrough, i'm going to leave it out of the discussion. I don't feel that it has a place in the HTPC world anyway.
First off, a concern regarding the setting "Audio Output" which can be either "Analog" or "Digital."
The wiki has this to say about this setting:
Debug Log: http://paste.ubuntu.com/270350/
I have only analog speakers hooked up to my machine and even though I have selected Digital as my output, I still have sound. It seems that this setting isn't really a choice between two methods, but instead a priority of which to try first. In the debug log it tries to do passthrough first, fails, and the loads libfaad for decoding the audio which would then send the sound as analog. Given the setting of Audio Output to Digital, I would expect an error to be presented stating that the audio device that is selected (default stereo analog) does not support digital output.
Because of the way that this setting works (the fall back to analog), I think it can be eliminated entirely if the user had the option to set two audio devices, one for analog, and one for digital.
If no digital device is set, then analog is used all the time, and no passthrough is ever attempted for playing of any audio.
If a digital device is set, then passthrough is attempted, and if it fails then it falls back to analog, and displays a message to the user much like "Failed to in audio device," but instead "Passthrough failed, falling back to analog output device: default"
Second off, a concern regarding the setting "Audio Output Device" which can actually be anything I choose to type.
This setting might possibly be able to be auto populated when XBMC loads, or when this page is loaded and offer the user arrow keys on the right side of the item to cylce through like many other settings in XBMC. I'm sure this can be done in a programmatic way, but here is an example using the aplay command in order to gather what devices are available for use:These are the devices available on my system:I think that the user should still be able to type a device because ALSA has support for various plugins and the user may have very specific demands. Of course these very specific demands could be carried out using .asound but that's something else to discuss. There are options on the Event Server settings page which allows the user type, as well has cycle through using the buttons on the right. This is the way that I would see this setting working.
Additionally aplay actually offers descriptions for each of these devices, and describes the card on which they are located:If this path is chosen for this settings page then it would probably be beneficial for the user to display this information as each device is selected, or possibly not even display the device name (surround51, iec958, etc) to the user at, but instead just the description and card name.
I'm no photoshop whiz so i'll type of what I would see the page looking likeIn making this mock up here it seems that XBMC is kind of already setup for this type of behavior but the settings aren't displayed in such a manner. There is currently an audio output device, and a passthrough output device which would be the Analog and Digital devices that I described above. That leaves the "Audio output" without a purpose.
So in short here are the things that I think would help out new users (and really just about any user):
Many users especially new to linux don't understand the complexities of the ALSA sound system (especially when involving pulseaudio). Since pulseaudio doesn't support passthrough, i'm going to leave it out of the discussion. I don't feel that it has a place in the HTPC world anyway.
First off, a concern regarding the setting "Audio Output" which can be either "Analog" or "Digital."
The wiki has this to say about this setting:
http://wiki.xbmc.org/?title=System_Settings Wrote:Allows you to select between Analog and Digital audio output. Note that in order to use digital output, your Xbox needs to be connected to a compatible receiver and a supported AV pack.
Debug Log: http://paste.ubuntu.com/270350/
I have only analog speakers hooked up to my machine and even though I have selected Digital as my output, I still have sound. It seems that this setting isn't really a choice between two methods, but instead a priority of which to try first. In the debug log it tries to do passthrough first, fails, and the loads libfaad for decoding the audio which would then send the sound as analog. Given the setting of Audio Output to Digital, I would expect an error to be presented stating that the audio device that is selected (default stereo analog) does not support digital output.
Because of the way that this setting works (the fall back to analog), I think it can be eliminated entirely if the user had the option to set two audio devices, one for analog, and one for digital.
If no digital device is set, then analog is used all the time, and no passthrough is ever attempted for playing of any audio.
If a digital device is set, then passthrough is attempted, and if it fails then it falls back to analog, and displays a message to the user much like "Failed to in audio device," but instead "Passthrough failed, falling back to analog output device: default"
Second off, a concern regarding the setting "Audio Output Device" which can actually be anything I choose to type.
This setting might possibly be able to be auto populated when XBMC loads, or when this page is loaded and offer the user arrow keys on the right side of the item to cylce through like many other settings in XBMC. I'm sure this can be done in a programmatic way, but here is an example using the aplay command in order to gather what devices are available for use:
Code:
aplay -L|awk -F':' '/.*:/{print $1}'
Code:
default
front
surround40
surround41
surround50
surround51
surround71
iec958
hdmi
Additionally aplay actually offers descriptions for each of these devices, and describes the card on which they are located:
Code:
default:CARD=Intel
HDA Intel, STAC92xx Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
Front speakers
surround40:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, STAC92xx Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
HDA Intel, STAC92xx Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=Intel,DEV=0
HDA Intel, INTEL HDMI
HDMI Audio Output
I'm no photoshop whiz so i'll type of what I would see the page looking like
Code:
Downmix multichannel audio to stereo o
Analog Output Device surround51 <down|up>
Intel - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
Digital Output Device iec958 <down|up>
Intel - IEC958 (S/PDIF) Digital Audio Output
- Dolby Digital capable receiver o
- DTS capabale reciever o
So in short here are the things that I think would help out new users (and really just about any user):
- Having two output devices one for Analog and Digital (As there are currently, but aptly named)
- Automatically populating the Audio devices (Respective of Analog, and Digital)
- Displaying the description of each audio device below the selected device.
- Removing the Audio Output setting as the decision to use Digital can be based off of information such as if a digital device is defined, and/or functioning.