From: Takashi Iwai Subject: Re: Staying synced after underrun Date: Tue, 15 May 2012 10:49:34 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id CA4FA24C82 for ; Tue, 15 May 2012 10:49:34 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: "Paul D. DeRocco" Cc: Alsa-devel List-Id: alsa-devel@alsa-project.org At Tue, 15 May 2012 00:45:54 -0700, Paul D. DeRocco wrote: > > I'm writing 48KHz stereo to Intel HD audio on my mobo, and I'd like to send > it in parallel to both the analog and S/PDIF outputs, which share a clock > source. If I open both devices, configure them with the same buffer space, > and write the same data with snd_pcm_writei, how should I handle an > underrun? Call snd_pcm_prepare on both device handles? If so, and the first > device underruns, should I bother writing the buffer to the second device? It's no direct answer to your question, but: Isn't the SPDIF device sent from the same codec as the analog, or it's over a different codec? In the former case, turning on "IEC958 Default PCM Playback Switch" mixer will send the stream both to analog and SPDIF outs. (When an SPDIF device was opened beforehand, this will keep the device thus the multiplex won't happen, though.) Takashi