Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 2000 18:46:58 GMT
From:      oh@btinternet.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/23618: update port: mbone/vat to (better) support newpcm
Message-ID:  <200012181846.eBIIkw218048@adelie.btinteractive.net>
Resent-Message-ID: <200012181850.eBIIo1E15705@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         23618
>Category:       ports
>Synopsis:       Updates for newpcm duplex probing and AC97-like mixers.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 18 10:50:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Orion Hodson
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
>Environment:

	Machine running newpcm.

>Description:

The existing code detects full-duplex cards as half-duplex under
newpcm.  It also assumes SB-style mixer input, most new cards are AC97
style.

>How-To-Repeat:

>Fix:

Patch enclosed that updates full duplex probing to work properly with
newpcm and adds RECLEV to input gain fn for AC97 style mixers.

Thanks
- Orion.

diff -urN vat-orig/files/patch-ak vat/files/patch-ak
--- vat-orig/files/patch-ak	Thu Jan  1 01:00:00 1970
+++ vat/files/patch-ak	Mon Dec 18 18:23:23 2000
@@ -0,0 +1,44 @@
+--- audio-voxware-pre-oh-patch.cc	Mon Dec 18 17:24:46 2000
++++ audio-voxware.cc	Mon Dec 18 18:18:31 2000
+@@ -251,13 +251,26 @@
+ int
+ VoxWare::HalfDuplex() const
+ {
+-    int i;
+-    if (is_half_duplex) {
++    int i, probed_duplex = 0;
++
++    /* newpcm style */
++#ifdef SNDCTL_DSP_GETCAPS
++    ioctl(fd, SNDCTL_DSP_GETCAPS, &i);
++    probed_duplex |= (i & DSP_CAP_DUPLEX); 
++#endif /* SNDCTL_DSP_GETCAPS */
++
++    /* pcm style */
++#ifdef SNDCTL_DSP_GETFMTS
++    ioctl(fd, SNDCTL_DSP_GETFMTS, &i);
++    probed_duplex |= (i & AFMT_FULLDUPLEX);
++#endif /* SNDCTL_DSP_GETFMTS */
++
++    if (is_half_duplex || (probed_duplex == 0)) {
+ 	fprintf(stderr, "HalfDuplex returns 1\n");
+ 	return 1 ;
+ 	}
+-    ioctl(fd, SNDCTL_DSP_GETFMTS, &i);
+-    return (i & AFMT_FULLDUPLEX) ? 0 : 1 ;
++
++    return 0;
+ }
+ 
+ void VoxWare::Release()
+@@ -399,7 +412,9 @@
+ 	    printf("failed to set mic volume \n");
+ 	break;
+     }
+-    if (ioctl(fd, MIXER_WRITE(SOUND_MIXER_IGAIN), &foo) == -1)
++    /* IGAIN tends to be found on SB-like mixers, RECLEV on AC97 */
++    if ((ioctl(fd, MIXER_WRITE(SOUND_MIXER_IGAIN), &foo) == -1) && 
++	(ioctl(fd, MIXER_WRITE(SOUND_MIXER_RECLEV), &foo) == -1))
+        printf("failed set input line volume \n");
+ 	rgain = level;
+ }

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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