[alsa-devel] Detecting if a pcm device is a digital or analog one
Hi there...
I was wondering if there was any way to accurately distinguish between audio device, if it has an analog or a digital output.
I would prefer not parsing the name (like analog71 is obviously an analog device, while "hdmi" is digital)
I see that on some devices the IEC958 bit is set, but this doesn't seem reliable (on another PC, the IEC958 bit isn't set).
Any suggestions would be greatly appreciated...
Thank you Jean-Yves
Jean-Yves Avenard wrote:
I was wondering if there was any way to accurately distinguish between audio device, if it has an analog or a digital output.
Not really. There are devices where the same stream is routed to both analog and digital outputs, and sometimes the driver cannot know if there is a DAC further down the line. In any case, this would be very hardware specific.
What do you need this for?
Regards, Clemens
On 25 June 2010 09:21, Clemens Ladisch clemens@ladisch.de wrote:
Jean-Yves Avenard wrote:
I was wondering if there was any way to accurately distinguish between audio device, if it has an analog or a digital output.
Not really. There are devices where the same stream is routed to both analog and digital outputs, and sometimes the driver cannot know if there is a DAC further down the line. In any case, this would be very hardware specific.
What do you need this for?
My guess is that if one knew, one could decide if it was sensible to send AC3 encoded data to the PCM or not. Without knowing which PCM is sending data to which outputs, it would be very difficult to accurately distinguish them. Alsa does have a device name "iec958" that one can use instead of "front" or "default" that will ensure the output goes to a digital output if one exists.
James
participants (3)
-
Clemens Ladisch
-
James Courtier-Dutton
-
Jean-Yves Avenard