From owner-freebsd-multimedia@FreeBSD.ORG Fri Jul 29 01:00:19 2011 Return-Path: Delivered-To: freebsd-multimedia@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0A90106564A for ; Fri, 29 Jul 2011 01:00:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B917B8FC0C for ; Fri, 29 Jul 2011 01:00:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p6T10JSH014922 for ; Fri, 29 Jul 2011 01:00:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p6T10JX4014921; Fri, 29 Jul 2011 01:00:19 GMT (envelope-from gnats) Date: Fri, 29 Jul 2011 01:00:19 GMT Message-Id: <201107290100.p6T10JX4014921@freefall.freebsd.org> To: freebsd-multimedia@FreeBSD.org From: Test Rat Cc: Subject: Re: kern/156433: [sound] [patch] OSS4/VPC is broken on 64-bit platforms X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Test Rat List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 01:00:20 -0000 The following reply was made to PR kern/156433; it has been noted by GNATS. From: Test Rat To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/156433: [sound] [patch] OSS4/VPC is broken on 64-bit platforms Date: Fri, 29 Jul 2011 04:25:37 +0400 --=-=-= Content-Type: text/plain Any chance the fix will be committed before 9.0-RELEASE? The ioctl is used by more apps than just mplayer2, see http://google.com/codesearch?q=SNDCTL_DSP_SETPLAYVOL (gst-plugins-good, wine, xmms2, moc, qmmp, etc) I've tried to change volume with attached test program but it stays the same. This is also reflected in /dev/sndstat, try http://people.freebsd.org/~ariff/utils/appsmixer --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=test_vol.c #include #include #include #include #include #include #include #include int audio_fd; int lvol, rvol; void setplayvol(void) { int mask = lvol | rvol << 8; if(ioctl(audio_fd, SNDCTL_DSP_SETPLAYVOL, &mask) < 0) err(errno, "SNDCTL_DSP_SETPLAYVOL failed"); } void getplayvol(void) { int mask; if(ioctl(audio_fd, SNDCTL_DSP_GETPLAYVOL, &mask) < 0) err(errno, "SNDCTL_DSP_GETPLAYVOL failed"); lvol = mask & 0x00ff; rvol = (mask & 0xff00) >> 8; printf("\rvol is %d:%d ", lvol, rvol); } int main(void) { char ch, buf[] = "noise"; struct termios t; if((audio_fd = open("/dev/dsp", O_WRONLY, 0)) < 0) err(errno, "open failed"); printf("hit ^C to abort\n"); getplayvol(); tcgetattr(0, &t); t.c_lflag &= ~(ECHO|ICANON); tcsetattr(0, TCSANOW, &t); while ((ch = getchar()) != EOF) { switch(ch) { case '+': if(lvol < 100 && rvol < 100) { lvol++; rvol++; } break; case '-': if(lvol > 0 && rvol > 0) { lvol--; rvol--; } break; case 'L': case 'l': if(lvol < 100) lvol++; break; case 'R': case 'r': if(rvol < 100) rvol++; break; case '\014': /* ^L */ if(lvol > 0) lvol--; break; case '\022': /* ^R */ if(rvol > 0) rvol--; break; case '\007': /* ^G */ close(audio_fd); if((audio_fd = open("/dev/dsp", O_WRONLY, 0)) < 0) err(errno, "open failed"); getplayvol(); continue; default: /* any other key produces noise */ write(audio_fd, buf, sizeof(buf)); continue; } setplayvol(); getplayvol(); } close(audio_fd); return 0; } --=-=-=--