From darius@chowder.gsoft.com.au  Wed Jul  2 18:02:37 2003
Return-Path: <darius@chowder.gsoft.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0F4C337B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Jul 2003 18:02:37 -0700 (PDT)
Received: from chowder.gsoft.com.au (chowder.gsoft.com.au [203.31.81.50])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BB45343F93
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Jul 2003 18:02:35 -0700 (PDT)
	(envelope-from darius@chowder.gsoft.com.au)
Received: from chowder.gsoft.com.au (localhost [127.0.0.1])
	by chowder.gsoft.com.au (8.12.9/8.12.9) with ESMTP id h6312Y1Q004641
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 3 Jul 2003 10:32:34 +0930 (CST)
	(envelope-from darius@chowder.gsoft.com.au)
Received: (from darius@localhost)
	by chowder.gsoft.com.au (8.12.9/8.12.9/Submit) id h6312XBr004640;
	Thu, 3 Jul 2003 10:32:33 +0930 (CST)
Message-Id: <200307030102.h6312XBr004640@chowder.gsoft.com.au>
Date: Thu, 3 Jul 2003 10:32:33 +0930 (CST)
From: "Daniel O'Connor" <doconnor@gsoft.com.au>
Reply-To: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Sound driver reports device busy and shows non-existant PID in sndstat with artsd
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54049
>Category:       kern
>Synopsis:       [sound] Sound driver reports device busy and shows non-existant PID in sndstat with artsd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 02 18:10:17 PDT 2003
>Closed-Date:    Wed Dec 28 19:21:25 GMT 2005
>Last-Modified:  Wed Dec 28 19:21:25 GMT 2005
>Originator:     Daniel O'Connor
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD chowder.gsoft.com.au 4.8-STABLE FreeBSD 4.8-STABLE #7: Wed Jun 25 20:29:38 CST 2003 darius@chowder.dons.net.au:/usr/src/sys/compile/CHOWDER i386

pcm0: <ESS Technology Maestro3> at io 0xdc00 irq 5 (4p/1r/0v channels duplex)

pcm0: <ESS Technology Maestro3> port 0xdc00-0xdcff mem 0xf6ffe000-0xf6ffffff irq 5 at device 3.0 on pci2
pcm0: <SigmaTel STAC9721/9723 ac97 codec>

>Description:
When restarting artsd to apply new changes, the sound driver appears to get confused and
reports a PID using the sound devices when that PID does not exist. Attempts to open the
sound devices result in EBUSY.

>How-To-Repeat:
- Install KDE :)
- Login, run artsd.
- /dev/sndstat shows arts using the device as expected.
- Play music.
- Run the 'Sound System' control centre item
- Toggle an option so that it will let you apply changes. Hit apply.
- Repeatedly cat /dev/sndstat and watch a new PID appear and use the device.
- Listen to the sound judder, then stop.
- Two dialogs pop up saying artsd cannot use the sound device as it's busy.
- cat /dev/sndstat again and note the PID is the same as previous.
- Run ps - the PID using the sound driver doesn't exist.

chowder 10:12] ~ >sysctl hw.snd
hw.snd.targetirqrate: 32
hw.snd.report_soft_formats: 1
hw.snd.verbose: 2
hw.snd.maxautovchans: 0
hw.snd.pcm0.buffersize: 4096
hw.snd.pcm0.vchans: 0
hw.snd.pcm0.hwvol_step: 5
hw.snd.pcm0.hwvol_mixer: vol

[chowder 10:13] ~ >cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <ESS Technology Maestro3> at io 0xdc00 irq 5 (4p/1r/0v channels duplex)
        [pcm0:play:0]: spd 44100, fmt 0x10000010, flags 00007030, pid 4404
	interrupts 2217, underruns 0, ready 57344
	{userland} -> feeder_root(0x10000010) -> {hardware}
	[pcm0:play:1]: spd 0, fmt 0x00000000/0x00000008, flags 00000000
	interrupts 0, underruns 0, ready 0
	{userland} -> feeder_root(0x00000000) -> {hardware}
	[pcm0:play:2]: spd 0, fmt 0x00000000/0x00000008, flags 00000000
	interrupts 0, underruns 0, ready 0
	{userland} -> feeder_root(0x00000000) -> {hardware}
	[pcm0:play:3]: spd 0, fmt 0x00000000/0x00000008, flags 00000000
	interrupts 0, underruns 0, ready 0
	{userland} -> feeder_root(0x00000000) -> {hardware}
	[pcm0:record:0]: spd 44100, fmt 0x10000010, flags 00007030, pid 4404
	interrupts 2217, overruns 0, hfree 4096, sfree 57344
	{hardware} -> feeder_root(0x10000010) -> {userland}

[chowder 10:13] ~ >ps -lawwwp 4404
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
   1007  4404   416   0   2  0  8048 6140 poll   S     ??    0:01.15 artsd -F 14 -S 4096 -d -n -s 5 -m artsmessage -l 3 -f
													
[ restart artsd ]

[chowder 10:14] ~ >cat /dev/sndstat
FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <ESS Technology Maestro3> at io 0xdc00 irq 5 (4p/1r/0v channels duplex)
        [pcm0:play:0]: spd 44100, fmt 0x10000010, flags 00000000
        interrupts 0, underruns 0, ready 0
        {userland} -> feeder_root(0x10000010) -> {hardware}
        [pcm0:play:1]: spd 44100, fmt 0x10000010, flags 00007030, pid 4424
        interrupts 15, underruns 0, ready 224
        {userland} -> feeder_root(0x10000010) -> {hardware}
        [pcm0:play:2]: spd 0, fmt 0x00000000/0x00000008, flags 00000000
        interrupts 0, underruns 0, ready 0
        {userland} -> feeder_root(0x00000000) -> {hardware}
        [pcm0:play:3]: spd 0, fmt 0x00000000/0x00000008, flags 00000000
        interrupts 0, underruns 0, ready 0
        {userland} -> feeder_root(0x00000000) -> {hardware}
        [pcm0:record:0]: spd 44100, fmt 0x10000010, flags 00007020, pid 4424
        interrupts 15, overruns 0, hfree 4096, sfree 5312
        {hardware} -> feeder_root(0x10000010) -> {userland}

[chowder 10:16] ~ >ps -lawwwp 4424
  UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND

[chowder 10:17] ~ >ps -axw| grep art
  399  ??  I      0:00.01 /bin/sh /usr/local/bin/startkde
 4427  ??  S      0:09.70 artsd -F 14 -S 4096 -d -n -s 5 -m artsmessage -l 3 -f

[ Here is is running with the null driver ]

[chowder 10:16] ~ >fstat /dev/dsp0
USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W NAME

>Fix:

The vchans remain unbusy, so I can use those as a work around, or reboot.
(Although the record channel remains glued busy)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sound 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 21:44:24 PDT 2003 
Responsible-Changed-Why:  
Over to sound maintainers 

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

From: Michael Nottebrock <michaelnottebrock@gmx.net>
To: freebsd-gnats-submit@FreeBSD.org, doconnor@gsoft.com.au
Cc:  
Subject: Re: kern/54049: Sound driver reports device busy and shows non-existant PID in sndstat with artsd
Date: Sat, 28 Feb 2004 11:33:54 +0100

 --Boundary-02=_W6GQAKRA2d7+Ihh
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 arts was recently updated to version 1.2.0, are you still seeing this?
 
 =2D-=20
    ,_,   | Michael Nottebrock               | lofi@freebsd.org
  (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
    \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
 
 --Boundary-02=_W6GQAKRA2d7+Ihh
 Content-Type: application/pgp-signature
 Content-Description: signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iD8DBQBAQG6WXhc68WspdLARAgwcAJ9DYFb3fVBf+LLrDzDPINlKXaeafACgjRf8
 m0fWcGAjRm5SefqVVsOGCpU=
 =YRfl
 -----END PGP SIGNATURE-----
 
 --Boundary-02=_W6GQAKRA2d7+Ihh--

From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: Michael Nottebrock <michaelnottebrock@gmx.net>,
	freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/54049: Sound driver reports device busy and shows non-existant PID in sndstat with artsd
Date: Sun, 29 Feb 2004 13:36:15 +1030

 On Saturday 28 February 2004 21:03, Michael Nottebrock wrote:
 > arts was recently updated to version 1.2.0, are you still seeing this?
 
 I just did a portupgrade artsd after a cvsup of ports and now I get..
 [inchoate 13:31] /usr/ports/audio/arts >artsd -l 0
 artsd version is 1.2.0
 
 GThread-ERROR **: file gthread-posix.c: line 135 (): error 'No such process' 
 during 'pthread_getschedparam (pthread_self(), &policy, &sched)'
 aborting...
 zsh: abort      artsd -l 0
 
 (!)
 Help :)
 
 The gthread thing looked like a possible glib problem so I upgraded that but 
 no change inb behaviour..
 
 -- 
 Daniel O'Connor software and network engineer
 for Genesis Software - http://www.gsoft.com.au
 "The nice thing about standards is that there
 are so many of them to choose from."
   -- Andrew Tanenbaum
 GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5
 

