Discussion:
snd_hda multichannel support added
(too old to reply)
Alexander Motin
2010-01-13 08:41:43 UTC
Permalink
Hi.

As sound(4) got multichannel support since FreeBSD 8.0, I've implemented
multichannel (4.0, 5.1, 7.1) playback support for snd_hda(4) driver.
MPlayer now successfully plays 4/6-channel audio streams when running
with respective -channels option. The only thing you should configure,
is to inform vchans about present number of speakers by something like:
sysctl dev.pcm.0.play.vchanformat="s16le:7.1"

Code was recently added to 9-CURRENT. Patch for 8-STABLE can be found
here: http://people.freebsd.org/~mav/snd_hda.mch.patch

Have a nice sound! :)

PS: Stereo stream is no more duplicated to all connectors. If you loose
sound, check you are using right ones. Front speakers connector is
usually green, center/LFE - orange, rear - black, side - gray.
--
Alexander Motin
Diego Ochoa Tocachi
2010-01-13 16:14:45 UTC
Permalink
Post by Alexander Motin
Hi.
As sound(4) got multichannel support since FreeBSD 8.0, I've implemented
multichannel (4.0, 5.1, 7.1) playback support for snd_hda(4) driver.
MPlayer now successfully plays 4/6-channel audio streams when running
with respective -channels option. The only thing you should configure,
sysctl dev.pcm.0.play.vchanformat="s16le:7.1"
Code was recently added to 9-CURRENT. Patch for 8-STABLE can be found
here: http://people.freebsd.org/~mav/snd_hda.mch.patch<http://people.freebsd.org/%7Emav/snd_hda.mch.patch>
Have a nice sound! :)
PS: Stereo stream is no more duplicated to all connectors. If you loose
sound, check you are using right ones. Front speakers connector is
usually green, center/LFE - orange, rear - black, side - gray.
--
Alexander Motin
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia
To unsubscribe, send any mail to "
Hi,

I've patched but when I compile I got:

starkiller# cd /usr/src/sys/dev/sound/pci/hda/
starkiller# cat /root/snd_hda.mch.patch |patch -p1
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: hdac_private.h
|===================================================================
|--- hdac_private.h (revision 202126)
|+++ hdac_private.h (revision 202156)
--------------------------
Patching file hdac_private.h using Plan A...
Hunk #1 succeeded at 221.
Hunk #2 succeeded at 282.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: hdac.c
|===================================================================
|--- hdac.c (revision 202126)
|+++ hdac.c (revision 202156)
--------------------------
Patching file hdac.c using Plan A...
Hunk #1 succeeded at 3405 (offset -50 lines).
Hunk #2 succeeded at 3423 (offset -50 lines).
Hunk #3 succeeded at 3431 (offset -50 lines).
Hunk #4 succeeded at 3451 (offset -50 lines).
Hunk #5 succeeded at 3479 with fuzz 1 (offset -50 lines).
Hunk #6 failed at 3489.
Hunk #7 succeeded at 3568 (offset -8 lines).
Hunk #8 succeeded at 6409 (offset -58 lines).
Hunk #9 succeeded at 6470 (offset -8 lines).
Hunk #10 succeeded at 6444 (offset -58 lines).
Hunk #11 succeeded at 6510 (offset -8 lines).
Hunk #12 succeeded at 6501 (offset -58 lines).
1 out of 12 hunks failed--saving rejects to hdac.c.rej
done


starkiller# cd /usr/src/sys/modules/sound/driver/hda

