From kimoto@tatsuki.ohnolab.org  Mon Nov 20 03:38:28 2000
Return-Path: <kimoto@tatsuki.ohnolab.org>
Received: from tatsuki.ohnolab.org (PPP1042.tokyo-ip.dti.ne.jp [211.132.76.42])
	by hub.freebsd.org (Postfix) with ESMTP id D8EE337B479
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 20 Nov 2000 03:38:26 -0800 (PST)
Received: (from root@localhost)
	by tatsuki.ohnolab.org (8.9.3/8.9.3) id UAA00499;
	Mon, 20 Nov 2000 20:36:57 +0900 (JST)
	(envelope-from kimoto)
Message-Id: <200011201136.UAA00499@tatsuki.ohnolab.org>
Date: Mon, 20 Nov 2000 20:36:57 +0900 (JST)
From: kimoto@ohnolab.org
Sender: kimoto@tatsuki.ohnolab.org
Reply-To: kimoto@ohnolab.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: RealProducer doesn't work on linux emulation.
X-Send-Pr-Version: 3.2

>Number:         22971
>Category:       i386
>Synopsis:       RealProducer doesn't work on linux emulation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    marcel
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 20 03:40:01 PST 2000
>Closed-Date:    Sat Nov 17 22:36:57 PST 2001
>Last-Modified:  Sat Nov 17 22:37:48 PST 2001
>Originator:     Masahiko KIMOTO
>Release:        FreeBSD 4.1-RELEASE i386
>Organization:
Tokyo Institute of Technology
>Environment:

FreeBSD 3.x, 4.x and current.
Linux Emulation base-6.1.
Any SoundCards, Any Sound drivers.

>Description:

RealProducer doesn't work on linux emulation on any version of FreeBSD
because of lack of a ioctl for /dev/mixer which is used by RealProducer.

>How-To-Repeat:

Install RealProducer, enable linux emulation and run realproducer.
It terminates with error message of 'ioctl is not implemented'

>Fix:

Simply add the conversion of the ioctl to linux emulation module.
The following patch for FreeBSD 4.1-RELEASE solves the problem.
Please apply it to current.

*** sys/i386/linux/linux_ioctl.c.orig	Mon Nov 20 20:22:07 2000
--- sys/i386/linux/linux_ioctl.c	Mon Nov 20 20:23:11 2000
***************
*** 1044,1049 ****
--- 1044,1053 ----
  		args->cmd = SETDIR(SOUND_MIXER_WRITE_LINE3);
  		return (ioctl(p, (struct ioctl_args *)args));
  
+ 	case LINUX_SOUND_MIXER_WRITE_RECSRC:
+ 	        args->cmd = SETDIR(SOUND_MIXER_WRITE_RECSRC);
+ 	        return ioctl(p, (struct ioctl_args *)args);
+ 
  	case LINUX_OSS_GETVERSION: {
  		int version = linux_get_oss_version(p);
  		return (copyout(&version, (caddr_t)args->arg, sizeof(int)));
*** sys/i386/linux/linux_ioctl.h.orig	Mon Nov 20 20:23:43 2000
--- sys/i386/linux/linux_ioctl.h	Mon Nov 20 20:24:08 2000
***************
*** 163,168 ****
--- 163,169 ----
  #define	LINUX_SOUND_MIXER_WRITE_LINE1	0x4d0E
  #define	LINUX_SOUND_MIXER_WRITE_LINE2	0x4d0F
  #define	LINUX_SOUND_MIXER_WRITE_LINE3	0x4d10
+ #define LINUX_SOUND_MIXER_WRITE_RECSRC  0x4dff
  #define	LINUX_OSS_GETVERSION		0x4d76
  #define	LINUX_SOUND_MIXER_READ_DEVMASK	0x4dfe
  #define	LINUX_SNDCTL_DSP_RESET		0x5000


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Mon May 28 17:11:08 PDT 2001 
State-Changed-Why:  

I'm interested in this topic, so I'll give the patch a try. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Mon May 28 17:11:08 PDT 2001 
Responsible-Changed-Why:  

I'm taking responsibility for this one. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22971 
Responsible-Changed-From-To: dougb->marcel 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Jun 3 21:28:01 PDT 2001 
Responsible-Changed-Why:  

The attached patch (with a ws fix) works for me, in terms of compiling 
and running, but I can't test the conditions that the user is experiencing 
because I don't have the hardware. Marcel, if you don't see any problems 
I suggest punching it in. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22971 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcel 
State-Changed-When: Sat Nov 17 22:36:57 PST 2001 
State-Changed-Why:  
Patch committed. Sorry for the long delay. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=22971 
>Unformatted:
