[MPlayer-dev-eng] AC3 via hwac3, patch

Hans-Peter Raschke Hans-Peter.Raschke at Wintermann-DatenService.de
Tue Jan 8 14:13:52 CET 2002


Hello,

I've got the hwac3 output work with a cmedia 8738 based souncard with a
small modification. Therefore I would like to propose a patch to the
ao_oss.c module (see attached file).

My sound environment:
soundcard:	Zoltrix Nightingale pro 6Ch with SPDIF output (coax/tos)
chipset:	CMI8738
oss driver:	cmpci 5.64 from
		http://members.home.net/puresoft/cmedia.html
tested samplerates: 44.1 and 48 kHz with pcm output via SPDIF
		48 kHz with AC3 via SPDIF
audio delay AC3: approx. -0.75 sec
audio delay PCM: not tested

alsa driver:	0.9-beta9 and beta10 don't work via SPDIF,
		"normal" output works

The oss driver needs the samplerate set to 44.1 or 48 kHz before the AC3
mode is requested. This is done in my attached patch. In addition to
that
the cmpci-Module must be loaded with spdif_loop=0.

Best Regards,
Hans-Peter

-- 
Hans-Peter Raschke           Tel.:   +49 441 9304064
Wintermann DatenService      Fax:    +49 441 9304069
Langenweg 16                 D-26125 Oldenburg
mailto:Hans-Peter.Raschke at Wintermann-DatenService.de
-------------- next part --------------
--- libao2/ao_oss.c.orig	Tue Dec 11 10:23:56 2001
+++ libao2/ao_oss.c	Mon Jan  7 22:45:31 2002
@@ -117,6 +117,13 @@
     ao_data.bps*=2;
 
   ao_data.format=format;
+  ao_data.samplerate=rate;
+
+  if (format == AFMT_AC3) {
+    ioctl (audio_fd, SNDCTL_DSP_SPEED, &ao_data.samplerate);
+    printf("audio_setup: using %d Hz samplerate (requested: %d) for AC3 output\n",ao_data.samplerate,rate);
+  }  
+
   ioctl (audio_fd, SNDCTL_DSP_SETFMT, &ao_data.format);
   if(format == AFMT_AC3 && ao_data.format != AFMT_AC3) {
       printf("Can't set audio device %s to AC3 output\n", dsp);


More information about the MPlayer-dev-eng mailing list