[alsa-devel] SPDIF audio / non-audio bit

Takashi Iwai tiwai at suse.de
Thu Aug 14 17:19:41 CEST 2008

At Fri, 15 Aug 2008 00:48:41 +1000,
Ben Stanley wrote:
> Dear alsa-devel,
> I recently advised this list of some problems I experienced with the
> SPDIF audio / non-audio bit being set inappropriately while using the
> ca0106 driver [1]. Seeing as I got no replies, I am trying again.
> When playing AC3 encoded streams (Dolby Digital, DTS), the SPDIF
> non-audio bit is set. Otherwise, for PCM streams, the SPDIF is set to
> audio.
> Could someone explain to me what part of the software is responsible for
> correctly setting the SPDIF audio / non-audio bit? Is it
> * alsa-driver
> * alsa-lib
> * application  ?

It's application, basically.  The app can let alsa-lib set the default
values, though.

> It seems to me that currently some applications (MythTV, xine) set it
> correctly, but most other applications ignore it. So if it is set to
> non-audio (because for example MythTV crashed before re-setting it to
> audio), then all applications that are not aware of the setting have
> their audio broken.

Some drivers have the independent PCM IEC958 status bits while many
have only the default IEC958 status bits.  In the former case, the
driver resets automatically the status bits after closing the PCM
stream.  Your case is the latter one, which doesn't reset.  In this
case, usually alsa-lib takes the old setting back.  But when the
program crashes (or aborted unexpectedly), the new setting is kept
even after that, as you described in the above.

> Could someone set me straight here so that I can try to produce a
> permanent fix for this?

You can change the status easily via iecset program in alsa-utils.

Maybe it's safer to have an independent PCM iec958 setting on all
drivers.  But this requires the change in alsa-lib (system) config,
i.e. it may cause an incompatibility with older alsa-lib configs.
This is an only drawback, I think.


More information about the Alsa-devel mailing list