NetBSD Problem Report #35444

From root@kefren64.netbsd.ro  Fri Jan 19 09:08:31 2007
Return-Path: <root@kefren64.netbsd.ro>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 2812963BA82
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 19 Jan 2007 09:08:31 +0000 (UTC)
Message-Id: <20070119090824.4318C3D358@kefren64.netbsd.ro>
Date: Fri, 19 Jan 2007 11:08:24 +0200 (EET)
From: kefren@netbsd.ro
Reply-To: kefren@netbsd.ro
To: gnats-bugs@NetBSD.org
Subject: some mplayer patches
X-Send-Pr-Version: 3.95

>Number:         35444
>Category:       pkg
>Synopsis:       mplayer bad timeout select and play.channels number for oss
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 19 09:10:00 +0000 2007
>Closed-Date:    Tue Apr 24 12:35:23 +0000 2007
>Last-Modified:  Thu Nov 08 20:30:01 +0000 2007
>Originator:     Mihai Chelaru
>Release:        NetBSD 4.0_BETA2
>Organization:

>Environment:


System: NetBSD kefren64.netbsd.ro 4.0_BETA2 NetBSD 4.0_BETA2 (Kefren.MPACPI) #3: Thu Jan 18 20:56:55 EET 2007 root@kefren64.netbsd.ro:/usr/src/sys/arch/amd64/compile/Kefren.MPACPI amd64
Architecture: x86_64
Machine: amd64
>Description:

	patch is obvious. select is infinite and play channels number is not set.
>How-To-Repeat:

>Fix:

Index: multimedia/mplayer-share/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/mplayer-share/distinfo,v
retrieving revision 1.36
diff -u -r1.36 distinfo
--- multimedia/mplayer-share/distinfo	9 Jan 2007 14:49:33 -0000	1.36
+++ multimedia/mplayer-share/distinfo	19 Jan 2007 09:02:26 -0000
@@ -11,4 +11,6 @@
 SHA1 (patch-ba) = bdb20f4ead6f55c0847534b5b1f06ea865e438e6
 SHA1 (patch-bb) = 554ca2074716ada4f817f55be61e808e1dc5c93e
 SHA1 (patch-bc) = c073f6e5d2d71030346fda82ff3a1f474ad49c0f
+SHA1 (patch-bd) = 60125e4b46d16d8ac9f44db1f197a9aee4dae1ab
+SHA1 (patch-be) = 83ec8e47d98b629b4b7a768ea4ac592f0e1f8c13
 SHA1 (patch-tc) = e67443cec273d7aa168fb160e2409d2ce352a8bf
