From owner-freebsd-multimedia Mon Aug 20 0:55:26 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from dell.dannyland.org (dsl092-007-150.sfo1.dsl.speakeasy.net [66.92.7.150]) by hub.freebsd.org (Postfix) with ESMTP id E9B9A37B40C for ; Mon, 20 Aug 2001 00:55:22 -0700 (PDT) (envelope-from dannyman@toldme.com) Received: by dell.dannyland.org (Postfix, from userid 1001) id 72A055C5B; Mon, 20 Aug 2001 00:55:24 -0700 (PDT) Date: Mon, 20 Aug 2001 00:55:24 -0700 From: dannyman To: freebsd-multimedia@freebsd.org Subject: radio cards Message-ID: <20010820005524.R2048@toldme.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Anyone ever play with a cool radio tuner card? I'd like to be able to tune to a station, and dump a program in to an au, maybe piping it in to an mp3/ogg encoder, so that I can listen to my favorite NPR and other programs on my own schedule. Basically, my own little radio TiVo. :) TIA, -danny -- http://dannyman.toldme.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 1:49:22 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from beaver.core.de (beaver.core.de [212.44.167.2]) by hub.freebsd.org (Postfix) with ESMTP id C54E937B410 for ; Mon, 20 Aug 2001 01:49:19 -0700 (PDT) (envelope-from coto@core.de) Received: from beaver.core.de (beaver.core.de [212.44.167.2]) by beaver.core.de (8.11.5/8.11.5) with ESMTP id f7K8n8d07036; Mon, 20 Aug 2001 10:49:09 +0200 (CEST) Date: Mon, 20 Aug 2001 10:49:08 +0200 (CEST) From: Thomas Runge To: dannyman Cc: Subject: Re: radio cards In-Reply-To: <20010820005524.R2048@toldme.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 20 Aug 2001, dannyman wrote: > Anyone ever play with a cool radio tuner card? I'd like to be able to > tune to a station, and dump a program in to an au, maybe piping it in to > an mp3/ogg encoder, so that I can listen to my favorite NPR and other > programs on my own schedule. Basically, my own little radio TiVo. :) Most of us (if not all) use a Hauppauge WinTV card for FM, especially a WinTV/radio, which has a FM tuner onboard. The driver fully supports that tuner and there are at least two radio programs, that may help you. One is a curses based application and one is Motif based. I don't know, whether the former can capture data, but at least you can use a third-party-sample-software. The Motif-based application can capture to a file (supporting all formats available by sox), but does no streaming. You'll find more information here: http://vulture.dmem.strath.ac.uk/bt848/ -- Tom To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 5:26:41 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from kumr.lns.com (kumr.lns.com [140.174.7.1]) by hub.freebsd.org (Postfix) with ESMTP id 200D237B63E for ; Mon, 20 Aug 2001 05:26:37 -0700 (PDT) (envelope-from pozar@kumr.lns.com) Received: (from pozar@localhost) by kumr.lns.com (8.11.4/8.9.3) id f7KCQ8l67307; Mon, 20 Aug 2001 05:26:08 -0700 (PDT) (envelope-from pozar) Date: Mon, 20 Aug 2001 05:26:08 -0700 From: Tim Pozar To: dannyman Cc: freebsd-multimedia@FreeBSD.ORG Subject: Re: radio cards Message-ID: <20010820052607.A66465@lns.com> References: <20010820005524.R2048@toldme.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010820005524.R2048@toldme.com>; from dannyman@toldme.com on Mon, Aug 20, 2001 at 12:55:24AM -0700 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Aug 20, 2001 at 12:55:24AM -0700, dannyman wrote: > Anyone ever play with a cool radio tuner card? I'd like to be able to > tune to a station, and dump a program in to an au, maybe piping it in to > an mp3/ogg encoder, so that I can listen to my favorite NPR and other > programs on my own schedule. Basically, my own little radio TiVo. :) I use the Hauppauge WinTV/FM card for exactly this. For my commercial clients, I use it for off-air reception -> streaming and for my home use I set it up to archive various radio shows during the day (ie. "Stern - Infinity", "Fresh Air - NPR", "Utah Philips - KPFA", etc.). You will need to run the output into a sound card. An Ensoniq card will set you back about $25 and will sound fine. For the actuall software, I wrote a number of scripts and programs that will do the streaming and archiving. You can check out some of them at: http://www.lns.com/papers Tim -- Snail: Tim Pozar / LNS / 1978 45th Ave / San Francisco CA 94116 / USA POTS: +1 415 665 3790 Radio: KC6GNJ / KAE6247 "It's a damn poor mind that can only think of one way to spell a word." - Andrew Jackson "What is wanted is not the will to believe, but the will to find out, which is the exact opposite." - Bertrand Russell, "Skeptical_Essays" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 10:38:49 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from vulture.dmem.strath.ac.uk (vulture.dmem.strath.ac.uk [130.159.232.158]) by hub.freebsd.org (Postfix) with ESMTP id 9ADD037B406 for ; Mon, 20 Aug 2001 10:38:45 -0700 (PDT) (envelope-from roger@cs.strath.ac.uk) Received: from cs.strath.ac.uk (posh [130.159.202.3]) by vulture.dmem.strath.ac.uk (8.9.3/8.9.3) with ESMTP id SAA79217 for ; Mon, 20 Aug 2001 18:38:43 +0100 (BST) (envelope-from roger@cs.strath.ac.uk) Message-ID: <3B8149C1.567BBEF2@cs.strath.ac.uk> Date: Mon, 20 Aug 2001 18:32:49 +0100 From: Roger Hardiman Organization: University of Strathclyde X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: multimedia@freebsd.org Subject: H323 GnomeMeeting (NetMeeting clone) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi all, Some of you make like to know that GnomeMeeting 0.10 has just been released. (and I've just committed an updated port in /net/gnomemeeting). GnomeMeeting is a H323 Video Conferencing program and is more or less a clone of NetMeeting. It supports two way audio and two way video (assuming you have a camera and a Bt848/Bt878 card or a Meteor grabber card) and works with lots of commercial Video Confeencing apps which support the H323 protocol. Take a look at www.gnomemeeting.org for some screen shots. Roger To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 20:46: 7 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from temphost.dragondata.com (temphost.dragondata.com [63.167.131.128]) by hub.freebsd.org (Postfix) with ESMTP id 7596237B408 for ; Mon, 20 Aug 2001 20:46:04 -0700 (PDT) (envelope-from toasty@temphost.dragondata.com) Received: (from toasty@localhost) by temphost.dragondata.com (8.11.3/8.11.3) id f7L3jrO28556 for multimedia@freebsd.org; Mon, 20 Aug 2001 22:45:53 -0500 (CDT) (envelope-from toasty) From: Kevin Day Message-Id: <200108210345.f7L3jrO28556@temphost.dragondata.com> Subject: bktr capture utility To: multimedia@freebsd.org Date: Mon, 20 Aug 2001 22:45:53 -0500 (CDT) X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org A long long while ago, someone on this list gave me a pointer to a simple (~100 line) C program that connected to the bktr driver and stored a single frame out as a JPG or TGA or something. Does anyone know where this utility is, or what it's called? I know I could write something like this, but the only "documentation" i've been able to find for the bktr driver is fxtv, which is kinda large to start with. (It may have been Amancio or Randal Hopper who gave this to me, but I can't find anything in my old mail) I've searched my hard drives and mailing lis archives, no luck... Somehone help? -- Kevin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 20:51:19 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from dorothy.hentschel.net (w002.z064221160.smf-ca.dsl.cnc.net [64.221.160.2]) by hub.freebsd.org (Postfix) with ESMTP id 8261137B405 for ; Mon, 20 Aug 2001 20:51:11 -0700 (PDT) (envelope-from thomas@hentschel.net) Received: from hentschel.net (user@falcon.home.hentschel.net [192.168.1.2]) by dorothy.hentschel.net (8.8.8/8.8.8) with ESMTP id UAA15971; Mon, 20 Aug 2001 20:48:27 -0700 (PDT) (envelope-from thomas@hentschel.net) Message-Id: <200108210348.UAA15971@dorothy.hentschel.net> Date: Mon, 20 Aug 2001 20:54:39 -0700 (PDT) From: thomas@hentschel.net Subject: Re: bktr capture utility To: Kevin Day Cc: multimedia@FreeBSD.ORG In-Reply-To: <200108210345.f7L3jrO28556@temphost.dragondata.com> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 20 Aug, Kevin Day wrote: > > A long long while ago, someone on this list gave me a pointer to a simple > (~100 line) C program that connected to the bktr driver and stored a single > frame out as a JPG or TGA or something. Does anyone know where this utility > is, or what it's called? You probably mean Thomas Runge's bktr2jpeg, it appears to be now at http://core.de/~coto/private.html, the old links are death... HTH, -Th To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 22: 5:36 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from temphost.dragondata.com (temphost.dragondata.com [63.167.131.128]) by hub.freebsd.org (Postfix) with ESMTP id 495C537B401 for ; Mon, 20 Aug 2001 22:05:33 -0700 (PDT) (envelope-from toasty@temphost.dragondata.com) Received: (from toasty@localhost) by temphost.dragondata.com (8.11.3/8.11.3) id f7L54pd34225; Tue, 21 Aug 2001 00:04:51 -0500 (CDT) (envelope-from toasty) From: Kevin Day Message-Id: <200108210504.f7L54pd34225@temphost.dragondata.com> Subject: Re: bktr capture utility To: thomas@hentschel.net Date: Tue, 21 Aug 2001 00:04:50 -0500 (CDT) Cc: multimedia@FreeBSD.ORG In-Reply-To: from "thomas@hentschel.net" at Aug 20, 2001 08:54:39 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > On 20 Aug, Kevin Day wrote: > > > > A long long while ago, someone on this list gave me a pointer to a simple > > (~100 line) C program that connected to the bktr driver and stored a single > > frame out as a JPG or TGA or something. Does anyone know where this utility > > is, or what it's called? > > You probably mean Thomas Runge's bktr2jpeg, it appears to be now at > http://core.de/~coto/private.html, the old links are death... > > HTH, > > -Th Yes! this is it! Thanks! Anyone want me to make a port of this? :) Kevin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 22: 7:32 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from mta05-svc.ntlworld.com (mta05-svc.ntlworld.com [62.253.162.45]) by hub.freebsd.org (Postfix) with ESMTP id 13F6337B401 for ; Mon, 20 Aug 2001 22:07:29 -0700 (PDT) (envelope-from roger@cs.strath.ac.uk) Received: from bfg ([62.253.12.112]) by mta05-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20010821050727.SDIC20588.mta05-svc.ntlworld.com@bfg>; Tue, 21 Aug 2001 06:07:27 +0100 Message-ID: <00c701c129ff$65f2e120$0200000a@bfg> From: "Roger Hardiman" To: "Kevin Day" , References: <200108210345.f7L3jrO28556@temphost.dragondata.com> Subject: Re: bktr capture utility Date: Tue, 21 Aug 2001 06:09:03 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Have a look at http://telepresence.dmem.strath.ac.uk/bktr Roger ----- Original Message ----- From: "Kevin Day" To: Sent: Tuesday, August 21, 2001 4:45 AM Subject: bktr capture utility > > A long long while ago, someone on this list gave me a pointer to a simple > (~100 line) C program that connected to the bktr driver and stored a single > frame out as a JPG or TGA or something. Does anyone know where this utility > is, or what it's called? > > I know I could write something like this, but the only "documentation" i've > been able to find for the bktr driver is fxtv, which is kinda large to start > with. > > (It may have been Amancio or Randal Hopper who gave this to me, but I can't > find anything in my old mail) > > I've searched my hard drives and mailing lis archives, no luck... Somehone > help? > > -- Kevin > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-multimedia" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 22: 9:58 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from dorothy.hentschel.net (w002.z064221160.smf-ca.dsl.cnc.net [64.221.160.2]) by hub.freebsd.org (Postfix) with ESMTP id 13E7437B408 for ; Mon, 20 Aug 2001 22:09:56 -0700 (PDT) (envelope-from thomas@hentschel.net) Received: from hentschel.net (user@falcon.home.hentschel.net [192.168.1.2]) by dorothy.hentschel.net (8.8.8/8.8.8) with ESMTP id WAA16963; Mon, 20 Aug 2001 22:06:59 -0700 (PDT) (envelope-from thomas@hentschel.net) Message-Id: <200108210506.WAA16963@dorothy.hentschel.net> Date: Mon, 20 Aug 2001 22:13:11 -0700 (PDT) From: thomas@hentschel.net Subject: Re: bktr capture utility To: Roger Hardiman Cc: Kevin Day , multimedia@FreeBSD.ORG In-Reply-To: <00c701c129ff$65f2e120$0200000a@bfg> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hmm, the link gives a 404... -Th On 21 Aug, Roger Hardiman wrote: > Have a look at > http://telepresence.dmem.strath.ac.uk/bktr > > > > Roger > > ----- Original Message ----- > From: "Kevin Day" > To: > Sent: Tuesday, August 21, 2001 4:45 AM > Subject: bktr capture utility > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Mon Aug 20 22:16:25 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from mta05-svc.ntlworld.com (mta05-svc.ntlworld.com [62.253.162.45]) by hub.freebsd.org (Postfix) with ESMTP id 56DA137B406 for ; Mon, 20 Aug 2001 22:16:23 -0700 (PDT) (envelope-from roger@cs.strath.ac.uk) Received: from bfg ([62.253.12.112]) by mta05-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20010821051622.SGMU20588.mta05-svc.ntlworld.com@bfg>; Tue, 21 Aug 2001 06:16:22 +0100 Message-ID: <00dd01c12a00$a47e6d00$0200000a@bfg> From: "Roger Hardiman" To: Cc: "Kevin Day" , References: <200108210506.WAA16963@dorothy.hentschel.net> Subject: Re: bktr capture utility Date: Tue, 21 Aug 2001 06:17:57 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Oops, http://telepresence.dmem.strath.ac.uk/bt848 Roger To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Tue Aug 21 8:46:11 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts5-srv.bellnexxia.net (tomts5.bellnexxia.net [209.226.175.25]) by hub.freebsd.org (Postfix) with ESMTP id 5A24D37B401 for ; Tue, 21 Aug 2001 08:46:03 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.180]) by tomts5-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010821154602.HYUH10424.tomts5-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Tue, 21 Aug 2001 11:46:02 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 811E518BC for ; Tue, 21 Aug 2001 11:48:20 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 093C420AFC; Tue, 21 Aug 2001 11:47:03 -0400 (EDT) Date: Tue, 21 Aug 2001 11:47:03 -0400 From: The Anarcat To: freebsd-multimedia@freebsd.org Subject: precisions of pcm driver problems and update of rec program Message-ID: <20010821114703.B5114@shall.anarcat.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p4qYPpj5QlsIQJ0K" Content-Disposition: inline User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --p4qYPpj5QlsIQJ0K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi. I have made a few more updates to my rec program, since my last post (aug 15). The program now fully conforms (I think) to the new OSS API as described in the PDF. Display has been improved, a play mode has been implemented, and a few other things has been changed (see the ChangeLog). Now, I still have a few problems, and a few answers. I will include here my BUGS file and comment on it. --- 8< cut here 8< --- BUGS file Bugs in the rec program. Issues are classified by order of importance, higher up. Driver issues (?) ================= Are these issues from the pcm driver or the app? 1) -r 110 make ioctl SNDCTL_DSP_SPEED fail with EINVAL instead of correcting it ("Also note that this call rarely returns an error (-1). Getting an OK result doesn't mean that the requested sampling rate was accepted. The value returned in the argument needs to be checked." - oss.pdf) 2) core dumps if -c 0. This is because the driver doesn't switch to a proper (eg. 1 or 2) value when given such insane values. I digged a bit in the driver code and I found a CHANNEL_SETSPEED macro (? in channel.c:1126) that seems to be the guilty party. I can't find the source of this macro. 3) dsp vs dspW issues it seems that the data is "filled" when in RAW, sample: 00000000: 43fe 8efe 37fe 9dfe 3ffe 90fe 3efe 8dfe C...7...?...>... 00000010: 3dfe 97fe 44fe 93fe 31fe 95fe 48fe 9efe =...D...1...H... 00000020: 38fe 95fe 3dfe 94fe 36fe 9bfe 37fe 8afe 8...=...6...7... This does not happen in the new version, when using -d /dev/dsp and -w, but still happens with -d dspW and -w, which is odd. 4) it seems we can independantly specify dsp and dspW (ie dsp can record 8 bit?), it's just that dspW scraps 16 bit output (!!) App issues ========== I think these are apps isues. 1) check signed issues when recording in AFMT_S16_LE (unsigned char vs signed format), this might be the cause of our lovely "flanger" effect 2) -c n where n > 2 will likely not work. 3) we assume that AFMT_U8 is 8 and that AFMT_S16_LE is 16. 4) we do not always record PCM signed linear 2's complement as claimed because of a few things: a) /dev/dsp vs /dev/audio (linear 2's complement vs mu-law) b) /dev/dsp vs /dev/dspW (unsigned vs signed) "(/dev/dsp used 8-bit unsigned, /dev/dspW uses 16-bit signed little-endian and /dev/audio uses mu-law)" - oss.pdf, p. 29 5) we might not always record full samples ((size / 8) * channels) because of customizable bufsize (solved) and interrupts (not solved) 6) AIFF mode has not been tested with this year's changes 7) Recording AIFF files with .aif file extension records nothing 8) Recording AIFF files seems to be buggy altogether: 3 time the size 9) time spec calculations are invalid in AIFF --- 8< cut here 8< --- Another thing... Is really dsp unsigned and dspW signed, as per the OSS API? I guess that using dsp in 16 bits will automatically put it in signed mode, but I have that flanger effect that I didn't have before here, it might be due to my hardware though. Note that: FreeBSD Audio Driver (newpcm) Aug 1 2001 18:54:11 Installed devices: pcm0: at io 0x220 irq 5 drq 1:5 (1p/1r channels duplex) Please test at will and comment. I think I'm almost there! :) Oh, and note that the AIFF mode is in the way of being deprecated. I have no time test and adapt to the massive latest changes. I request help here. I might work on this once the "raw" version is stable. A. --p4qYPpj5QlsIQJ0K Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjuCgnUACgkQttcWHAnWiGfE5ACfRtMjaie/506zcK3iolRdWqVr MJYAn15Yg99oRCf4hzi7dkUE2+FHlo+4 =inBE -----END PGP SIGNATURE----- --p4qYPpj5QlsIQJ0K-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Tue Aug 21 9:34:51 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from cx344940-a.meta1.la.home.com (cx344940-a.meta1.la.home.com [24.6.21.74]) by hub.freebsd.org (Postfix) with ESMTP id 91F7837B406 for ; Tue, 21 Aug 2001 09:34:49 -0700 (PDT) (envelope-from conrads@cx344940-a.meta1.la.home.com) Received: (from conrads@localhost) by cx344940-a.meta1.la.home.com (8.11.5/8.11.5) id f7LGYkB10483; Tue, 21 Aug 2001 11:34:46 -0500 (CDT) (envelope-from conrads) Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010821114703.B5114@shall.anarcat.dyndns.org> Date: Tue, 21 Aug 2001 11:34:46 -0500 (CDT) Organization: @Home Network From: Conrad Sabatier To: The Anarcat Subject: RE: precisions of pcm driver problems and update of rec program Cc: freebsd-multimedia@FreeBSD.ORG Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 21-Aug-2001 The Anarcat wrote: > FreeBSD Audio Driver (newpcm) Aug 1 2001 18:54:11 > Installed devices: > pcm0: at io 0x220 irq 5 drq 1:5 (1p/1r channels duplex) You haven't upgraded yet? There were some significant bugs in the pcm code around that time that have since been fixed. I'd strongly recommend a cvsup and make world. -- Conrad Sabatier conrads@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Tue Aug 21 10:11:53 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts8-srv.bellnexxia.net (tomts8.bellnexxia.net [209.226.175.52]) by hub.freebsd.org (Postfix) with ESMTP id 86F5037B40A for ; Tue, 21 Aug 2001 10:11:48 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.180]) by tomts8-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010821171147.NCF27547.tomts8-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Tue, 21 Aug 2001 13:11:47 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 7190219A1; Tue, 21 Aug 2001 13:13:55 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 6072E20AFC; Tue, 21 Aug 2001 13:12:31 -0400 (EDT) Date: Tue, 21 Aug 2001 13:12:31 -0400 From: The Anarcat To: Conrad Sabatier Cc: The Anarcat , freebsd-multimedia@FreeBSD.ORG Subject: Re: precisions of pcm driver problems and update of rec program Message-ID: <20010821131230.A28830@shall.anarcat.dyndns.org> References: <20010821114703.B5114@shall.anarcat.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 21 Aug 2001, Conrad Sabatier wrote: >=20 > On 21-Aug-2001 The Anarcat wrote: > > FreeBSD Audio Driver (newpcm) Aug 1 2001 18:54:11 > > Installed devices: > > pcm0: at io 0x220 irq 5 drq 1:5 (1p/1r channels duplex) >=20 > You haven't upgraded yet? There were some significant bugs in the pcm co= de > around that time that have since been fixed. Hmm.. Okay. I am cvsuping now. I will report back here later. A --0F1p//8PRICkK4MW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: Pour information voir http://www.gnupg.org iEYEARECAAYFAjuCln0ACgkQttcWHAnWiGcXQgCdFzT0Z3ikxN/3YCwcvDQwiop5 tEIAn1gvIcgfAlfRoIhoT2KLXISAa6Ln =+HcU -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Tue Aug 21 14: 7:48 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts8-srv.bellnexxia.net (tomts8.bellnexxia.net [209.226.175.52]) by hub.freebsd.org (Postfix) with ESMTP id CA05337B40B for ; Tue, 21 Aug 2001 14:07:17 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.180]) by tomts8-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010821210710.FEVQ27547.tomts8-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Tue, 21 Aug 2001 17:07:10 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 1E90D1A58; Tue, 21 Aug 2001 17:07:02 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 47E2520AFC; Tue, 21 Aug 2001 17:08:09 -0400 (EDT) Date: Tue, 21 Aug 2001 17:08:08 -0400 From: The Anarcat To: Stuart Barkley Cc: freebsd-multimedia@freebsd.org Subject: Re: precisions of pcm driver problems and update of rec program Message-ID: <20010821170808.F28830@shall.anarcat.dyndns.org> References: <20010821114703.B5114@shall.anarcat.dyndns.org> <20010821143852.W7029-100000@precipice.4gh.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qz2CZ664xQdCRdPu" Content-Disposition: inline In-Reply-To: <20010821143852.W7029-100000@precipice.4gh.net> User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --Qz2CZ664xQdCRdPu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 21 Aug 2001, Stuart Barkley wrote: > [not copied to mailing list. feel free to reply there.] >=20 > On Tue, 21 Aug 2001, The Anarcat wrote: >=20 > > I have made a few more updates to my rec program, since my last > > post (aug 15). >=20 > You might want to include the URL next time. I had saved your > previous messages so was able to find your files anyway.=20 Darn.. Always the same mistakes.. :) The url is: http://anarcat.dyndns.org/ftp/pub/FreeBSD/local/src/rec/ > However, > there seemed to be some permission problems with several of the files. Fixed. > > The program now fully conforms (I think) to the new OSS API as > > described in the PDF. Display has been improved, a play mode has > > been implemented, and a few other things has been changed (see the > > ChangeLog). >=20 > You seem to going down the same path I'm currently doing but are maybe > a little further along it. I also have crude record and play raw file > utilities. Interesting. > I have some code to display a running dB indication so the record > level can be monitored. I'll look at your code when I can and see > what integration possibilities might be. Nice!!! This was something I was looking for!!! I do think it would be possible to include it. The data passes through the program using an unsigned char array, so you could just interpret that, if you have an handy function around. :) > My short term goal is to be able to do signal generation (tones, > variable pitch and volume, pink noise, etc) and feed into an external > sound system.=20 Hmm... I think rec should do just one thing: interface the sound driver to get PCM data out of it. It should do as less processing possible to be as reliable as possible. Small is beautiful. :) I want mostly to avoid the "traps" sox is into because it is a general sound processing system, and not a recording tool. > At the same time, I want to read back the signal from a > mic and display an FFT or similar output. =20 I do not understand. What is a FFT? Are you talking about real-time effects here? > > 3) dsp vs dspW issues > > > > it seems that the data is "filled" when in RAW, sample: > > > > 00000000: 43fe 8efe 37fe 9dfe 3ffe 90fe 3efe 8dfe C...7...?...>... > > 00000010: 3dfe 97fe 44fe 93fe 31fe 95fe 48fe 9efe =3D...D...1...H... > > 00000020: 38fe 95fe 3dfe 94fe 36fe 9bfe 37fe 8afe 8...=3D...6...7... > > > > This does not happen in the new version, when using -d /dev/dsp > > and -w, but still happens with -d dspW and -w, which is odd. >=20 > I'm getting good record data with all 16 bits (with my program). =20 Using dsp or dspW? Using dsp seems to be fine here. > > 4) it seems we can independantly specify dsp and dspW (ie dsp can record > > 8 bit?), it's just that dspW scraps 16 bit output (!!) Let me rephrase this: it seems we can open dsp and dspW interchangeably without any difference except default sample format. In other words, using -d dsp or -d dspW doesn't make a difference.=20 I am not talking about simultaneous opens of dsp devices or full-duplex operation. This should be operated by the driver (and is in -current, IIRC). That said, let's see: > I haven't tried yet, but I assumed you could open /dev/dspW for R/W > and set each direction independently.=20 I don't think OSS supports assymetric audio formats. And in -stable, you cannot open dsp devices twice. > Simple separate processes (my > program) didn't seem to be able to read and write at the same time. For the above reason, I guess. > select() isn't too hard to use, but program structure does need to > take it into account. Threads might be another possibility. In > either case it does start becoming a more complicated program than a > simple test bed utility. As mentionned earlier, I wish rec to be as simple as possible. Avoid threading/select if possible. And it is. :) The driver should take care of multiple opens of dsp. > > 2) -c n where n > 2 will likely not work. >=20 > # channels? I guess that would be limited by the hardware.=20 Of course. My sound blaster does not allows c > 2 or < 1. But given proper hardware, I don't think rec would DTRT with c > 2. > I've > actually though about writing an output file from my proposed tool > which would include 4 channels: the 2 output channels which were > generated and the 2 input channels which were captured. =20 Interesting. But, as I said, why not capture the data and *then* process it to create a seperate file or duplicate channels? And doesn't sox just do this? Record using rec and process using sox or your software. :) > Later offline tools could then do more detailed analysis of the data. >=20 > > 6) AIFF mode has not been tested with this year's changes >=20 > I have only been playing around with raw files so far. It might be > good to support/allow other formats, but I'm still very unclear of > which formats have what advantages.=20 I initially chose AIFF because the sample stream didn't need a lot of correction or processing. And the header was of almost static size, allowing interruptible recordings to edit the header in cleanups. It was working fine, I don't know if it still works, but I think it would. However, keeping a RAW-only output keeps the program simple. That is why I am not developping AIFF anymore and that I ifdef'd it in the source. > It would be nice to have sample > rate, bits, number of channels, etc inside the file. =20 That's why formats such as AIFF exist. If you look at aiff.c, you have the writeCOMMChunk() functi which writes the header, including sample rate, size (which can be modified if interrupted, using seek; see updateSizeFields), and format... I have no documentation on the WAVE format, so I did not write an output "plugin" for it. But I think WAVE features about the same thing as AIFF. > I suspect that if I really get very serious I'll be wanting 20-24 bit > A/D (and maybe D/A) conversion. Is that an external module or a "soundcard"? > > Please test at will and comment. I think I'm almost there! :) >=20 > Okay. Yay! > > Oh, and note that the AIFF mode is in the way of being deprecated. > > I have no time test and adapt to the massive latest changes. I > > request help here. I might work on this once the "raw" version is > > stable. >=20 > As above. AIFF might be good, but "raw" is good enough to get > started. Yay. Screw AIFF. :) A. --Qz2CZ664xQdCRdPu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: Pour information voir http://www.gnupg.org iEYEARECAAYFAjuCzbcACgkQttcWHAnWiGdk+QCfTwn8s+0aigB0WPTpArZ9t44i mLgAnRKzfVUfSZjDyn1XBw/UXSoYOm+a =mYjq -----END PGP SIGNATURE----- --Qz2CZ664xQdCRdPu-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Tue Aug 21 19:42: 3 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from kumr.lns.com (kumr.lns.com [140.174.7.1]) by hub.freebsd.org (Postfix) with ESMTP id 2682137B410 for ; Tue, 21 Aug 2001 19:41:58 -0700 (PDT) (envelope-from pozar@kumr.lns.com) Received: (from pozar@localhost) by kumr.lns.com (8.11.4/8.9.3) id f7M2fho59058; Tue, 21 Aug 2001 19:41:43 -0700 (PDT) (envelope-from pozar) Date: Tue, 21 Aug 2001 19:41:43 -0700 From: Tim Pozar To: Thomas Runge Cc: dannyman , freebsd-multimedia@FreeBSD.ORG Subject: Re: radio cards Message-ID: <20010821194142.B58228@lns.com> References: <20010820005524.R2048@toldme.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from coto@core.de on Mon, Aug 20, 2001 at 10:49:08AM +0200 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Aug 20, 2001 at 10:49:08AM +0200, Thomas Runge wrote: > On Mon, 20 Aug 2001, dannyman wrote: > > > Anyone ever play with a cool radio tuner card? I'd like to be able to > > tune to a station, and dump a program in to an au, maybe piping it in to > > an mp3/ogg encoder, so that I can listen to my favorite NPR and other > > programs on my own schedule. Basically, my own little radio TiVo. :) > > Most of us (if not all) use a Hauppauge WinTV card for FM, especially a > WinTV/radio, which has a FM tuner onboard. The driver fully supports > that tuner and there are at least two radio programs, that may help > you. One is a curses based application and one is Motif based. An I have a command line based tuner. http://www.lns.com/papers/tuneradio/ Tim -- Snail: Tim Pozar / LNS / 1978 45th Ave / San Francisco CA 94116 / USA POTS: +1 415 665 3790 Radio: KC6GNJ / KAE6247 "It's a damn poor mind that can only think of one way to spell a word." - Andrew Jackson "What is wanted is not the will to believe, but the will to find out, which is the exact opposite." - Bertrand Russell, "Skeptical_Essays" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 12: 4:17 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from precipice.4gh.net (precipice.4gh.net [63.73.57.6]) by hub.freebsd.org (Postfix) with ESMTP id B5CFE37B43C for ; Wed, 22 Aug 2001 12:03:05 -0700 (PDT) (envelope-from stuartb@4gh.net) Received: from localhost (stuartb@localhost) by precipice.4gh.net (8.9.3/8.9.3) with ESMTP id OAA12622; Wed, 22 Aug 2001 14:57:39 -0400 (EDT) (envelope-from stuartb@4gh.net) Date: Wed, 22 Aug 2001 14:57:38 -0400 (EDT) From: Stuart Barkley To: The Anarcat Cc: Subject: Re: precisions of pcm driver problems and update of rec program In-Reply-To: <20010821170808.F28830@shall.anarcat.dyndns.org> Message-ID: <20010822135453.W8939-100000@precipice.4gh.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, 21 Aug 2001, The Anarcat wrote: > On Tue, 21 Aug 2001, Stuart Barkley wrote: > > > I have some code to display a running dB indication so the record > > level can be monitored. I'll look at your code when I can and see > > what integration possibilities might be. > > Nice!!! This was something I was looking for!!! I do think it > would be possible to include it. The data passes through the > program using an unsigned char array, so you could just interpret > that, if you have an handy function around. :) The main thing is to find minimum and maximum values over an interval of interest. You will be clipping if you are hitting the maximum or minimum values. My initial code just displayed these values over each 1 second interval so I could visually see what was happening. To convert these numbers to dB use something like: #include #include float dB = log10((double)SHRT_MAX / max) * 10.0; This can let you see the range of your data (how many dB below the maximum signal). For recording you do not want to reach 0dB or you will be clipping. You might also be distorting when you are close to 0 dB but that depends upon lots of other factors in the audio source stream. Since peaks can be much higher than the average, its the peaks you need to control. > > My short term goal is to be able to do signal generation (tones, > > variable pitch and volume, pink noise, etc) and feed into an external > > sound system. > > Hmm... I think rec should do just one thing: interface the sound > driver to get PCM data out of it. It should do as less processing > possible to be as reliable as possible. Small is beautiful. :) > > I want mostly to avoid the "traps" sox is into because it is a > general sound processing system, and not a recording tool. Yes. Simple is good, and my thoughts do keep going down the trap towards complexity. > > At the same time, I want to read back the signal from a > > mic and display an FFT or similar output. > > I do not understand. What is a FFT? An FFT (Fast Fourier Transform) display lets you see the frequency spectrum of the data. I'll probably use the fftw package. > Are you talking about real-time effects here? I am looking at doing a certain type of real time processing. The specific short term application I'm talking about is to be used to tune an external sound system to match the location. By sending a known signal into the sound system and examining the result actually captured by a microphone you can adjust the sound system for best reproduction of the signal. In this case the computer is just a tuning tool and isn't used once the system is calibrated. You can send a 440 Hz signal, measure the level seen by a microphone and use this as a baseline. You then send a 880 Hz signal and using an equalizer on the external system adjust things until this signal is received at the same level. Repeat for other frequencies. By using "pink" noise and an FFT display you can see all frequencies at once and get a better visual feel for the behavior. There are lots of other complications and I'm really just playing around at this point in time. Complications include things like the frequency response of the microphone, quality of the D/A and A/D converters and probably lots of other things I'll learn about as the process continues. > > > 4) it seems we can independantly specify dsp and dspW (ie dsp can record > > > 8 bit?), it's just that dspW scraps 16 bit output (!!) > > Let me rephrase this: it seems we can open dsp and dspW > interchangeably without any difference except default sample > format. In other words, using -d dsp or -d dspW doesn't make a > difference. Yes. That is what the OSS documentation says and that is what I'm seeing. My current program sets format, sample rate and number of channels. Both /dev/dsp and /dev/dspW behave identically. > I am not talking about simultaneous opens of dsp devices or > full-duplex operation. This should be operated by the driver (and > is in -current, IIRC). The OSS documentation indicates that only a single process can open the dsp. This means that if both read and write are required a single program will need to do both functions. I'm not following -current and haven't noticed this has a change. > > select() isn't too hard to use, but program structure does need to > > take it into account. Threads might be another possibility. In > > either case it does start becoming a more complicated program than a > > simple test bed utility. > > As mentionned earlier, I wish rec to be as simple as possible. > Avoid threading/select if possible. And it is. :) The driver > should take care of multiple opens of dsp. From the OSS documentation it looks like R/W must be done by a single program. I'm going to look at incorporating this into my code probably using select(). A simple program would be best and my next step will be to pipe stdin to audio output and audio input to stdout. > > I suspect that if I really get very serious I'll be wanting 20-24 bit > > A/D (and maybe D/A) conversion. > > Is that an external module or a "soundcard"? Yes. Actually I haven't really looked at this closely yet. I think there are a number of options including both special soundcards and external USB devices. By keeping the audio signals outside of the computer you card reduce the interference from the electric noise inside the chassis. Stuart -- I've never been lost; I was once bewildered for three days, but never lost! -- Daniel Boone To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 13: 6:37 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from precipice.4gh.net (precipice.4gh.net [63.73.57.6]) by hub.freebsd.org (Postfix) with ESMTP id C371237B421 for ; Wed, 22 Aug 2001 13:06:19 -0700 (PDT) (envelope-from stuartb@4gh.net) Received: from localhost (stuartb@localhost) by precipice.4gh.net (8.9.3/8.9.3) with ESMTP id QAA12820; Wed, 22 Aug 2001 16:04:00 -0400 (EDT) (envelope-from stuartb@4gh.net) Date: Wed, 22 Aug 2001 16:04:00 -0400 (EDT) From: Stuart Barkley To: The Anarcat Cc: Subject: Re: precisions of pcm driver problems and update of rec program In-Reply-To: <20010822135453.W8939-100000@precipice.4gh.net> Message-ID: <20010822154117.S12745-100000@precipice.4gh.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 22 Aug 2001, Stuart Barkley wrote: > The main thing is to find minimum and maximum values over an > interval of interest. You will be clipping if you are hitting the > maximum or minimum values. My initial code just displayed these > values over each 1 second interval so I could visually see what > was happening. > > To convert these numbers to dB use something like: > > #include > #include > > float dB = log10((double)SHRT_MAX / max) * 10.0; > > This can let you see the range of your data (how many dB below the > maximum signal). For recording you do not want to reach 0dB or > you will be clipping. Opps. That formula I gave above is wrong. It should really be: float dB = log10((double)SHRT_MAX / max) * 20.0; The extra factor of two is necessary because dB is log10(x^2) and pulling the square outside of the log10 is more efficient computationally. In addition, sometimes you will see systems showing negative dB. This comes from inverting the SHRT_MAX/max component or equivalently multiplying log10 by -1. dB can also be shown relative to other base values which can effectively add or subtract constants when converting between dB levels. You might also want to use the difference between min and max to get the full power range. However, if the signal is offset from zero it will be the the actual max or min which causes clipping. log10( (2^16)^2 ) * 10 = log10(2^16) * 20 = 96.3 which is where the 96 dB range for 16 bit sound cards comes from. log10(2^1) * 20 = 6.02 dB per bit. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 13:35:13 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts5-srv.bellnexxia.net (tomts5.bellnexxia.net [209.226.175.25]) by hub.freebsd.org (Postfix) with ESMTP id 480F337B42B for ; Wed, 22 Aug 2001 13:33:53 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.180]) by tomts5-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010822203352.KBIR10424.tomts5-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Wed, 22 Aug 2001 16:33:52 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 2E5AD1A63; Wed, 22 Aug 2001 16:33:45 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id E6E3620AFC; Wed, 22 Aug 2001 16:33:43 -0400 (EDT) Date: Wed, 22 Aug 2001 16:33:43 -0400 From: The Anarcat To: Stuart Barkley Cc: freebsd-multimedia@freebsd.org Subject: Re: precisions of pcm driver problems and update of rec program Message-ID: <20010822163343.B1561@shall.anarcat.dyndns.org> References: <20010821170808.F28830@shall.anarcat.dyndns.org> <20010822135453.W8939-100000@precipice.4gh.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="98e8jtXdkpgskNou" Content-Disposition: inline In-Reply-To: <20010822135453.W8939-100000@precipice.4gh.net> User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, 22 Aug 2001, Stuart Barkley wrote: > The main thing is to find minimum and maximum values over an interval > of interest. You will be clipping if you are hitting the maximum or > minimum values. My initial code just displayed these values over each > 1 second interval so I could visually see what was happening. Really interesting. I modified rec code to display time and byte counts updates only once a second, so I could be possible to keep a "max" variable somewhere (or dB) and send it to an external display function. I must setup such a function soon enough to be able to display time progress in both raw and AIFF mode. > To convert these numbers to dB use something like: >=20 > #include > #include >=20 > float dB =3D log10((double)SHRT_MAX / max) * 10.0; Nice. Got it. > This can let you see the range of your data (how many dB below the > maximum signal). For recording you do not want to reach 0dB or you > will be clipping. You might also be distorting when you are close to > 0 dB but that depends upon lots of other factors in the audio source > stream. Since peaks can be much higher than the average, its the > peaks you need to control. The problem with the max thing is that you must examine each single sample taken and compare it to a max, replacing the max in worst case, before writing it to file. This is time consuming. Also, this is all well if we're recording 8 bit unsigned, however, 16 bit data is little endian signed. That's crap. We then have to cast 2 elements of an array into a signed tmp and convert if correctly to unsigned to make a similar analysis. That sucks. On the top of my head: #ifdef LITTLE_ENDIAN 1: unsigned char buf[2]; /* array containing one sample */ 2: u_int16_t val =3D (int16_t) buf + INT_MIN; 3: if (val > max) max =3D val; 4: float dB =3D log10((double)UINT_MAX / max) * 10.0; #endif Line 2 and 3 would get executed about err.. 44100 times per second? :) Not good. I think I'll do it though... Even if it's in a seperate program. rec can already pipe it's output out to stdout so it would be better off this way... > Yes. Simple is good, and my thoughts do keep going down the trap > towards complexity. Then I think we agree here. The time calculations are already enough garbage in rec's code. Let's make other stuff simple filters that read samples, not soundcards. :) > > > At the same time, I want to read back the signal from a > > > mic and display an FFT or similar output. > > > > I do not understand. What is a FFT? >=20 > An FFT (Fast Fourier Transform) display lets you see the frequency > spectrum of the data. I'll probably use the fftw package. Interesting. This is not the same as the waveform displays we see in editors such as WaveLab, right? More an EQ display or what? > > Are you talking about real-time effects here? >=20 > I am looking at doing a certain type of real time processing. The > specific short term application I'm talking about is to be used to > tune an external sound system to match the location. [...] I understand better now. I basically want to use a soundcard as a benchmark tester or tuning device for external devices. That's really interesting. I believe that with the advent of full-duplex support (and consequently multiple opens of audio devices) for pcm, this will be achievable using simple programs such as rec and play, and auxiliary filters. > > > > 4) it seems we can independantly specify dsp and dspW (ie dsp can r= ecord > > > > 8 bit?), it's just that dspW scraps 16 bit output (!!) > > > > Let me rephrase this: it seems we can open dsp and dspW > > interchangeably without any difference except default sample > > format. In other words, using -d dsp or -d dspW doesn't make a > > difference. >=20 > Yes. That is what the OSS documentation says and that is what I'm > seeing. My current program sets format, sample rate and number of > channels. Both /dev/dsp and /dev/dspW behave identically. But this wasn't the behavior of the pcm driver before. :) I had problems with that in the earlier days of rec, that's why I was confused. All is clear now. :) > > I am not talking about simultaneous opens of dsp devices or > > full-duplex operation. This should be operated by the driver (and > > is in -current, IIRC). >=20 > The OSS documentation indicates that only a single process can open > the dsp. This means that if both read and write are required a single > program will need to do both functions. I'm not following -current > and haven't noticed this has a change. We'll need some input from Cameron here, but I think that the newpcm driver will indeed allow multiple opens of the dsp device, using DEVFS cloning techniques and such hacks. And I think Cameron mentionned something about full-duplex being supported on -stable if you build the right devices. I haven't been able to make this work though... > > As mentionned earlier, I wish rec to be as simple as possible. > > Avoid threading/select if possible. And it is. :) The driver > > should take care of multiple opens of dsp. >=20 > From the OSS documentation it looks like R/W must be done by a single > program. I'm going to look at incorporating this into my code > probably using select(). Hmm... ok.. I will wait for input from Cameron on the status of the multiple open issues. I think we shouldn't complicate the code if multiple opens are eventually allowed. > A simple program would be best and my next step will be to pipe stdin > to audio output and audio input to stdout. It might be possible to modify rec to operate in both "play" and "record" mode at the same time, reading data from stdin and writing to stdout. It does seem to be an ackward behavior though. > > > I suspect that if I really get very serious I'll be wanting 20-24 bit > > > A/D (and maybe D/A) conversion. > > > > Is that an external module or a "soundcard"? >=20 > Yes. Actually I haven't really looked at this closely yet. I think > there are a number of options including both special soundcards and > external USB devices. By keeping the audio signals outside of the > computer you card reduce the interference from the electric noise > inside the chassis. Interesting. If you have one of these jewels around, give me a call, and I'll try to make rec work in > 16 bit! :) A. --98e8jtXdkpgskNou Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjuEFyYACgkQttcWHAnWiGccuACfRWVNvUTUTZS9Xcd7kH98L9IC ZXAAoIZeGYAnaZu7b04N0dggHlyu6z7l =wMyU -----END PGP SIGNATURE----- --98e8jtXdkpgskNou-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 13:38:12 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts6-srv.bellnexxia.net (tomts6.bellnexxia.net [209.226.175.26]) by hub.freebsd.org (Postfix) with ESMTP id 245EB37B42B for ; Wed, 22 Aug 2001 13:37:41 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.180]) by tomts6-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010822203740.QQPP3759.tomts6-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Wed, 22 Aug 2001 16:37:40 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 1E6281A63; Wed, 22 Aug 2001 16:37:36 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 7FF5820AFC; Wed, 22 Aug 2001 16:37:35 -0400 (EDT) Date: Wed, 22 Aug 2001 16:37:35 -0400 From: The Anarcat To: Stuart Barkley Cc: freebsd-multimedia@FreeBSD.ORG Subject: Re: precisions of pcm driver problems and update of rec program Message-ID: <20010822163735.C1561@shall.anarcat.dyndns.org> References: <20010822135453.W8939-100000@precipice.4gh.net> <20010822154117.S12745-100000@precipice.4gh.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V88s5gaDVPzZ0KCq" Content-Disposition: inline In-Reply-To: <20010822154117.S12745-100000@precipice.4gh.net> User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --V88s5gaDVPzZ0KCq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thank you very much, Stuart, on these precisions. I will probably start writing a "monitor" or dB-filter-display-whatever filter very soon, and maybe incorporate it into rec, if that's not too much computation.. a.=20 --V88s5gaDVPzZ0KCq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjuEGA4ACgkQttcWHAnWiGezZQCfXKTA5OddZG2GvCynHPHoMlWu 0cQAmgLhVlclW+yjnEacdXkyjNYz+cm9 =JU6A -----END PGP SIGNATURE----- --V88s5gaDVPzZ0KCq-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 14: 7:31 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts13-srv.bellnexxia.net (tomts13.bellnexxia.net [209.226.175.34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFAB37B420 for ; Wed, 22 Aug 2001 14:07:15 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.180]) by tomts13-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010822210714.LLGN28468.tomts13-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Wed, 22 Aug 2001 17:07:14 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 9E2771965 for ; Wed, 22 Aug 2001 17:07:08 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 15FDD20AFC; Wed, 22 Aug 2001 17:07:05 -0400 (EDT) Date: Wed, 22 Aug 2001 17:07:05 -0400 From: The Anarcat To: Multimedia Subject: current issues with -stable pcm and update of rec program Message-ID: <20010822170705.D1561@shall.anarcat.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UfEAyuTBtIjiZzX6" Content-Disposition: inline User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --UfEAyuTBtIjiZzX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi. I have yet again updated my rec program available at: http://anarcat.dyndns.org/ftp/pub/FreeBSD/local/src/rec.tar.gz I post this because some of the issues I raised earlier on this list have been indeed resolved in 4.4-RC, so I post here the issues remaining. The only major issue I have with the sound driver is what has now been filed as pr kern/29964. The thing is that if the sound driver is passed an ioctl SNDCTL_CHANNELS with a value different than 1 or 2, it returns (or set it to?) 0, which is invalid. Handy url: http://www.freebsd.org/cgi/query-pr.cgi?pr=29964 Apart from that, recording is not filled in 16-bit mode anymore, wether I use dsp, dspW or audio. -r 110 does not return EINVAL, but does raise another bug which seems to be more on the rec side than the driver. As always, I welcome help/comments/bug reports wrt rec, and I still need a hand for its developpement and testing. Thank you for your attention, A. --UfEAyuTBtIjiZzX6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjuEHvgACgkQttcWHAnWiGfEUgCcDfFBVb9U0okkJSyWrGnighp4 ZNIAn2dk38otDU5qVPN5Vq18UV48m97Q =mhbQ -----END PGP SIGNATURE----- --UfEAyuTBtIjiZzX6-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 16:39:13 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from smtp01.primenet.com (smtp01.primenet.com [64.211.219.50]) by hub.freebsd.org (Postfix) with ESMTP id 3ACE137B405 for ; Wed, 22 Aug 2001 16:39:09 -0700 (PDT) (envelope-from libolt@libolt.net) Received: (from daemon@localhost) by smtp01.primenet.com (8.9.3/8.9.3) id QAA03113 for ; Wed, 22 Aug 2001 16:38:56 -0700 (MST) Message-Id: <200108222338.QAA03113@smtp01.primenet.com> Received: from 64-212-27-200.nas1.PHX1.gblx.net(64.212.27.200), claiming to be "there" via SMTP by smtp01.primenet.com, id smtpdAAAocaO9f; Wed Aug 22 16:38:39 2001 Content-Type: text/plain; charset="iso-8859-1" From: Mike McLean To: freebsd-multimedia@FreeBSD.ORG Subject: SB Live 4 speaker support Date: Wed, 22 Aug 2001 16:43:20 -0700 X-Mailer: KMail [version 1.3] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I've got a Sound Blaster Live! value edition. It currently works fine using one plug (think it's front speakers) but I can't use the second plug which would allow for 4 speakers. Am I doing something wrong or is this a driver issue? I know the second speakers work fine with the linux driver. If I had a clue at all about writing drivers I'd look at it, but my programming abilities are more limited to applications. Cheers, Mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 22:38:23 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from lpr-325.cable.inet.fi (lpr-325.cable.inet.fi [194.251.103.37]) by hub.freebsd.org (Postfix) with ESMTP id 7F64937B40E for ; Wed, 22 Aug 2001 22:38:20 -0700 (PDT) (envelope-from Juha.Nurmela@quicknet.inet.fi) Received: from localhost (junki@localhost) by lpr-325.cable.inet.fi (8.11.4/8.11.4) with ESMTP id f7N5cso23879; Thu, 23 Aug 2001 08:38:55 +0300 (EEST) (envelope-from Juha.Nurmela@quicknet.inet.fi) Date: Thu, 23 Aug 2001 08:38:54 +0300 (EEST) From: Juha.Nurmela@quicknet.inet.fi X-Sender: junki@lpr-325.cable.inet.fi Reply-To: Juha.Nurmela@quicknet.inet.fi To: The Anarcat , Stuart Barkley Cc: freebsd-multimedia@freebsd.org Subject: Re: precisions of pcm driver problems and update of rec program Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org [snip interesting discussion] Have you guys ever wished the sound-device would provide a VU-level indicator for the generic mixers ? Without interfering with a recorder process. It could sample randomly over 10...50% of samples when rates are high, or whatever, if the extra load is bothersome (and obviously only be effective when the /dev/pcm/vumeter is open). I wonder how this kind of additional device would fit in pcm driver. There's a audio spectrum visualizer too, which I once wrote for Xlib and fftw. Don't know if it's any good, but has been a handy tool for miscellaneous twoway radio adjustments. http://personal.inet.fi/koti/juha.nurmela/ascope5.c (scope it is not, false name, yes) Juha To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Wed Aug 22 23:58:33 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from precipice.4gh.net (precipice.4gh.net [63.73.57.6]) by hub.freebsd.org (Postfix) with ESMTP id 1753937B405 for ; Wed, 22 Aug 2001 23:58:21 -0700 (PDT) (envelope-from stuartb@4gh.net) Received: from localhost (stuartb@localhost) by precipice.4gh.net (8.9.3/8.9.3) with ESMTP id CAA15720; Thu, 23 Aug 2001 02:58:12 -0400 (EDT) (envelope-from stuartb@4gh.net) Date: Thu, 23 Aug 2001 02:58:12 -0400 (EDT) From: Stuart Barkley To: Cc: The Anarcat , Subject: Re: precisions of pcm driver problems and update of rec program In-Reply-To: Message-ID: <20010823021827.B12745-100000@precipice.4gh.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 23 Aug 2001 Juha.Nurmela@quicknet.inet.fi wrote: > Have you guys ever wished the sound-device would provide a > VU-level indicator for the generic mixers ? Without interfering > with a recorder process. I hadn't thought about it this way, but this is one reason I've been playing around with my own record program. It does make some sense to include if you can handle that last condition. > It could sample randomly over 10...50% of samples when rates are > high, or whatever, if the extra load is bothersome (and obviously > only be effective when the /dev/pcm/vumeter is open). I wonder how > this kind of additional device would fit in pcm driver. I haven't really been into the driver code, but it could be a performance issue, particularly if the driver needed to do any byte order conversions or other manipulations on the data. Perhaps this function does better belong in the record program. I've looked at dap and it has a record level meter. It has no scale information so I've found it pretty useless for real use. > There's a audio spectrum visualizer too, which I once wrote for > Xlib and fftw. Don't know if it's any good, but has been a handy > tool for miscellaneous twoway radio adjustments. > http://personal.inet.fi/koti/juha.nurmela/ascope5.c > (scope it is not, false name, yes) YES! This looks to be pretty close to what I'm thinking about (including an X interface which I was dreading to need to deal with). About the only thing missing is log scales for both frequency and level. Level is pretty easy, just dB = log10(level)*20.0. I'm not sure how to handle the frequency scale and haven't researched that yet. It might be necessary to split the frequency range into bins with several of the FFT values in each one. I'm not sure if you would average or add the values. It might be that you need to total the squares of the values (and then just take log10(sum of squares)*10.0). Thanks, Stuart -- I've never been lost; I was once bewildered for three days, but never lost! -- Daniel Boone To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Thu Aug 23 8:12: 7 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from tomts7-srv.bellnexxia.net (tomts7.bellnexxia.net [209.226.175.40]) by hub.freebsd.org (Postfix) with ESMTP id BD27937B401 for ; Thu, 23 Aug 2001 08:12:00 -0700 (PDT) (envelope-from anarcat@anarcat.dyndns.org) Received: from khan.anarcat.dyndns.org ([65.92.160.216]) by tomts7-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20010823151159.JWSO3327.tomts7-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Thu, 23 Aug 2001 11:11:59 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id CFE7A1A67; Thu, 23 Aug 2001 11:11:37 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 42F4320B8A; Thu, 23 Aug 2001 11:11:27 -0400 (EDT) Date: Thu, 23 Aug 2001 11:11:26 -0400 From: The Anarcat To: Stuart Barkley Cc: Juha.Nurmela@quicknet.inet.fi, freebsd-multimedia@freebsd.org Subject: Re: precisions of pcm driver problems and update of rec program Message-ID: <20010823111126.B1566@shall.anarcat.dyndns.org> References: <20010823021827.B12745-100000@precipice.4gh.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pvezYHf7grwyp3Bc" Content-Disposition: inline In-Reply-To: <20010823021827.B12745-100000@precipice.4gh.net> User-Agent: Mutt/1.3.20i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --pvezYHf7grwyp3Bc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 23 Aug 2001, Stuart Barkley wrote: > On Thu, 23 Aug 2001 Juha.Nurmela@quicknet.inet.fi wrote: >=20 > > Have you guys ever wished the sound-device would provide a > > VU-level indicator for the generic mixers ? Without interfering > > with a recorder process. I don't think this is "completely" possible. That is, you can't have a VU indicator for the mic channel if you're already recording on the line channel, for example. This is just the way soundcard works, if i'm not mistaken... > I hadn't thought about it this way, but this is one reason I've been > playing around with my own record program. It does make some sense to > include if you can handle that last condition. But the thing is it's not really something that the kernel *must* do, but a thing that it *could* do.=20 As such, I would like better to have support for multiple opens (because it would have to be implemented internally for the meter anyways) altogether and run the meter as a userland process than have thousands of specific gizmos in the kernel, sorry, no offense here.. > > It could sample randomly over 10...50% of samples when rates are > > high, or whatever, if the extra load is bothersome (and obviously > > only be effective when the /dev/pcm/vumeter is open). I wonder how > > this kind of additional device would fit in pcm driver. >=20 > I haven't really been into the driver code, but it could be a > performance issue, particularly if the driver needed to do any byte > order conversions or other manipulations on the data. Yeah, and from what you've sent, it also involves logarithmic computations and max comparaisons to be really useful. This too much computation to put in the kernel, IMHO. This should be userland. As you mentionned earlier, we have to read each sample to find the max in order to detect clipping, which is mandatory, for a meter, IMHO. > Perhaps this function does better belong in the record program. Yes. Actually, it belongs to a filter program that I will shortly write. :) > I've looked at dap and it has a record level meter. It has no scale > information so I've found it pretty useless for real use. Indeed. Also, dap is huge and cannot mix multiple channels. I haven't used dap for a very long while now.. I also think there was some memory issues with it (as with mxv: loading the whole sample into memory and trusting the virtual memory manager, simply mad). > > There's a audio spectrum visualizer too, which I once wrote for > > Xlib and fftw. Don't know if it's any good, but has been a handy > > tool for miscellaneous twoway radio adjustments. > > http://personal.inet.fi/koti/juha.nurmela/ascope5.c > > (scope it is not, false name, yes) Note: I needed to add -I/usr/X11R6/include in the compile comand line. :) Also note that I tested it using: ../rec - | ./ascope5 -A /dev/stdin Another fun thing to do is: esdmon | ./ascope5 -A /dev/stdin to check esd output. :) > YES! This looks to be pretty close to what I'm thinking about > (including an X interface which I was dreading to need to deal with). Yes, it is really nice. It just tells me right now that my left channel has 2 big noises at around 3940 and 4060. Hmm.. I must investigate that. Must be the cable. :) Anyways, great tool! Just a few comments, if you don't mind.. Take it as a wishlist. :) - fast/slow button are unitiutive: took me a while to understand what it was for. should be a function of the window size or something... Anyways, since the window can't scroll, what use is it to have detail on only a part of the spectrum? I'm not sure I understand what they do. - the little white numbers are annoying :) there should be scales on the sides instead. - the vertical green lines should be wider to accelerate display - both channels should be display at once, either as a single or double graph Also, I would be looking for a similar tool having just one display: the *overall* VU/dB/level meter. No need for the frequency, just the peaks, to adjust incoming mixer levels. How hard would that be to implement in ascope? I also have a CPU problem here: CPU states: 16.6% user, 0.0% nice, 6.2% system, 2.7% interrupt, 74.5% id= le Mem: 34M Active, 6372K Inact, 15M Wired, 4780K Cache, 14M Buf, 404K Free Swap: 250M Total, 37M Used, 213M Free, 14% Inuse PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 40252 anarcat 2 0 2388K 1080K select 0:35 10.50% 10.50% ascope5 343 root 2 0 17544K 8104K select 24:43 8.94% 8.94% XFree86 it *is* taking a bit too much cpu. :) If the lines would be thicker, I think performance would improve. You guys are great, I think we're actually getting somewhere here. :) A. --pvezYHf7grwyp3Bc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjuFHR0ACgkQttcWHAnWiGd2iwCfTYVSYT2WFjnI37BYzRA0IjXV o2UAoJb69BISqQ7jx7f51LxMv1khw5o0 =+cSI -----END PGP SIGNATURE----- --pvezYHf7grwyp3Bc-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Thu Aug 23 10:44: 2 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from mail.katsurajima.seya.yokohama.jp (mail.katsurajima.seya.yokohama.jp [210.164.211.67]) by hub.freebsd.org (Postfix) with ESMTP id D240E37B408 for ; Thu, 23 Aug 2001 10:43:44 -0700 (PDT) (envelope-from raven@katsurajima.seya.yokohama.jp) Received: from monster.katsurajima.seya.yokohama.jp (gw-global.katsurajima.seya.yokohama.jp [192.168.2.3]) by mail.katsurajima.seya.yokohama.jp (Postfix) with ESMTP id 8CEAA1D8C08; Fri, 24 Aug 2001 02:43:42 +0900 (JST) Received: from zenchan.katsurajima.seya.yokohama.jp (zenchan [192.168.1.3]) by monster.katsurajima.seya.yokohama.jp (8.9.3/3.7W05/05/99) with SMTP id CAA51898; Fri, 24 Aug 2001 02:43:42 +0900 (JST) Date: Fri, 24 Aug 2001 02:43:18 +0900 From: Katsurajima Naoto To: FreeBSD-multimedia@FreeBSD.ORG Cc: freebsd-users-jp@jp.FreeBSD.ORG Subject: 4.4-RC ich sound driver bug fix Message-Id: <20010824024318.13add558.raven@katsurajima.seya.yokohama.jp> X-Mailer: Sylpheed version 0.4.66 (GTK+ 1.2.10; i386--freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hellow. I fixed sound driver for Intel ICH AC'97. Changed points are - FIFO buffer control method is now been strict. By this change, CPU and DMA are never conflict on same buffer block. Many troubles are occured by this conflict. - Not use ICH's PICB(Position In Current Buffer) function for getting hardware pointer. This function seems to be buggy, and not only untrused on the value, but also getting trouble. On the other hand, this driver cannot check playing position under block size. But many case, this is not so big problem. - and few little fixes I checked this driver with xmms, xine, rollemup and timidity++. Under first 3 programs, there is no problem and very stable on my notebook PC(Toshiba DynaBookSS3440). But timidity++ plays with crick noise.(I have not checked yet why) It may be better to reboot by power off/on than by reboot command, after attemp patch and rebuild kernel. It is because of clearing illeagal condition caused by old driver. This patch is tested only on 4.4-RC. But may work on -CURRENT. Please check it. -- Katsurajima "Raven" Naoto(桂島 直人) Family Emblem: Circle and Left 3 Clove-TOMOE(丸に左三つ丁子巴) e-mail: raven@katsurajima.seya.yokohama.jp --- cut here *** sys/dev/sound/pci/ich.c.orig Wed Aug 1 14:37:30 2001 --- sys/dev/sound/pci/ich.c Thu Aug 23 10:32:55 2001 *************** *** 53,58 **** --- 53,59 ---- u_int32_t num, run; u_int32_t blksz, blkcnt; u_int32_t regbase, spdreg; + u_int32_t civ; struct snd_dbuf *buffer; struct pcm_channel *channel; *************** *** 296,302 **** ch->blksz = blocksize; ich_filldtbl(ch); ! ich_wr(sc, ch->regbase + ICH_REG_X_LVI, ICH_DTBL_LENGTH - 1, 1); return ch->blksz; } --- 297,303 ---- ch->blksz = blocksize; ich_filldtbl(ch); ! ich_wr(sc, ch->regbase + ICH_REG_X_LVI, ch->blkcnt - 1, 1); return ch->blksz; } *************** *** 306,311 **** --- 307,313 ---- { struct sc_chinfo *ch = data; struct sc_info *sc = ch->parent; + u_int32_t st; switch (go) { case PCMTRIG_START: *************** *** 314,319 **** --- 316,327 ---- ich_wr(sc, ch->regbase + ICH_REG_X_CR, ICH_X_CR_RPBM | ICH_X_CR_LVBIE | ICH_X_CR_IOCE | ICH_X_CR_FEIE, 1); break; + case PCMTRIG_STOP: + ch->run = 0; + st = ich_rd(sc, ch->regbase + ICH_REG_X_CR, 1); + ich_wr(sc, ch->regbase + ICH_REG_X_CR, st & ~ICH_X_CR_RPBM, 1); + break; + case PCMTRIG_ABORT: ich_resetchan(sc, ch->num); ch->run = 0; *************** *** 327,344 **** { struct sc_chinfo *ch = data; struct sc_info *sc = ch->parent; ! u_int32_t ci, ofs, pos; - ofs = 0; ci = 1234; ! while (ci != ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1)) { ci = ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1); - ofs = ich_rd(sc, ch->regbase + ICH_REG_X_PICB, 2) * 2; - } ! ofs = ch->blksz - ofs; ci %= ch->blkcnt; ! pos = (ch->blksz * ci) + ofs; return pos; } --- 335,349 ---- { struct sc_chinfo *ch = data; struct sc_info *sc = ch->parent; ! u_int32_t ci, pos; ci = 1234; ! while (ci != ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1)) ci = ich_rd(sc, ch->regbase + ICH_REG_X_CIV, 1); ! ch->civ = ci; ci %= ch->blkcnt; ! pos = ch->blksz * ci; return pos; } *************** *** 371,377 **** { struct sc_info *sc = (struct sc_info *)p; struct sc_chinfo *ch; ! u_int32_t st, lvi; int i; for (i = 0; i < 3; i++) { --- 376,382 ---- { struct sc_info *sc = (struct sc_info *)p; struct sc_chinfo *ch; ! u_int32_t st, lvi, cbi, lbi; int i; for (i = 0; i < 3; i++) { *************** *** 385,391 **** if (ch->run) chn_intr(ch->channel); lvi = ich_rd(sc, ch->regbase + ICH_REG_X_LVI, 1); ! lvi++; lvi %= ICH_DTBL_LENGTH; ich_wr(sc, ch->regbase + ICH_REG_X_LVI, lvi, 1); } --- 390,405 ---- if (ch->run) chn_intr(ch->channel); lvi = ich_rd(sc, ch->regbase + ICH_REG_X_LVI, 1); ! cbi = ch->civ % ch->blkcnt; ! if (cbi == 0) ! cbi = ch->blkcnt - 1; ! else ! cbi--; ! lbi = lvi % ch->blkcnt; ! if (cbi >= lbi) ! lvi += cbi - lbi; ! else ! lvi += cbi + ch->blkcnt - lbi; lvi %= ICH_DTBL_LENGTH; ich_wr(sc, ch->regbase + ICH_REG_X_LVI, lvi, 1); } *************** *** 419,425 **** ich_wr(sc, ICH_REG_GLOB_CNT, ICH_GLOB_CTL_COLD | ICH_GLOB_CTL_PRES, 4); ! if (ich_resetchan(sc, 0) || ich_resetchan(sc, 0)) return ENXIO; if (bus_dmamem_alloc(sc->dmat, (void **)&sc->dtbl, BUS_DMA_NOWAIT, &sc->dtmap)) --- 433,439 ---- ich_wr(sc, ICH_REG_GLOB_CNT, ICH_GLOB_CTL_COLD | ICH_GLOB_CTL_PRES, 4); ! if (ich_resetchan(sc, 0) || ich_resetchan(sc, 1)) return ENXIO; if (bus_dmamem_alloc(sc->dmat, (void **)&sc->dtbl, BUS_DMA_NOWAIT, &sc->dtmap)) *************** *** 475,481 **** sc->dev = dev; data = pci_read_config(dev, PCIR_COMMAND, 2); ! data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); pci_write_config(dev, PCIR_COMMAND, data, 2); data = pci_read_config(dev, PCIR_COMMAND, 2); --- 489,495 ---- sc->dev = dev; data = pci_read_config(dev, PCIR_COMMAND, 2); ! data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN); pci_write_config(dev, PCIR_COMMAND, data, 2); data = pci_read_config(dev, PCIR_COMMAND, 2); *************** *** 494,500 **** sc->nabmbart = rman_get_bustag(sc->nabmbar); sc->nabmbarh = rman_get_bushandle(sc->nabmbar); ! if (bus_dma_tag_create(NULL, 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, ICH_DEFAULT_BUFSZ, 1, 0x3ffff, 0, &sc->dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); goto bad; --- 508,514 ---- sc->nabmbart = rman_get_bustag(sc->nabmbar); sc->nabmbarh = rman_get_bushandle(sc->nabmbar); ! if (bus_dma_tag_create(NULL, 8, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, ICH_DEFAULT_BUFSZ, 1, 0x3ffff, 0, &sc->dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); goto bad; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Fri Aug 24 6:35: 4 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from cx344940-a.meta1.la.home.com (cx344940-a.meta1.la.home.com [24.6.21.74]) by hub.freebsd.org (Postfix) with ESMTP id 5946837B411; Fri, 24 Aug 2001 06:34:58 -0700 (PDT) (envelope-from conrads@cx344940-a.meta1.la.home.com) Received: (from conrads@localhost) by cx344940-a.meta1.la.home.com (8.11.6/8.11.5) id f7ODYvL81550; Fri, 24 Aug 2001 08:34:57 -0500 (CDT) (envelope-from conrads) Message-ID: X-Mailer: XFMail 1.5.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Fri, 24 Aug 2001 08:34:57 -0500 (CDT) Organization: @Home Network From: Conrad Sabatier To: freebsd-multimedia@freebsd.org Subject: vlc: Virtual timer expired Cc: freebsd-questions@freebsd.org Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I've been testing out an install of vlc with an old DVD demo disc a friend of mine got with his computer several years ago (yes, I have no other DVDs!). Every time I try to open the disc, I get the message "Virtual timer expired", and the program exits. Is this a problem with vlc, or is it some sort of hard-coded time limit on the demo DVD itself? Just curious, before I bother to go rent a DVD at the store for further testing. -- Conrad Sabatier conrads@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Sat Aug 25 3:24:33 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from b80216.upc-b.chello.nl (b80216.upc-b.chello.nl [212.83.80.216]) by hub.freebsd.org (Postfix) with ESMTP id DCD8237B40B for ; Sat, 25 Aug 2001 03:24:29 -0700 (PDT) (envelope-from devet@devet.org) Received: from adv.devet.org (adv.devet.org [192.168.1.2]) by b80216.upc-b.chello.nl (Postfix) with ESMTP id 8523B68B2; Sat, 25 Aug 2001 12:24:28 +0200 (CEST) Received: by adv.devet.org (Postfix, from userid 100) id B1E483E35; Sat, 25 Aug 2001 12:24:27 +0200 (CEST) Date: Sat, 25 Aug 2001 12:24:27 +0200 To: raven@katsurajima.seya.yokohama.jp Cc: multimedia@freebsd.org Subject: Re: 4.4-RC ich sound driver bug fix Message-ID: <20010825122427.A29942@adv.devet.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Newsgroups: list.freebsd.multimedia In-Reply-To: <20010824024318.13add558.raven@katsurajima.seya.yokohama.jp> Organization: Eindhoven, the Netherlands From: devet@devet.org (Arjan de Vet) Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article <20010824024318.13add558.raven@katsurajima.seya.yokohama.jp> you write: >I fixed sound driver for Intel ICH AC'97. Changed points are [...] >I checked this driver with xmms, xine, rollemup and timidity++. Under >first 3 programs, there is no problem and very stable on my notebook >PC(Toshiba DynaBookSS3440). But timidity++ plays with crick noise.(I >have not checked yet why) [...] >Please check it. I've tried this on my Fujitsu Lifebook S-4576 and KDE's startup sounds now work where it did not before. The dmesg output was: pcm0: port 0x1cc0-0x1cff,0x1000-0x10ff irq 9 at device 0.1 on pci0 pcm0: ac97 codec id 0x594d4800 pcm0: ac97 codec features 18 bit DAC, 5 bit master volume, no 3D Stereo Enhancement pcm0: ac97 primary codec extended features AMAP Thanks for the patch! Arjan -- Arjan de Vet, Eindhoven, The Netherlands URL: http://www.iae.nl/users/devet/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message From owner-freebsd-multimedia Sat Aug 25 17:20:12 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from f1node03.rhrz.uni-bonn.de (node03.rhrz.uni-bonn.de [131.220.18.133]) by hub.freebsd.org (Postfix) with ESMTP id 9809537B40A for ; Sat, 25 Aug 2001 17:20:03 -0700 (PDT) (envelope-from uzs106@ibm.rhrz.uni-bonn.de) Received: from moritz.alleswirdgelber (ascend-tk-p242.dialin.uni-bonn.de [131.220.244.242]) by f1node03.rhrz.uni-bonn.de (8.9.3/8.9.3) with ESMTP id CAA159980 for ; Sun, 26 Aug 2001 02:20:00 +0200 Received: from localhost (uzs106@localhost [127.0.0.1]) by moritz.alleswirdgelber (8.9.3/8.9.3) with ESMTP id CAA00595 for ; Sun, 26 Aug 2001 02:17:47 +0200 (CEST) (envelope-from uzs106@ibm.rhrz.uni-bonn.de) Date: Sun, 26 Aug 2001 02:17:47 +0200 (CEST) From: Heiko Recktenwald X-Sender: uzs106@moritz.alleswirdgelber To: multimedia@FreeBSD.ORG Subject: Trident Soundcard. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Got a Trident soundcard, as described in man pcp, it is recognised in dmesg, but dmesg is also full of error messages and mpg123 and play are quiet. I have 4.0 R. Would it work with 4.3 R ? Would I have more luck with a "turtle beach daytona" ? I suspect not. Wasnt recognised by pcm. Other drivers ? H. dmesg: pcm0: port 0xb400-0xb4ff mem 0xe2000000-0xe2000fff irq 11 at device 12.0 on pci0 codec timeout writing 0, data 0 codec timeout during read of register 0 codec timeout during read of register 7c codec timeout during read of register 7e codec timeout writing 2, data 20 codec timeout during read of register 2 codec timeout writing 2, data 0 codec timeout during read of register 26 pcm0: ac97 codec reports dac not ready codec timeout writing 2, data 707 codec timeout writing 18, data 707 codec timeout writing a, data 6 codec timeout writing 10, data 707 codec timeout writing e, data 8000 codec timeout writing 12, data 707 codec timeout writing 1c, data 8000 codec timeout writing 16, data 707 codec timeout writing 14, data 707 codec timeout writing 1a, data 0 fdc0: at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0 cd1: Attempt to query device size failed: NOT READY, Medium not present codec timeout writing 18, data 0 codec timeout writing 10, data 0 codec timeout writing 2, data 0 codec timeout writing 1a, data 404 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message