From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 13 07:25:11 2009 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CE75106564A for ; Tue, 13 Jan 2009 07:25:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2138C8FC12 for ; Tue, 13 Jan 2009 07:25:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 231480363; Tue, 13 Jan 2009 09:25:09 +0200 Message-ID: <496C41DA.4030201@FreeBSD.org> Date: Tue, 13 Jan 2009 09:25:14 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: Christian Weisgerber References: <1231806185.00059899.1231794002@10.7.7.3> In-Reply-To: <1231806185.00059899.1231794002@10.7.7.3> Content-Type: multipart/mixed; boundary="------------070207070805030900070105" Cc: freebsd-multimedia@freebsd.org Subject: Re: snd_hda, mplayer, and S/PDIF pass-through X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 07:25:11 -0000 This is a multi-part message in MIME format. --------------070207070805030900070105 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Christian Weisgerber wrote: > FreeBSD 8.0-CURRENT box with snd_hda audio. > > Since I recently got an AV receiver that supports AC3 and DTS > decoding, I had to try S/PDIF pass-through. I followed the suggestions > mav@ had previously provided here: > * disable vchans (sysctl dev.pcm.2.play.vchans=0) > * mixer vol 100 pcm 100 > > With this, "mplayer -ac hwac3" (or -ac hwdts) starts playing AC3 > (DTS) audio tracks from DVD just fine, i.e., they are passed through > the S/PDIF interface to the receiver which decodes them and confirms > this with various status messages. > > However, once the audio stream is interrupted, e.g. by pausing > playback, it cannot be restarted. mplayer resumes... and the > receiver misdetects the audio as PCM 48 and produces the corresponding > noise. > > Any ideas what's going there? It looks like mplayer bug, it does not sets sample rate on resume. Attached patch fixes it for me. -- Alexander Motin --------------070207070805030900070105 Content-Type: text/plain; name="ao_oss.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ao_oss.c.patch" --- ao_oss.c.prev 2007-10-07 22:49:27.000000000 +0300 +++ ao_oss.c 2008-11-29 21:51:21.000000000 +0200 @@ -433,6 +433,7 @@ static void reset(void){ fcntl(audio_fd, F_SETFD, FD_CLOEXEC); #endif + ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate); oss_format = format2oss(ao_data.format); ioctl (audio_fd, SNDCTL_DSP_SETFMT, &oss_format); if(ao_data.format != AF_FORMAT_AC3) { @@ -442,7 +443,6 @@ static void reset(void){ int c = ao_data.channels-1; ioctl (audio_fd, SNDCTL_DSP_STEREO, &c); } - ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate); } } --------------070207070805030900070105--