From: Michael Nottebrock <michaelnottebrock@gmx.net>
To: "Daniel O'Connor" <doconnor@gsoft.com.au>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/54049: Sound driver reports device busy and shows non-existant PID in sndstat with artsd
Date: Sun, 29 Feb 2004 04:47:40 +0100

 On Sunday 29 February 2004 04:06, Daniel O'Connor wrote:
 > GThread-ERROR **: file gthread-posix.c: line 135 (): error 'No such
 > process' during 'pthread_getschedparam (pthread_self(), &policy, &sched)'
 > aborting...
 
 Are you using -CURRENT? If so, you might have applications linking to 
 different threads libs which could cause this. There are several threads all 
 over the -current and -ports mailing lists about this and also an entry 
 in /usr/src/UPDATING.

From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: Michael Nottebrock <michaelnottebrock@gmx.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/54049: Sound driver reports device busy and shows non-existant PID in sndstat with artsd
Date: Mon, 1 Mar 2004 09:14:32 +1030

 On Sunday 29 February 2004 14:17, Michael Nottebrock wrote:
 > On Sunday 29 February 2004 04:06, Daniel O'Connor wrote:
 > > GThread-ERROR **: file gthread-posix.c: line 135 (): error 'No such
 > > process' during 'pthread_getschedparam (pthread_self(), &policy, &sched)'
 > > aborting...
 >
 > Are you using -CURRENT? If so, you might have applications linking to
 > different threads libs which could cause this. There are several threads
 > all over the -current and -ports mailing lists about this and also an entry
 > in /usr/src/UPDATING.
 
 Ahh, I thought I would avoid that problem, but I see that I haven't..
 
 My libmap.conf is now ->
 libpthread.so.1         libc_r.so.5
 libpthread.so           libc_r.so
 
 libc_r.so.5             libc_r.so.5
 libc_r.so               libc_r.so
 
 The problem I had with reporting a non-existant PID doesn't occur now..
 I guess this is really a work around not a proper fix though.
 
 -- 
 Daniel O'Connor software and network engineer
 for Genesis Software - http://www.gsoft.com.au
 "The nice thing about standards is that there
 are so many of them to choose from."
   -- Andrew Tanenbaum
 GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5
 

From: "Daniel O'Connor" <doconnor@gsoft.com.au>
To: Michael Nottebrock <michaelnottebrock@gmx.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/54049: Sound driver reports device busy and shows non-existant PID in sndstat with artsd
Date: Wed, 3 Mar 2004 17:25:01 +1030

 On Sun, 29 Feb 2004 14:17, Michael Nottebrock wrote:
 > On Sunday 29 February 2004 04:06, Daniel O'Connor wrote:
 > > GThread-ERROR **: file gthread-posix.c: line 135 (): error 'No such
 > > process' during 'pthread_getschedparam (pthread_self(), &policy, &sched)'
 > > aborting...
 >
 > Are you using -CURRENT? If so, you might have applications linking to
 > different threads libs which could cause this. There are several threads
 > all over the -current and -ports mailing lists about this and also an entry
 > in /usr/src/UPDATING.
 
 OK I stuffed around with libmap.conf so I am good to go.. (The method of the 
 thread change does seem rather short sighted.. I believe if you have any 
 libraries built before the change that use threads and then build a new port 
 which uses it, the resulting binary won't work - argh..)
 
 The problem seems fixed now.
 I seem to reasonably often get a device busy message on logging in though, if 
 I kill artsd it comes up properly..
 
 -- 
 Daniel O'Connor software and network engineer
 for Genesis Software - http://www.gsoft.com.au
 "The nice thing about standards is that there
 are so many of them to choose from."
   -- Andrew Tanenbaum
 GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5
State-Changed-From-To: open->closed 
State-Changed-By: netchild 
State-Changed-When: Wed Dec 28 19:21:16 UTC 2005 
State-Changed-Why:  
Seems to be fixed. 

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