kern/156433: [sound] [patch] OSS4/VPC is broken on 64-bit platforms

Grigori Goronzy greg at chown.ath.cx
Fri Apr 15 21:40:08 UTC 2011


>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 at 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:


More information about the freebsd-bugs mailing list