From nobody@FreeBSD.org  Thu Jan 17 20:42:55 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BFB1F16A46B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Jan 2008 20:42:55 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id D191313C448
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Jan 2008 20:42:55 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0HKfYpn027252
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Jan 2008 20:41:34 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m0HKfY2E027251;
	Thu, 17 Jan 2008 20:41:34 GMT
	(envelope-from nobody)
Message-Id: <200801172041.m0HKfY2E027251@www.freebsd.org>
Date: Thu, 17 Jan 2008 20:41:34 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [sound] Can not record anything with emu10k1 on 7.0-PRERELEASE (Invalid argument)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         119759
>Category:       kern
>Synopsis:       [sound] [snd_emu10k1] [regression] Can not record anything with emu10k1 on 7.0-PRERELEASE (Invalid argument)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-multimedia
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 17 20:50:01 UTC 2008
>Closed-Date:    
>Last-Modified:  Mon Jul 27 09:05:26 UTC 2009
>Originator:     Yuri
>Release:        7.0-PRERELEASE
>Organization:
n/a
>Environment:
FreeBSD xxx.xxx.xxx 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #0: Fri Jan  4 16:25:43 PST 2008     yuri@xxx.xxx.xxx:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
When I am trying to record something using rawrec-0.9.991:
/usr/local/bin/rawrec myfile.raw
I get an error:
rawrec: read syscall of dsp device failed: Invalid argument

Same with cp:
cp /dev/dsp myfile.raw
cp: /dev/dsp: Invalid argument

It used to work in 6.x.

Yuri
>How-To-Repeat:
1. Have EMU10K1 based card
2. cp /dev/dsp myfile.raw
3. observe an error
>Fix:
n/a

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-multimedia 
Responsible-Changed-By: remko 
Responsible-Changed-When: Thu Jan 17 21:08:42 UTC 2008 
Responsible-Changed-Why:  
reassign to multimedia team 

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

From: Yuri <yuri@tsoft.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/119759: [emu10k1] Can not record anything with emu10k1 on
 7.0-PRERELEASE (Invalid argument) (regression)
Date: Sat, 02 Feb 2008 12:54:36 -0800

 Now recording works for me with this kernel:
 FreeBSD 7.0-PRERELEASE #1: Thu Jan 24 19:51:52 PST 2008
 
 Not sure if the original issue was/is intermittent or it is really gone.
 
 Yuri
 

From: Mark Kane <mark@mkproductions.org>
To: bug-followup@FreeBSD.org, yuri@tsoft.com
Cc:  
Subject: Re: kern/119759: [emu10k1] Can not record anything with emu10k1 on
 7.0-PRERELEASE (Invalid argument) (regression)
Date: Sat, 16 Feb 2008 18:21:13 -0600

 Hi.
 
 I have been experiencing this problem as well with emu10k1 since moving
 from 6.x to 7.x.
 
 I've been watching this PR and saw Yuri's latest message that an
 updated kernel allowed him to record again. I just updated my system to
 RELENG_7 as of yesterday however the issue still persists for me.
 
 I get the same errors when using rawrec/cp and Audacity does not record
 properly either. Audacity outputs lots of these to the terminal:
 
 PortAudio: read interrupted!
 PortAudio: read interrupted!
 PortAudio: read interrupted!
 
 Thanks in advance,
 
 -Mark
 
 FreeBSD amd645200.localhost 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #1:
 Fri Feb 15 16:29:55 CST 2008
 mixx941@amd645200.localhost:/usr/obj/usr/src/sys/AMD645200  amd64
 
 FreeBSD Audio Driver (newpcm: 64bit 2007061600/amd64)
 Installed devices:
 pcm0: <Creative Audigy 2 (EMU10K2)> at io 0xdc00 irq 16  [MPSAFE]
 (8p:1v/2r:1v channels duplex default)

From: Yuri <yuri@tsoft.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/119759: [emu10k1] Can not record anything with emu10k1 on
 7.0-PRERELEASE (Invalid argument) (regression)
Date: Tue, 19 Feb 2008 12:13:18 -0800

 Now I tried again and it doesn't work again for me.
 Kernel: 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #4: Tue Feb 19 08:18:11 
 PST 2008
 Seems the problem is intermittent or dependent on the version of 7.0.
 
 Relevant dmesg messages:
 pcm0: <TriTech TR28602 AC97 Codec>
 pcm0: [ITHREAD]
 at the time of failure:
 pcm0:record:dsp0.r1: record interrupt timeout, channel dead
 
 Sound recording is a major function and emu10k1 is probably a very (if 
 not most) common card.
 
 Is there any more debug messaging that could be turned on for this driver?
 

From: Mark Kane <mark@mkproductions.org>
To: Yuri <yuri@tsoft.com>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/119759: [emu10k1] Can not record anything with emu10k1 on
 7.0-PRERELEASE (Invalid argument) (regression)
Date: Tue, 19 Feb 2008 15:55:58 -0600

 On Tue, Feb 19, 2008, at 20:20:03 GMT, Yuri wrote:
 >  Now I tried again and it doesn't work again for me.
 >  Kernel: 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #4: Tue Feb 19
 > 08:18:11 PST 2008
 >  Seems the problem is intermittent or dependent on the version of 7.0.
 >  
 >  Relevant dmesg messages:
 >  pcm0: <TriTech TR28602 AC97 Codec>
 >  pcm0: [ITHREAD]
 >  at the time of failure:
 >  pcm0:record:dsp0.r1: record interrupt timeout, channel dead
 >  
 >  Sound recording is a major function and emu10k1 is probably a very
 > (if not most) common card.
 >  
 >  Is there any more debug messaging that could be turned on for this
 > driver? 
 
 I was just writing another reply to the PR with some additional
 information (mainly the dmesg messages and a workaround) but I will
 answer in reply to you here instead.
 
 Yesterday I came across kern/118546 and tried the suggestion of setting
 "dev.pcm.0.rec.vchans" to 0 which appears to have fixed the recording
 problem for me here on emu10k1. When set to 1 (the default) it does not
 record properly.
 
 I tried to adapt the patch from snd_ich in kern/118546 and in the
 commit that fixed the problem for that driver to emu10k1 but I am not
 very experienced in C yet so I did not have much luck.
 
 So for now, "sysctl dev.pcm.0.rec.vchans=0" allows recording to work
 again for me on an Audigy 2 Platinum with emu10k1 but a proper fix
 would be great too.
 
 Thanks!
 
 -Mark
>Unformatted:
