How do I use AC3 codec instead of PCM like mplayer -ac hwac3

Norikatsu Shigemura nork at FreeBSD.org
Sun Nov 2 13:02:07 PST 2008


On Sun, 02 Nov 2008 22:07:52 +0200
Alexander Motin <mav at FreeBSD.org> wrote:
> Yes, comment out whole
>          /* Declare soft PCM and master volume if needed. */ 
> 
>          if (pdevinfo->play >= 0) { 
> 
> 	...
> 	}
> part.
> And disable vchans for pcm1 and pcm2:
> sysctl dev.pcm.1.play.vchans=0
> sysctl dev.pcm.2.play.vchans=0

	Thank you!  It looks good!  But, Sorry, I don't have any S/PDIF
	and HDMI devices.  So I didn't confirm with hearing from speaker.
	But I can get S/PDIF speaker! :D

case of hw.snd.default_unit=1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  :
==========================================================================
Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
dec_audio: Allocating 8192 bytes for input buffer.
dec_audio: Allocating 16384 + 65536 = 81920 bytes for output buffer.
No accelerated IMDCT transform found
hwac3: switched to AC3, 448000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, ac3, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
==========================================================================
Building audio filter chain for 48000Hz/2ch/ac3 -> 0Hz/0ch/??...
[libaf] Adding filter dummy 
[dummy] Was reinitialized: 48000Hz/2ch/ac3
[dummy] Was reinitialized: 48000Hz/2ch/ac3
ao2: 48000 Hz  2 chans  ac3
audio_setup: using '/dev/dsp' dsp device
audio_setup: using '/dev/mixer' mixer device
audio_setup: using 'pcm' mixer device
audio_setup: sample format: ac3 (requested: ac3)
audio_setup: frags:  32/32  (512 bytes/frag)  free:  16384
AO: [oss] 48000Hz 2ch ac3 (1 bytes per sample)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
Building audio filter chain for 48000Hz/2ch/ac3 -> 48000Hz/2ch/ac3...
[dummy] Was reinitialized: 48000Hz/2ch/ac3
[dummy] Was reinitialized: 48000Hz/2ch/ac3
Starting playback...
  :

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

case of hw.snd.default_unit=1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  :
==========================================================================
Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
dec_audio: Allocating 8192 bytes for input buffer.
dec_audio: Allocating 16384 + 65536 = 81920 bytes for output buffer.
No accelerated IMDCT transform found
hwac3: switched to AC3, 448000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, ac3, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
==========================================================================
Building audio filter chain for 48000Hz/2ch/ac3 -> 0Hz/0ch/??...
[libaf] Adding filter dummy 
[dummy] Was reinitialized: 48000Hz/2ch/ac3
[dummy] Was reinitialized: 48000Hz/2ch/ac3
ao2: 48000 Hz  2 chans  ac3
audio_setup: using '/dev/dsp' dsp device
audio_setup: using '/dev/mixer' mixer device
audio_setup: using 'pcm' mixer device
audio_setup: sample format: ac3 (requested: ac3)
audio_setup: frags:  32/32  (512 bytes/frag)  free:  16384
AO: [oss] 48000Hz 2ch ac3 (1 bytes per sample)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
Building audio filter chain for 48000Hz/2ch/ac3 -> 48000Hz/2ch/ac3...
[dummy] Was reinitialized: 48000Hz/2ch/ac3
[dummy] Was reinitialized: 48000Hz/2ch/ac3
Starting playback...
  :
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-- 
Norikatsu Shigemura <nork at FreeBSD.org>
-------------- next part --------------
--- dmesg.snd_hda.txt	2008-11-03 02:13:54.016366831 +0900
+++ dmesg.snd_hda.txt.2	2008-11-03 05:34:47.487079858 +0900
@@ -45,7 +45,7 @@
 pci0:0:20:2: reprobing on driver added
 hdac0: <ATI SB600 High Definition Audio Controller> mem 0xf0500000-0xf0503fff irq 16 at device 20.2 on pci0
 hdac0: HDA Driver Revision: 20081030_0115
-ioapic0: Assigning PCI IRQ 16 to local APIC 1
+ioapic0: Assigning PCI IRQ 16 to local APIC 0
 ioapic0: routing intpin 16 (PCI IRQ 16) to vector 53
 hdac0: [MPSAFE]
 hdac0: [ITHREAD]
@@ -848,7 +848,6 @@
 pcm0:    +- ctl 15 (nid  12 in   1): mute
 pcm0:    +- ctl 63 (nid  35 in  10): mute
 pcm0: 
-pcm0: Enabling Soft PCM volume
 pcm0: Mixer "vol":
 pcm0: Mixer "pcm":
 pcm0: Mixer "speaker":
@@ -858,10 +857,9 @@
 pcm0: Mixer "rec":
 pcm0: Mixer "ogain":
 pcm0: Mixer "monitor":
