[alsa-devel] How to set idle S/PDIF sample rate?

Takashi Iwai tiwai at suse.de
Mon Feb 25 12:16:11 CET 2008


At Fri, 22 Feb 2008 22:34:22 -0500,
Matt Whitlock wrote:
> 
> When no programs have the sound hardware open, ALSA drives my Intel HDA's S/PDIF output with silence at 48000 Hz.  How would I change this default so that the idle sample rate is 44100 Hz?  The reason I ask is that my stereo receiver misses the first second or so of each song that I play as it switches from 48000 Hz to 44100 Hz.  I understand that by switching the idle sample rate to 44100 Hz, I would have the same problem whenever playing a DVD, but I can much more happily accept the switching delay when starting DVDs than I can when starting music playback.

You can use iecset utility to set the default SPDIF setting.
But, in the case of HD-audio, the sample rate isn't included in the
status bits verb but rather set dynamically via the normal PCM rate
stting.  So, I don't think this would fix your problem.

> I've tried everything, including replacing /usr/share/alsa/alsa.conf with a single PCM definition that outputs straight to hardware with "rate 44100", but still, whenever nothing is accessing the sound hardware, ALSA reverts to 48000-Hz silence.  There must be a way to influence that, right?
> 
> Alternatively, if ALSA would simply not output anything over S/PDIF when idle, my receiver could just stay at 44100 Hz, albeit unlocked since there would be no data stream at all.  So this is also an acceptable solution to me, but I cannot find any way to make ALSA totally shut up when idle.  It always wants to output silence.  Interestingly, if I mute the IEC958 playback channel and then unmute it, my receiver reports no signal at all until I play a sound, and then after the sound finishes, my receiver reports that it is locked onto PCM at 48000 Hz.  Seems kind of like a bug, doesn't it?

Hm, what happens if you mute IEC958 playback switch before the end of
the playback stream?


Takashi


More information about the Alsa-devel mailing list