Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2009 09:25:14 +0200
From:      Alexander Motin <mav@FreeBSD.org>
To:        Christian Weisgerber <naddy@mips.inka.de>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: snd_hda, mplayer, and S/PDIF pass-through
Message-ID:  <496C41DA.4030201@FreeBSD.org>
In-Reply-To: <1231806185.00059899.1231794002@10.7.7.3>
References:  <1231806185.00059899.1231794002@10.7.7.3>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?496C41DA.4030201>