starkiller# make
Warning: Object directory not changed from original
/usr/src/sys/modules/sound/driver/hda
cc -O2 -pipe -march=nocona -fno-strict-aliasing -Werror -D_KERNEL
-DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -finline-limit=8000
--param inline-unit-growth=100 --param large-function-growth=1000
-fno-common -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone
-mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fstack-protector
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -c
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c
cc1: warnings being treated as errors
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c:
In function 'hdac_channel_setfragments':
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c:3497:
warning: implicit declaration of function 'lcm'
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c:3497:
warning: nested extern declaration of 'lcm'
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c:
In function 'hdac_pcmchannel_setup':
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c:6434:
warning: implicit declaration of function 'HDA_PARAM_AUDIO_WIDGET_CAP_CC'
/usr/src/sys/modules/sound/driver/hda/../../../../dev/sound/pci/hda/hdac.c:6434:
warning: nested extern declaration of 'HDA_PARAM_AUDIO_WIDGET_CAP_CC'
*** Error code 1

Stop in /usr/src/sys/modules/sound/driver/hda.


my system:

FreeBSD starkiller 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5
21:11:58 UTC 2010
***@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC
amd64


There's something wrong that I did??
--
Diego Ochoa - darkbalder
Luis Pasteur 2-30 y Copernico
Telf: +593 7 4082144
Porta: 090085391
Cuenca - Ecuador
Alexander Motin
2010-01-13 16:23:06 UTC
Permalink
Post by Diego Ochoa Tocachi
FreeBSD starkiller 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5
21:11:58 UTC 2010
There's something wrong that I did??
Patch was made for 8-STABLE. It doesn't apply to 8.0-RELEASE sources, as
they are bit different. In this case you should either update system, or
take whole hda/ folder from 8-STABLE and patch it, or just take driver
from 9-CURRENT. Here is full driver sources from 9-CURRENT:
http://people.freebsd.org/~mav/hda.tgz
--
Alexander Motin
Christian Weisgerber
2010-01-17 23:50:03 UTC
Permalink
Post by Alexander Motin
As sound(4) got multichannel support since FreeBSD 8.0, I've implemented
multichannel (4.0, 5.1, 7.1) playback support for snd_hda(4) driver.
On a vaguely related note: Is there anything anywhere in the open
source world that real-time encodes multi-channel audio into AC3
or DTS so that it can be squeezed through an S/PDIF link?
--
Christian "naddy" Weisgerber ***@mips.inka.de
Wes Morgan
2010-01-18 01:04:22 UTC
Permalink
Post by Christian Weisgerber
Post by Alexander Motin
As sound(4) got multichannel support since FreeBSD 8.0, I've implemented
multichannel (4.0, 5.1, 7.1) playback support for snd_hda(4) driver.
On a vaguely related note: Is there anything anywhere in the open
source world that real-time encodes multi-channel audio into AC3
or DTS so that it can be squeezed through an S/PDIF link?
ffmpeg?
Clemens Ladisch
2010-01-18 07:57:49 UTC
Permalink
Post by Wes Morgan
Post by Christian Weisgerber
On a vaguely related note: Is there anything anywhere in the open
source world that real-time encodes multi-channel audio into AC3
or DTS so that it can be squeezed through an S/PDIF link?
ffmpeg?
I don't think the tool can be made to work in real time.

ALSA's a52 plugin uses ffmpeg's libavcodec to convert 6-channel PCM to
AC-3. It works more or less transparently for ALSA applications; it
would not be easy to convert it to an API that does not have support for
userspace plugins.


Best regards,
Clemens
Christian Weisgerber
2010-01-20 01:46:21 UTC
Permalink
Post by Clemens Ladisch
Post by Wes Morgan
Post by Christian Weisgerber
On a vaguely related note: Is there anything anywhere in the open
source world that real-time encodes multi-channel audio into AC3
or DTS so that it can be squeezed through an S/PDIF link?
ffmpeg?
I don't think the tool can be made to work in real time.
ALSA's a52 plugin uses ffmpeg's libavcodec to convert 6-channel PCM to
AC-3.
It turns out that new versions of mplayer can do that, too.
The magic to use is "-af lavcac3enc".

I assume this will be available once the mplayer port has been
updated...
--
Christian "naddy" Weisgerber ***@mips.inka.de
Loading...