From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 15 21:40:08 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 430BE1065673 for ; Fri, 15 Apr 2011 21:40:08 +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 0441D8FC14 for ; Fri, 15 Apr 2011 21:40:08 +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 p3FLe7Y3072001 for ; Fri, 15 Apr 2011 21:40:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3FLe7qc072000; Fri, 15 Apr 2011 21:40:07 GMT (envelope-from gnats) Resent-Date: Fri, 15 Apr 2011 21:40:07 GMT Resent-Message-Id: <201104152140.p3FLe7qc072000@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Grigori Goronzy Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD971065670 for ; Fri, 15 Apr 2011 21:34:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id C85E08FC0A for ; Fri, 15 Apr 2011 21:34:12 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p3FLYCGK027613 for ; Fri, 15 Apr 2011 21:34:12 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p3FLYCCd027612; Fri, 15 Apr 2011 21:34:12 GMT (envelope-from nobody) Message-Id: <201104152134.p3FLYCCd027612@red.freebsd.org> Date: Fri, 15 Apr 2011 21:34:12 GMT From: Grigori Goronzy To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/156433: [sound] [patch] OSS4/VPC is broken on 64-bit platforms X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 21:40:08 -0000 >Number: 156433 >Category: kern >Synopsis: [sound] [patch] OSS4/VPC is broken on 64-bit platforms >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 15 21:40:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Grigori Goronzy >Release: RELENG_8 >Organization: >Environment: FreeBSD fbsd.chown.ath.cx 8.2-RELEASE FreeBSD 8.2-RELEASE #1: Fri Apr 15 19:04:14 UTC 2011 root@fbsd.chown.ath.cx:/usr/obj/usr/src/sys/MINE amd64 >Description: The OSS4 API for volume control is broken on 64-bit platforms. I tracked it down and noticed that the ioctl passthrough/wrapper uses "int" where it should use an "u_long" for passing ioctl parameters. On most 32-bit platforms this is not an issue, as sizeof(int)==sizeof(u_long). Not so on 64-bit platforms, though. This boils down to a signed vs unsigned issue when the parameter is converted from int to u_long. This affects the SNDCTL_DSP_SETPLAYVOL ioctl and possibly others. >How-To-Repeat: 1. Install mplayer2 2. Play an audio file through mplayer2's OSS output (which uses the aforementioned API call) 3. Try to change volume with "9" and "0" keys 4. Nothing happens >Fix: The attached patch. Patch attached with submission follows: --- sys/dev/sound/pcm/dsp.c.orig 2011-04-15 20:24:23.000000000 +0000 +++ sys/dev/sound/pcm/dsp.c 2011-04-15 20:38:30.000000000 +0000 @@ -1055,7 +1055,8 @@ { struct pcm_channel *chn, *rdch, *wrch; struct snddev_info *d; - int *arg_i, ret, tmp, xcmd; + int *arg_i, ret, tmp; + u_long xcmd; d = dsp_get_info(i_dev); if (!DSP_REGISTERED(d, i_dev)) >Release-Note: >Audit-Trail: >Unformatted: