From: Takashi Iwai Subject: Re: Line6 TonePort UX1 driver Date: Wed, 10 May 2006 17:34:17 +0200 Message-ID: References: <20060508201619.M38508@oneonline.it> <20060510165635.M757@oneonline.it> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20060510165635.M757@oneonline.it> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Stefano D Angelo Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 10 May 2006 16:56:35 +0300, Stefano D Angelo wrote: > > > At Mon, 8 May 2006 20:16:19 +0300, > > Stefano D Angelo wrote: > > > > > > Hello everyone, > > > I'm an italian university student and I'm developing an ALSA driver for Line6 > > > TonePort UX1 USB sound card. > > > This is my first driver-writing experience, so maybe this is a dumb question > > > for you. > > > This soundcard supports 44.1/48 kHz 16/24-bits modes and full-duplex, but only > > > in one mode due to USB altesttings. > > > To be more precise if you are playing some audio stream at 44.1 kHz, 16-bits, > > > you can only capture data at 44.1 kHz and 16-bits, for example. > > > The Windows' driver uses some kind of implicit conversion for > > > playback/capture, so that it uses only 48 kHz, 24-bit mode (unless you use a > > > program to switch). > > > Do you think I should use such a compromise too or go on another way? > > > > The condition can be restricted via hw_constraints in ALSA. > > When a playback (or a capture) is opened first, the driver remembers > > the parameter. At the secondary open of another side, call > > snd_pcm_hw_constraint_*() additionally to restrict the PCM > > parameters to be accepted. > > > > Takashi [Added alsa-devel back to Cc] > That's not the point of the question. Probably I'm not a good English speaker > and writer, but I'll try to make you understand the same. > Think about what happens perhaps in a recording studio: some output (a tick or > something like that) is sent to a pair of hearphones and, while listening, you > have to play your instrument for recording. > Suppose that the tick is in 44.1 kHz 16-bits format. If you start playing it > and then you want to record, this sound card lets you do it only at the > current playback bit/sample-rate (this is due to altsettings of the card). > So I noticed that the Windows' driver (or some other software built in > Windows) converts every output sent to the card in 48 kHz 24-bits format, in > order to be able to record always at the maximum rate. Then you can obviously > do downsampling if you want. > I was asking you whether I should do like Windows do (in the ALSA world I > think it means "use 48 kHz 24-bits only format", then ALSA does the > conversions) or not. It's your choice, but I vote for allowing multiple formats. The native support of 16 bit is preferred in some cases. The software conversion of 24bit format may cost much on an old slow machine. > Right now I did the first way, but now I've got another (strange) problem with > ALSA. > 48 kHz 24-bits output mostly works, but when I need a conversion (for example > playing a 44.1 kHz 16-bits file), even using plughw:x it says me that no > sample format is available. I used S24_3LE, 48 kHz, 24-bits, stereo as the > only format supported in hw_params struct. That's weird. Do you use the latest ALSA lib? > But that's not all. I've got some strange underruns before the file is > actually played, and I noticed that the trigger function is called many times > before the actual data transfer (commands START and STOP alternated). > However I'm going to put source files on sf.net as soon as they open a space > for this project, so that such things can be better discussed. > If, anyway, you know something about these things please let me know Please _post_ your source code to ALSA devel ML if you want debugs/reviews together with us. Keeping a forked stuff on sf really sucks. thanks, Takashi ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642