Index: multimedia/mplayer-share/patches/patch-bd
===================================================================
RCS file: multimedia/mplayer-share/patches/patch-bd
diff -N multimedia/mplayer-share/patches/patch-bd
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ multimedia/mplayer-share/patches/patch-bd	19 Jan 2007 09:02:26 -0000
@@ -0,0 +1,13 @@
+--- stream/udp.c.orig	2007-01-19 10:15:52.000000000 +0200
++++ stream/udp.c	2007-01-19 10:16:12.000000000 +0200
+@@ -157,8 +157,8 @@
+     }
+   }
+ 
+-  tv.tv_sec = 0;
+-  tv.tv_usec = (1 * 1000000);	/* 1 second timeout */
++  tv.tv_sec = 1;
++  tv.tv_usec = 0;	/* 1 second timeout */
+ 
+   FD_ZERO (&set);
+   FD_SET (socket_server_fd, &set);
Index: multimedia/mplayer-share/patches/patch-be
===================================================================
RCS file: multimedia/mplayer-share/patches/patch-be
diff -N multimedia/mplayer-share/patches/patch-be
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ multimedia/mplayer-share/patches/patch-be	19 Jan 2007 09:02:26 -0000
@@ -0,0 +1,55 @@
+--- libao2/ao_oss.c.orig	2006-10-23 01:32:25.000000000 +0300
++++ libao2/ao_oss.c	2007-01-19 10:57:13.000000000 +0200
+@@ -2,6 +2,9 @@
+ #include <stdlib.h>
+ 
+ #include <sys/ioctl.h>
++#ifdef __NetBSD__
++#include <sys/audioio.h>
++#endif
+ #include <unistd.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+@@ -92,6 +95,18 @@
+     return -1;
+ }
+ 
++#ifdef __NetBSD__
++int nbsd_set_play_channels(int audiod, int nchans)
++{
++	audio_info_t ainfo;
++
++	if (ioctl(audiod, AUDIO_GETINFO, &ainfo) == -1)
++		return -1;
++	ainfo.play.channels = nchans;
++	return ioctl(audiod, AUDIO_SETINFO, &ainfo);
++}
++#endif
++
+ static int oss2format(int format)
+ {
+     switch(format)
+@@ -332,7 +347,11 @@
+   if(format != AF_FORMAT_AC3) {
+     // We only use SNDCTL_DSP_CHANNELS for >2 channels, in case some drivers don't have it
+     if (ao_data.channels > 2) {
++#ifdef __NetBSD__
++      if ( nbsd_set_play_channels(audio_fd, ao_data.channels) == -1 ||
++#else
+       if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels) == -1 ||
++#endif
+ 	   ao_data.channels != channels ) {
+ 	mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_OSS_CantSetChans, channels);
+ 	return 0;
+@@ -440,7 +459,11 @@
+   ioctl (audio_fd, SNDCTL_DSP_SETFMT, &oss_format);
+   if(ao_data.format != AF_FORMAT_AC3) {
+     if (ao_data.channels > 2)
++#ifdef __NetBSD__
++      nbsd_set_play_channels(audio_fd, ao_data.channels);
++#else
+       ioctl (audio_fd, SNDCTL_DSP_CHANNELS, &ao_data.channels);
++#endif
+     else {
+       int c = ao_data.channels-1;
+       ioctl (audio_fd, SNDCTL_DSP_STEREO, &c);

>Release-Note:

>Audit-Trail:
From: Quentin Garnier <cube@cubidou.net>
To: gnats-bugs@NetBSD.org
Cc: kefren@netbsd.ro
Subject: Re: pkg/35444: some mplayer patches
Date: Fri, 19 Jan 2007 10:33:34 +0100

 --eGIacTpPLdQFYFVY
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 On Fri, Jan 19, 2007 at 09:10:00AM +0000, kefren@netbsd.ro wrote:
 > >Number:         35444
 > >Category:       pkg
 > >Synopsis:       mplayer bad timeout select and play.channels number for =
 oss
 [...]
 > >Release:        NetBSD 4.0_BETA2
 > >Organization:
 > =09
 > >Environment:
 > =09
 > =09
 > System: NetBSD kefren64.netbsd.ro 4.0_BETA2 NetBSD 4.0_BETA2 (Kefren.MPAC=
 PI) #3: Thu Jan 18 20:56:55 EET 2007 root@kefren64.netbsd.ro:/usr/src/sys/a=
 rch/amd64/compile/Kefren.MPACPI amd64
 > Architecture: x86_64
 > Machine: amd64
 > >Description:
 > =09
 > 	patch is obvious. select is infinite and play channels number is not set.

 The second one is wrong;  we should be compatible with the OSS ioctls,
 down to that detail.  If it indeed doesn't work, then it is a NetBSD bug,
 not a mplayer one.

 Does the sun audio output driver do the right thing for you in that area?

 --=20
 Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
 "You could have made it, spitting out benchmarks
 Owe it to yourself not to fail"
 Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

 --eGIacTpPLdQFYFVY
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (NetBSD)

 iQEVAwUBRbCQbtgoQloHrPnoAQJqXQf/TmRyFYKsRp8+e7Hq6icIJe4A+FUQ2g5q
 +QqZZq/r58aLsuj4xJJ4mQJlHCTqgZSUMkXSKDLwGdJWGZ63QlN65r/WLwWlqtwM
 cvncGoVFZb4QKg70PlK1M+bQgON5q1Igu8UFbeBhRyyYMhsp7NO1qOc71Lr2TZ1o
 i1+ZTAcgjGebUH0G+9NKHbOn4g0w253BMi5ROLTXP3z9aywkGa0VYbQkY/h30aHK
 3725wXMudwlGKzij2qY0m1ewNvzioRV6r6PkzBxr2K3C30ErreqVHrejILdj0AWF
 D69C6uQ9Z4jqW9sjeyZyTVxhpDsEDxm/j0VfAE9FSCwtcEalQQH5/Q==
 =inF7
 -----END PGP SIGNATURE-----

 --eGIacTpPLdQFYFVY--

From: "Mihai Chelaru" <mihai.chelaru@girsa.ro>
To: <gnats-bugs@NetBSD.org>, <pkg-manager@netbsd.org>,
	<gnats-admin@netbsd.org>, <pkgsrc-bugs@netbsd.org>,
	<kefren@netbsd.ro>
Cc: 
Subject: RE: pkg/35444: some mplayer patches
Date: Fri, 19 Jan 2007 13:07:11 +0200

  > -----Original Message-----
 > From: Quentin Garnier [mailto:cube@cubidou.net]=20
 > Subject: Re: pkg/35444: some mplayer patches
 >  The second one is wrong;  we should be compatible with the=20
 > OSS ioctls,
 >  down to that detail.  If it indeed doesn't work, then it is=20
 > a NetBSD bug,
 >  not a mplayer one.
 > =20

 It doesn't work here. Anything else than COMPAT_OSSAUDIO needed ?
 If not, I'll look into sys/compat/ossaudio.c tonight.

 >  Does the sun audio output driver do the right thing for you=20
 > in that area?

 Guess so, at least terminal output is OK.
 Currently I'm not near that computer, I'll report tonight.

 --=20
 Mihai

From: Matthias Drochner <drochner@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35444 CVS commit: pkgsrc/multimedia
Date: Fri, 23 Feb 2007 19:19:41 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	drochner
 Date:		Fri Feb 23 19:19:41 UTC 2007

 Modified Files:
 	pkgsrc/multimedia/mencoder: Makefile
 	pkgsrc/multimedia/mplayer: Makefile
 	pkgsrc/multimedia/mplayer-share: distinfo
 Added Files:
 	pkgsrc/multimedia/mplayer-share/patches: patch-bd

 Log Message:
 normalize timeval for select() timeout in udp stream handler, from
 Mihai Chelaru per PR pkg/35444
 bump PKGREVISIONs


 To generate a diff of this commit:
 cvs rdiff -r1.31 -r1.32 pkgsrc/multimedia/mencoder/Makefile
 cvs rdiff -r1.39 -r1.40 pkgsrc/multimedia/mplayer/Makefile
 cvs rdiff -r1.37 -r1.38 pkgsrc/multimedia/mplayer-share/distinfo
 cvs rdiff -r0 -r1.3 pkgsrc/multimedia/mplayer-share/patches/patch-bd

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Mihai Chelaru <kefren@netbsd.ro>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/35444
Date: Tue, 24 Apr 2007 15:13:07 +0300

 Please close this PR. That OSS was a bug on my system as far as I can tell and 
 the select thingie is fixed.

 -- 
 Mihai

State-Changed-From-To: open->closed
State-Changed-By: wiz@netbsd.org
State-Changed-When: Tue, 24 Apr 2007 12:35:23 +0000
State-Changed-Why:
One part fixed, other part locale problem. Thanks for the PR!


From: Matthias Drochner <drochner@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35444 CVS commit: src/lib/libossaudio
Date: Thu,  8 Nov 2007 20:27:25 +0000 (UTC)

 Module Name:	src
 Committed By:	drochner
 Date:		Thu Nov  8 20:27:25 UTC 2007

 Modified Files:
 	src/lib/libossaudio: ossaudio.c

 Log Message:
 Set the number of record and play channels individually -- currently
 we try to set both in one ioctl, to the same value, which fails if not
 both record and play direction support that many channels. (Having
 more play than record channels is common these days.)
 This does likely address part of the problem described in PR pkg/35444
 by Mihai Chelaru, and it helped Matthew R. Green about half a year
 ago -- see the thread in tech-misc in April.


 To generate a diff of this commit:
 cvs rdiff -r1.22 -r1.23 src/lib/libossaudio/ossaudio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.