-pcm0: Soft PCM mixer ENABLED
 pcm0: clone manager: deadline=750ms flags=0x8000001e
-pcm0: sndbuf_setmap 2ecd0000, 4000; 0xfffffffea2324000 -> 2ecd0000
-pcm0: sndbuf_setmap 25710000, 4000; 0xfffffffea2334000 -> 25710000
+pcm0: sndbuf_setmap 38f30000, 4000; 0xfffffffea2324000 -> 38f30000
+pcm0: sndbuf_setmap a96e0000, 4000; 0xfffffffea2334000 -> a96e0000
 pcm1: <HDA Realtek ALC888 PCM #1> at cad 0 nid 1 on hdac0
 pcm1: +--------------------------------------+
 pcm1: | DUMPING PCM Playback/Record Channels |
@@ -889,13 +887,8 @@
 pcm1: | DUMPING Volume Controls |
 pcm1: +-------------------------+
 pcm1: 
-pcm1: Forcing Soft PCM volume
-pcm1: Forcing master volume with PCM
-pcm1: Mixer "vol" -> "none": child=0x00000010
-pcm1: Mixer "pcm": parent="vol"
-pcm1: Soft PCM mixer ENABLED
 pcm1: clone manager: deadline=750ms flags=0x8000001e
-pcm1: sndbuf_setmap 28ba0000, 4000; 0xfffffffea2344000 -> 28ba0000
+pcm1: sndbuf_setmap a9620000, 4000; 0xfffffffea2344000 -> a9620000
 pcm2: <HDA ATI (Unknown) PCM #0> at cad 0 nid 1 on hdac1
 pcm2: +--------------------------------------+
 pcm2: | DUMPING PCM Playback/Record Channels |
@@ -923,10 +916,5 @@
 pcm2: | DUMPING Volume Controls |
 pcm2: +-------------------------+
 pcm2: 
-pcm2: Forcing Soft PCM volume
-pcm2: Forcing master volume with PCM
-pcm2: Mixer "vol" -> "none": child=0x00000010
-pcm2: Mixer "pcm": parent="vol"
-pcm2: Soft PCM mixer ENABLED
 pcm2: clone manager: deadline=750ms flags=0x8000001e
-pcm2: sndbuf_setmap 28b90000, 4000; 0xfffffffea2354000 -> 28b90000
+pcm2: sndbuf_setmap a9600000, 4000; 0xfffffffea2354000 -> a9600000
-------------- next part --------------
--- sysctl.snd_hda.txt	2008-11-03 02:12:18.973311505 +0900
+++ sysctl.snd_hda.txt.2	2008-11-03 05:48:29.342878364 +0900
@@ -40,14 +40,10 @@
 dev.pcm.1.%desc: HDA Realtek ALC888 PCM #1
 dev.pcm.1.%driver: pcm
 dev.pcm.1.%parent: hdac0
-dev.pcm.1.play.vchans: 1
-dev.pcm.1.play.vchanrate: 48000
-dev.pcm.1.play.vchanformat: s16le
+dev.pcm.1.play.vchans: 0
 dev.pcm.1.buffersize: 16384
 dev.pcm.2.%desc: HDA ATI (Unknown) PCM #0
 dev.pcm.2.%driver: pcm
 dev.pcm.2.%parent: hdac1
-dev.pcm.2.play.vchans: 1
-dev.pcm.2.play.vchanrate: 48000
-dev.pcm.2.play.vchanformat: s16le
+dev.pcm.2.play.vchans: 0
 dev.pcm.2.buffersize: 16384
-------------- next part --------------
--- sys/dev/sound/pci/hda/hdac.c.orig	2008-11-02 14:42:38.116879000 +0900
+++ sys/dev/sound/pci/hda/hdac.c	2008-11-03 05:22:08.359475698 +0900
@@ -3485,7 +3485,7 @@
 	struct hdac_widget *w, *cw;
 	struct hdac_audio_ctl *ctl;
 	uint32_t mask, recmask, id;
-	int i, j, softpcmvol;
+	int i, j;
 
 	hdac_lock(sc);
 
@@ -3549,8 +3549,10 @@
 		}
 	}
 
+#if 0
 	/* Declare soft PCM and master volume if needed. */
 	if (pdevinfo->play >= 0) {
+		int softpcmvol;
 		ctl = NULL;
 		if ((mask & SOUND_MASK_PCM) == 0 ||
 		    (devinfo->function.audio.quirks & HDA_QUIRK_SOFTPCMVOL)) {
@@ -3593,6 +3595,7 @@
 			);
 		}
 	}
+#endif
 
 	recmask &= (1 << SOUND_MIXER_NRDEVICES) - 1;
 	mask &= (1 << SOUND_MIXER_NRDEVICES) - 1;


More information about the freebsd-multimedia mailing list