Skip to contentSkip to conversation

Line6 TonePort UX1 driver

DISCUSSION Stefano D Angelo 2 participants 4 messages May 8, 2006 – May 12, 2006 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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?

Stefano D'Angelo

-----------------
Registra il tuo nome di dominio su: http://www.oneonline.it/domini
One On Line ti offre domino + spazio web illimitato + 5 email + 5000 uscite banner + PHP + Link a soli Euro 15 iva compresa

-------------------------------------------------------
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

#1 lore raw

At Mon, 8 May 2006 20:16:19 +0300,

Quoted 14 lines · Stefano D Angelo

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

-------------------------------------------------------
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

#3 lore raw
In reply to a message not in the archive

At Wed, 10 May 2006 16:56:35 +0300,

Quoted 18 lines · Stefano D Angelo
Quoted 18 lines

At Mon, 8 May 2006 20:16:19 +0300,

Quoted 14 lines · Stefano D Angelo

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?

Quoted 7 lines
Quoted 7 lines

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]

Quoted 7 lines

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

Quoted 8 lines

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.

Quoted 6 lines

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?

Quoted 6 lines

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

#5 lore raw
In reply to a message not in the archive

Ok,
I attached the code to this e-mail.
I followed your suggestion, Takashi, and, as you can see, now I'm implementing all supporte formats for playback.
But another problem arouses... I'm trying to set period/buffer sizes through a rule_add, but now I can't make it work yet.
playback_copy works only for 24-bits 48000 outputs now, but now I'm going to solve the problem I just told you first.
Please, let me know and thanks for your supporting.

Stefano

-----------------
Registra il tuo nome di dominio su: http://www.oneonline.it/domini
One On Line ti offre domino + spazio web illimitato + 5 email + 5000 uscite banner + PHP + Link a soli Euro 15 iva compresa