From nobody@FreeBSD.org  Sun Aug  6 00:15:24 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DFFF816A4DE
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  6 Aug 2006 00:15:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AEA0443D53
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  6 Aug 2006 00:15:24 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k760FOr4064487
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 6 Aug 2006 00:15:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k760FON1064486;
	Sun, 6 Aug 2006 00:15:24 GMT
	(envelope-from nobody)
Message-Id: <200608060015.k760FON1064486@www.freebsd.org>
Date: Sun, 6 Aug 2006 00:15:24 GMT
From: Chad Fraleigh <chadf@bookcase.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: transcode/tcprobe broken for devfs
X-Send-Pr-Version: www-2.3

>Number:         101450
>Category:       ports
>Synopsis:       multimedia/transcode: tcprobe broken for devfs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 06 00:20:07 GMT 2006
>Closed-Date:    Sun Nov 06 15:49:30 UTC 2011
>Last-Modified:  Sun Nov 06 15:49:30 UTC 2011
>Originator:     Chad Fraleigh
>Release:        6.1
>Organization:
>Environment:
FreeBSD anonymous.host.name 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Fri Jul 28 18:51:04 EDT 2006     root@:/usr/src/sys/i386/compile/MYCONFIG  i386

transcode-1.0.2_3

>Description:
tcprobe fails on CD/DVD devices. The transcode 1.0.2_3 port uses device
major numbers to determine how to use a device path. With devfs no longer
using well known major device numbers, the function used to identify it
thinks all devices are OSS (major 0).

The broken code is in import/ioaux.c:probe_path():

# ifdef __FreeBSD__
              case 4: /* acd */
                  return(TC_PROBE_PATH_ABSPATH);
              case 229: /* bktr */
                  return(TC_PROBE_PATH_BKTR);
              case 0: /* OSS */
                  return(TC_PROBE_PATH_OSS);
# endif

This causes an indirect error with tcprobe (which also effects the dvdrip
port) when it attempts to do an SNDCTL_DSP_GETFMTS ioctl() [misreported in
the error message as SNDCTL_DSP_SETFMT].

OpenBSD may also be affected if it has, or plans to, make simular device
changes (in case any one cross project monitoring is reading this).

>How-To-Repeat:
% tcprobe -i /dev/acd0
[tcprobe] OSS audio device
SNDCTL_DSP_SETFMT: Inappropriate ioctl for device
[tcprobe] failed to probe source


% tcprobe -i /dev/null
[tcprobe] OSS audio device
SNDCTL_DSP_SETFMT: Inappropriate ioctl for device
[tcprobe] failed to probe source

>Fix:
Abstact: Determine reliable method to distinguish between CD/DVD, BKTR, OSS,
and other devices and add approriete patch to the port and/or submit to
original authors.

Possibly even adding a warning message to the port during installation so
that users know it is broken in this respect, until a real fix can be made.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Tue Aug 29 22:52:16 UTC 2006 
State-Changed-Why:  
To which part of the system does this PR apply? 


Responsible-Changed-From-To: freebsd-bugs->linimon 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Aug 29 22:52:16 UTC 2006 
Responsible-Changed-Why:  
Track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101450 

From: "Chad M. Fraleigh" <chadf@bookcase.com>
To: bug-followup@FreeBSD.org
Cc: linimon@FreeBSD.org
Subject: Re: misc/101450: transcode/tcprobe broken for devfs
Date: Tue, 29 Aug 2006 19:51:22 -0400 (EDT)

  	This should have been 'ports'.
 
  	I initially select this, but waited too long and my session 
 expired, then forgot to set it again when copying everything back in to 
 the new form.
 
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Wed Aug 30 01:25:08 UTC 2006 
State-Changed-Why:  
Make a ports PR and assign. 


Responsible-Changed-From-To: linimon->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Aug 30 01:25:08 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=101450 
Responsible-Changed-From-To: freebsd-ports-bugs->stas 
Responsible-Changed-By: stas 
Responsible-Changed-When: Sat Oct 21 09:46:00 UTC 2006 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101450 

