Re: [RFT] Major snd_hda rewrite

From: Alexander Best <arundel_at_freebsd.org>
Date: Sat, 14 Jan 2012 15:24:34 +0000
On Sat Jan 14 12, Alexander Motin wrote:
> On 01/14/12 15:48, Alexander Best wrote:
> >On Thu Jan 12 12, Rainer Hurling wrote:
> >>On 12.01.2012 12:18 (UTC+1), Alexander Motin wrote:
> >>>On 01/12/12 12:52, Gary Jennejohn wrote:
> >>>>On Wed, 11 Jan 2012 21:33:17 +0200
> >>>>Alexander Motin<mav_at_FreeBSD.org>  wrote:
> >>>>>I would like request for testing of my work on further HDA sound driver
> >>>>>improvement.
> >>>>
> >>>>[big snip]
> >>>>
> >>>>>Patch can be found here:
> >>>>>http://people.freebsd.org/~mav/hda.rewrite.patch
> >>>>>
> >>>>>Patch was generated for 10-CURRENT, but should apply to fresh 9-STABLE
> >>>>>and 8-STABLE branches also.
> >>>>
> >>>>The patch doesn't apply cleanly to r230008; hdac.c.rej is 15661 bytes
> >>>>in size (mostly the section which deletes all the manufacturer-specific
> >>>>defines at the top of the file).
> >>>
> >>>That is probably because of $FreeBSD$ macro resolution. Here is version
> >>>with present value from 10-CURRENT SVN (sources from CVS or STABLE will
> >>>need that patch line modified respectively) and some minor additional
> >>>improvements like CODEC ODs and some more sysctls:
> >>>http://people.freebsd.org/~mav/hda.rewrite2.patch
> >
> >maybe you could try silencencing these clang warnings?
> >
> >/usr/subversion-src/sys/dev/sound/pci/hda/hdaa.c:5707:25: warning: format 
> >string is not a string literal (potentially insecure) [-Wformat-security]
> >                 snprintf(buf, buflen, chans = "4.0");
> >                                       ^~~~~~~~~~~~~
> >/usr/subversion-src/sys/dev/sound/pci/hda/hdaa.c:5709:25: warning: format 
> >string is not a string literal (potentially insecure) [-Wformat-security]
> >                 snprintf(buf, buflen, chans = "5.1");
> >                                       ^~~~~~~~~~~~~
> >/usr/subversion-src/sys/dev/sound/pci/hda/hdaa.c:5711:25: warning: format 
> >string is not a string literal (potentially insecure) [-Wformat-security]
> >                 snprintf(buf, buflen, chans = "7.1");
> >                                      ^~~~~~~~~~~~~~
> >/usr/subversion-src/sys/dev/sound/pci/hda/hdacc.c:563:52: warning: if 
> >statement has empty body [-Wempty-body]
> >         if ((child = codec->streams[dir][stream]) != NULL);
> >                                                           ^
> >4 warning generated.
> >
> >..i'll report how the changes interact with my system later on.
> 
> Thank you! That variable is not even used now, so I'll just remove that 
> assignment. I've passed the code through the clang static analyzer at 
> some point, but probably I've introduced that later.

thanks. :)

the patch works great for me, too.

dmesg -a:

hdacc0: <Realtek ALC889A HDA CODEC> at cad 2 on hdac0
hdaa0: <Realtek ALC889A HDA CODEC Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC889A HDA CODEC PCM (Rear Analog 7.1/2.0)> at nid 20,22,21,23 and 24,26 on hdaa0
pcm1: <Realtek ALC889A HDA CODEC PCM (Front Analog)> at nid 27 and 25 on hdaa0
pcm2: <Realtek ALC889A HDA CODEC PCM (Rear Digital)> at nid 30 and 31 on hdaa0

cat /dev/sndstat:

FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <Realtek ALC889A HDA CODEC PCM (Rear Analog 7.1/2.0)> on hdaa0  (1p:1v/2r:1v) default
	snddev flags=0x2e6<AUTOVCHAN,SOFTPCMVOL,BUSY,MPSAFE,REGISTERED,VPC>
	[pcm0:play:dsp0.p0]: spd 48000, fmt 0x00200010, flags 0x00002108, 0x00000004
	interrupts 1274, underruns 0, feed 1274, ready 0 [b:16384/8192/2|bs:16384/8192/2]
	channel flags=0x2108<TRIGGERED,BUSY,HAS_VCHAN>
	{userland} -> feeder_mixer(0x00200010) -> {hardware}
	pcm0:play:dsp0.p0[pcm0:virtual:dsp0.vp0]: spd 44100/48000, fmt 0x00200010, flags 0x1000012c, 0x00000029, pid 927 (musicpd)
	interrupts 0, underruns 0, feed 1859, ready 65536 [b:0/0/0|bs:65536/8192/8]
	channel flags=0x1000012c<RUNNING,TRIGGERED,SLEEPING,BUSY,VIRTUAL>
	{userland} -> feeder_root(0x00200010) -> feeder_volume(0x00200010) -> feeder_rate(0x00200010 q:1 44100 -> 48000) -> {hardware}
	[pcm0:record:dsp0.r0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000005
	interrupts 0, overruns 0, feed 0, hfree 16384, sfree 16384 [b:16384/8192/2|bs:16384/8192/2]
	channel flags=0x2100<BUSY,HAS_VCHAN>
	{hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland}
	[pcm0:record:dsp0.r1]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000
	interrupts 0, overruns 0, feed 0, hfree 65536, sfree 0 [b:65536/32768/2|bs:0/0/0]
	channel flags=0x0
	{hardware} -> feeder_root(0x00000000) -> {userland}
	pcm0:record:dsp0.r0[pcm0:virtual:dsp0.vr0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
	interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 [b:0/0/0|bs:0/0/0]
	channel flags=0x10000000<VIRTUAL>
	{hardware} -> feeder_root(0x00000000) -> {userland}
pcm1: <Realtek ALC889A HDA CODEC PCM (Front Analog)> on hdaa0  (1p:1v/1r:1v)
	snddev flags=0x2e6<AUTOVCHAN,SOFTPCMVOL,BUSY,MPSAFE,REGISTERED,VPC>
	[pcm1:play:dsp1.p0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000004
	interrupts 0, underruns 0, feed 0, ready 0 [b:16384/8192/2|bs:16384/8192/2]
	channel flags=0x2100<BUSY,HAS_VCHAN>
	{userland} -> feeder_mixer(0x00200010) -> {hardware}
	pcm1:play:dsp1.p0[pcm1:virtual:dsp1.vp0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
	interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:0/0/0]
	channel flags=0x10000000<VIRTUAL>
	{userland} -> feeder_root(0x00000000) -> {hardware}
	[pcm1:record:dsp1.r0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000005
	interrupts 0, overruns 0, feed 0, hfree 16384, sfree 16384 [b:16384/8192/2|bs:16384/8192/2]
	channel flags=0x2100<BUSY,HAS_VCHAN>
	{hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland}
	pcm1:record:dsp1.r0[pcm1:virtual:dsp1.vr0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
	interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 [b:0/0/0|bs:0/0/0]
	channel flags=0x10000000<VIRTUAL>
	{hardware} -> feeder_root(0x00000000) -> {userland}
pcm2: <Realtek ALC889A HDA CODEC PCM (Rear Digital)> on hdaa0  (1p:1v/1r:1v)
	snddev flags=0x2e6<AUTOVCHAN,SOFTPCMVOL,BUSY,MPSAFE,REGISTERED,VPC>
	[pcm2:play:dsp2.p0]: spd 48000, fmt 0x00200010, flags 0x00006100, 0x00000004
	interrupts 0, underruns 0, feed 0, ready 0 [b:16384/8192/2|bs:16384/8192/2]
	channel flags=0x6100<BUSY,HAS_VCHAN,VCHAN_PASSTHROUGH>
	{userland} -> feeder_mixer(0x00200010) -> {hardware}
	pcm2:play:dsp2.p0[pcm2:virtual:dsp2.vp0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
	interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:0/0/0]
	channel flags=0x10000000<VIRTUAL>
	{userland} -> feeder_root(0x00000000) -> {hardware}
	[pcm2:record:dsp2.r0]: spd 48000, fmt 0x00200010, flags 0x00006100, 0x00000005
	interrupts 0, overruns 0, feed 0, hfree 16384, sfree 16384 [b:16384/8192/2|bs:16384/8192/2]
	channel flags=0x6100<BUSY,HAS_VCHAN,VCHAN_PASSTHROUGH>
	{hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland}
	pcm2:record:dsp2.r0[pcm2:virtual:dsp2.vr0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000
	interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 [b:0/0/0|bs:0/0/0]
	channel flags=0x10000000<VIRTUAL>
	{hardware} -> feeder_root(0x00000000) -> {userland}

cheers.
alex

> 
> -- 
> Alexander Motin
Received on Sat Jan 14 2012 - 14:24:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:23 UTC