From: Stanislav Sedov <stas@FreeBSD.org>
To: Chad Fraleigh <chadf@bookcase.com>
Cc: hendrik@scholz.net, bug-followup@FreeBSD.org
Subject: Re: ports/101450: multimedia/transcode: tcprobe broken for devfs
Date: Sun, 22 Oct 2006 23:57:45 +0400

 This is a multi-part message in MIME format.
 
 --Multipart=_Sun__22_Oct_2006_23_57_45_+0400_1zO8jJJOoWFRuPbw
 Content-Type: text/plain; charset=KOI8-R
 Content-Transfer-Encoding: quoted-printable
 
 Hi!
 
 Are you agreed with the patch attached?
 
 --=20
 Stanislav Sedov          <stas@FreeBSD.org>        [[=F2=CF=D3=D3=C9=D1, =
 =ED=CF=D3=CB=D7=C1]]
 PGP id: 0xEB269581       http://people.freebsd.org/~stas/stas.key.asc
 
 --Multipart=_Sun__22_Oct_2006_23_57_45_+0400_1zO8jJJOoWFRuPbw
 Content-Type: text/plain;
  name="transcode.diff"
 Content-Disposition: attachment;
  filename="transcode.diff"
 Content-Transfer-Encoding: 7bit
 
 Index: Makefile
 ===================================================================
 RCS file: /work/src/fbsd-cvs/ports/multimedia/transcode/Makefile,v
 retrieving revision 1.77
 diff -u -r1.77 Makefile
 --- Makefile	21 Sep 2006 08:07:58 -0000	1.77
 +++ Makefile	22 Oct 2006 18:01:25 -0000
 @@ -7,7 +7,7 @@
  
  PORTNAME=	transcode
  PORTVERSION=	1.0.2
 -PORTREVISION=	4
 +PORTREVISION=	5
  CATEGORIES=	multimedia
  MASTER_SITES=	http://dl.fkb.wormulon.net/transcode/ \
  		http://dl.kel.wormulon.net/transcode/ \
 Index: files/patch-import_ioaux.c
 ===================================================================
 RCS file: files/patch-import_ioaux.c
 diff -N files/patch-import_ioaux.c
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ files/patch-import_ioaux.c	22 Oct 2006 18:41:17 -0000
 @@ -0,0 +1,35 @@
 +--- import/ioaux.c.orig	Sun Oct 22 22:03:30 2006
 ++++ import/ioaux.c	Sun Oct 22 22:41:12 2006
 +@@ -261,6 +261,17 @@
 +       /* char device could be several things, depending on system */
 +       /* *BSD DVD device? v4l? bktr? sunau? */
 +       if(S_ISCHR(fbuf.st_mode)) {
 ++# ifdef __FreeBSD__
 ++        if (strstr(name, "bktr") != NULL || strstr(name, "tuner") || \
 ++         strstr(name, "vbi"))
 ++          return(TC_PROBE_PATH_BKTR);
 ++        else if (strstr(name, "dsp") || strstr(name, "audio") || \
 ++         strstr(name, "music"))
 ++          return(TC_PROBE_PATH_OSS);
 ++        else
 ++          return(TC_PROBE_PATH_ABSPATH);
 ++# endif
 ++
 + 	  switch (major(fbuf.st_rdev)) {
 + #ifdef SYS_BSD
 + # ifdef __OpenBSD__
 +@@ -270,14 +281,6 @@
 +                   return(TC_PROBE_PATH_SUNAU);
 + 	      case 49: /* bktr */
 +                   return(TC_PROBE_PATH_BKTR);
 +-# endif
 +-# ifdef __FreeBSD__
 +-              case 4: /* acd */
 +-                  return(TC_PROBE_PATH_ABSPATH);
 +-              case 229: /* bktr */
 +-                  return(TC_PROBE_PATH_BKTR);
 +-              case 0: /* OSS */
 +-                  return(TC_PROBE_PATH_OSS);
 + # endif
 +               default: /* libdvdread uses "raw" disk devices here */
 +                   return(TC_PROBE_PATH_ABSPATH);
 
 --Multipart=_Sun__22_Oct_2006_23_57_45_+0400_1zO8jJJOoWFRuPbw--

From: "Chad M. Fraleigh" <chadf@bookcase.com>
To: Stanislav Sedov <stas@FreeBSD.org>
Cc: hendrik@scholz.net, bug-followup@FreeBSD.org
Subject: Re: ports/101450: multimedia/transcode: tcprobe broken for devfs
Date: Mon, 30 Oct 2006 21:39:11 -0500 (EST)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --0-919973560-1162262351=:40278
 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
 Content-Transfer-Encoding: QUOTED-PRINTABLE
 
 
 
 On Sun, 22 Oct 2006, Stanislav Sedov wrote:
 
 > Hi!
 >
 > Are you agreed with the patch attached?
 >
 > --=20
 > Stanislav Sedov          <stas@FreeBSD.org>        [[=F2=CF=D3=D3=C9=D1, =
 =ED=CF=D3=CB=D7=C1]]
 > PGP id: 0xEB269581       http://people.freebsd.org/~stas/stas.key.asc
 >
 
  =09It seems to work for me. However, I can see it may still cause=20
 other people problems if they use symlinks for those devices.
 
  =09An idea I had for this problem (which goes far beyond the scope of=20
 this bug) would be to introduce a general file descriptor ioctl to the OS=
 =20
 (unless it's been done). Basically it would be similar to the USB device=20
 descriptor which provides a type class (and sub-class). For the case of=20
 files/devices it could have a class and sub-class and/or feature flags=20
 (with in the context of the main class). Personally I think a sub-class=20
 may be unnecessary and less useful than a features list. But unlike a USB=
 =20
 descriptor values that are limited to 8-bits, the sub-class could be=20
 replaced with a 32 or 64 bit value that is mapped to a specific unique=20
 device or API type. And just for good measure allow for multiple class=20
 types for composite drivers that use a single device entry (if it's an=20
 issue).
 
  =09Here is a rough example of a hypothetical return structure:
 
  =09struct
  =09{
  =09=09unsigned long=09tid;=09=09/* optional specific type-id */
 #define=09FDTID_CMI8738=09=090x06519903L
 #define=09FDTID_OHCI=09=090x85398652L
 
  =09=09unsigned=09nclasses;
 
  =09=09/* Most significant/primary entry first for simple queries */
  =09=09struct
  =09=09{
  =09=09=09unsigned int=09fd_class;
 #define=09FDCLASS_AUDIO=090x00000003=09/* Audio I/O */
 #define=09FDCLASS_VIDEO=090x00000200=09/* Display (Capture?) */
 #define=09FDCLASS_NIC=090x00000081=09/* Network Card=09*/
 #define=09FDCLASS_FILE=090x00000028=09/* Regular File=09*/
 #define=09FDCLASS_NETWORK=090x00000004=09/* Socket */
 
  =09=09=09unsigned int=09fd_features;
 #define=09FDFEAT_AUDIO_WAVE=090x00000001=09/* Supports wave data */
 #define=09FDFEAT_AUDIO_PLAY=090x00000002=09/* Output */
 #define=09FDFEAT_AUDIO_RECORD=090x00000004=09/* Input */
 
 #define=09FDFEAT_VIDEO_FRAMEBUFFER=090x00000001
 #define=09FDFEAT_VIDEO_OVERLAY=09=090x00000002
 
 #define=09FDFEAT_FILE_LOCAL=090x00000001
 
 #define=09FDFEAT_NETWORK_STREAM=090x00000001
  =09=09} centries[1];
  =09} fdesc_descriptor_t;
 
 
 
 -Chad
 --0-919973560-1162262351=:40278--
State-Changed-From-To: open->suspended 
State-Changed-By: stas 
State-Changed-When: Wed Jan 3 11:28:56 UTC 2007 
State-Changed-Why:  
-  Suspend until a better solution will be implemented 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101450 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/101450: commit references a PR
Date: Wed,  3 Jan 2007 11:28:05 +0000 (UTC)

 stas        2007-01-03 11:27:48 UTC
 
   FreeBSD ports repository
 
   Modified files:
     multimedia/transcode Makefile 
   Added files:
     multimedia/transcode/files patch-import_ioaux.c 
   Log:
   - Fix detecting of device types
   
   Currently, this patch handles all devfs cases (it uses realpath to resolve
   symlinks). However, submitter supposes, that we should have a generic way
   to detect which device the file belongs to. I'll leave the PR in suspended
   state for a better solution come up.
   
   PR:             ports/101450
   Reported by:    Chad Fraleigh <chadf@bookcase.com>
   Approved by:    multimedia (ahze)
   
   Revision  Changes    Path
   1.81      +1 -1      ports/multimedia/transcode/Makefile
   1.1       +43 -0     ports/multimedia/transcode/files/patch-import_ioaux.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
Responsible-Changed-From-To: stas->freebsd-ports-bugs 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Sat Nov 5 04:11:20 UTC 2011 
Responsible-Changed-Why:  
- back to the heap 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101450 
State-Changed-From-To: suspended->closed 
State-Changed-By: miwi 
State-Changed-When: Sun Nov 6 15:49:28 UTC 2011 
State-Changed-Why:  
seems that was committed 3 Jan 2007. i close that here. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=101450 
>Unformatted:
