* USB card @48kHz only: at what layer to resample?
@ 2006-09-24 14:27 enrico_groups
2006-09-24 14:32 ` Markus Rechberger
2006-09-24 15:12 ` [Alsa-user] " Bill Unruh
0 siblings, 2 replies; 10+ messages in thread
From: enrico_groups @ 2006-09-24 14:27 UTC (permalink / raw)
To: alsa-user, alsa-devel
Dear All,
Apologies in advance if I am asking a stupid question, I am quite new with alsa. I posting to both lists because I am not sure about handling this issue at the application development level or at the alsa driver configuration level.
I am developing an audio application using the CCRMA synthesis tool-kit (STK) in Fedora Core4 using alsa. I recently bought a Terratec Aureon 5.1 USB MKII card, because I needed to have better sound quality than what offered by my laptop.
My understanding is that the usb card only works at 48kHz -- is this correct?
I manage to get aplay to work using the following plugin in /etc/asound.conf
pcm.!default {
type plug
slave {
pcm "hw:2,0"
rate 48000
}
}
However, in SKT I can enumerate the audio cards on my machine, but this does not give me alsa plugins, only the audio cards. If I try to open the Aureon at 44.1kHz, I get an error saying rate not supported.
Is there any way to have alsa handle the rate conversion for me? Shouldn't or couldn't the driver take care of this? (Was it my mistake in installing the driver? I can post my /etc/modprobe.conf if it helps)
Or is there any way to get STK to see the plugin?
Thank you in advance,
Enrico
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: USB card @48kHz only: at what layer to resample?
2006-09-24 14:27 USB card @48kHz only: at what layer to resample? enrico_groups
@ 2006-09-24 14:32 ` Markus Rechberger
2006-09-24 15:12 ` [Alsa-user] " Bill Unruh
1 sibling, 0 replies; 10+ messages in thread
From: Markus Rechberger @ 2006-09-24 14:32 UTC (permalink / raw)
To: enrico_groups@libero.it; +Cc: alsa-user, alsa-devel
Hi,
you could use the alsa rate plugin.
I used following .asoundrc for testing my driver:
pcm.au600playback {
type dmix
ipc_key 1024
ipc_perm 0777
slave {
pcm "hw:2,0"
period_time 0
period_size 96
buffer_size 1920
format S16_LE
periods 4
rate 9600
}
}
pcm.au600capture {
type rate
slave {
pcm "hw:2,1"
format S16_LE
rate 9600
}
}
pcm.duplex {
type asym
playback.pcm "au600playback"
capture.pcm "au600capture"
}
aplay -D plug:duplex <filename>
cheers,
Markus
On 9/24/06, enrico_groups@libero.it <enrico_groups@libero.it> wrote:
> Dear All,
>
> Apologies in advance if I am asking a stupid question, I am quite new with
> alsa. I posting to both lists because I am not sure about handling this
> issue at the application development level or at the alsa driver
> configuration level.
>
> I am developing an audio application using the CCRMA synthesis tool-kit
> (STK) in Fedora Core4 using alsa. I recently bought a Terratec Aureon 5.1
> USB MKII card, because I needed to have better sound quality than what
> offered by my laptop.
>
> My understanding is that the usb card only works at 48kHz -- is this
> correct?
> I manage to get aplay to work using the following plugin in /etc/asound.conf
> pcm.!default {
> type plug
> slave {
> pcm "hw:2,0"
> rate 48000
> }
> }
>
> However, in SKT I can enumerate the audio cards on my machine, but this does
> not give me alsa plugins, only the audio cards. If I try to open the Aureon
> at 44.1kHz, I get an error saying rate not supported.
>
> Is there any way to have alsa handle the rate conversion for me? Shouldn't
> or couldn't the driver take care of this? (Was it my mistake in installing
> the driver? I can post my /etc/modprobe.conf if it helps)
> Or is there any way to get STK to see the plugin?
>
> Thank you in advance,
> Enrico
>
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
--
Markus Rechberger
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Alsa-user] USB card @48kHz only: at what layer to resample?
2006-09-24 14:27 USB card @48kHz only: at what layer to resample? enrico_groups
2006-09-24 14:32 ` Markus Rechberger
@ 2006-09-24 15:12 ` Bill Unruh
2006-09-24 15:28 ` Sergei Steshenko
2006-09-24 17:07 ` Lee Revell
1 sibling, 2 replies; 10+ messages in thread
From: Bill Unruh @ 2006-09-24 15:12 UTC (permalink / raw)
To: enrico_groups@libero.it; +Cc: alsa-user, alsa-devel
On Sun, 24 Sep 2006, enrico_groups@libero.it wrote:
> Dear All,
>
> Apologies in advance if I am asking a stupid question, I am quite new with alsa. I posting to both lists because I am not sure about handling this issue at the application development level or at the alsa driver configuration level.
>
> I am developing an audio application using the CCRMA synthesis tool-kit (STK) in Fedora Core4 using alsa. I recently bought a Terratec Aureon 5.1 USB MKII card, because I needed to have better sound quality than what offered by my laptop.
>
> My understanding is that the usb card only works at 48kHz -- is this correct?
> I manage to get aplay to work using the following plugin in /etc/asound.conf
> pcm.!default {
> type plug
> slave {
> pcm "hw:2,0"
> rate 48000
> }
> }
>
> However, in SKT I can enumerate the audio cards on my machine, but this does not give me alsa plugins, only the audio cards. If I try to open the Aureon at 44.1kHz, I get an error saying rate not supported.
>
> Is there any way to have alsa handle the rate conversion for me? Shouldn't or couldn't the driver take care of this? (Was it my mistake in installing the driver? I can post my /etc/modprobe.conf if it helps)
> Or is there any way to get STK to see the plugin?
This is audio card insanity. All CDs are at 44100 but for some reason many
card manufacturers designed their cards to run at 48000. This is a real
problem since this requires rate conversion. Rate conversion is in general
a very very noisy operation. In particular simple linear interpolation,
which is quick, is also really really terrible for sound quality.
If you want to see some tests using the sox rate conversion facilities, see
www.theory.physics.ubc.ca/soundcard/resample.html
Ie, you would be far far better off, rather than using an alsa rate
conversion, to use say sox to do the rate conversion for you (using either
resample or polyphase) and then play that through your 48000 card. Ie, why
in the world would you buy a really good sound card and then feed it crap.
As far as I know, the alsa conversion facilities are still primative
although discussions are there to improve it.
(I suspect the rate conversion in Windows is also crap, but do not know.)
See the discussion in
http://www.hydrogenaudio.org/forums/index.php?showtopic=47591
The problem with using good samplerate conversion is that it is expensive
in processor time.
>
> Thank you in advance,
> Enrico
>
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>
--
William G. Unruh | Canadian Institute for| Tel: +1(604)822-3273
Physics&Astronomy | Advanced Research | Fax: +1(604)822-5324
UBC, Vancouver,BC | Program in Cosmology | unruh@physics.ubc.ca
Canada V6T 1Z1 | and Gravity | www.theory.physics.ubc.ca/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: USB card @48kHz only: at what layer to resample?
2006-09-24 15:12 ` [Alsa-user] " Bill Unruh
@ 2006-09-24 15:28 ` Sergei Steshenko
2006-09-25 6:35 ` [Alsa-user] " Marc Brooker
2006-09-24 17:07 ` Lee Revell
1 sibling, 1 reply; 10+ messages in thread
From: Sergei Steshenko @ 2006-09-24 15:28 UTC (permalink / raw)
To: Bill Unruh; +Cc: alsa-user, alsa-devel
On Sun, 24 Sep 2006 08:12:09 -0700 (PDT)
Bill Unruh <unruh@physics.ubc.ca> wrote:
> On Sun, 24 Sep 2006, enrico_groups@libero.it wrote:
>
> > Dear All,
> >
> > Apologies in advance if I am asking a stupid question, I am quite new with alsa. I posting to both lists because I am not sure about handling this issue at the application development level or at the alsa driver configuration level.
> >
> > I am developing an audio application using the CCRMA synthesis tool-kit (STK) in Fedora Core4 using alsa. I recently bought a Terratec Aureon 5.1 USB MKII card, because I needed to have better sound quality than what offered by my laptop.
> >
> > My understanding is that the usb card only works at 48kHz -- is this correct?
> > I manage to get aplay to work using the following plugin in /etc/asound.conf
> > pcm.!default {
> > type plug
> > slave {
> > pcm "hw:2,0"
> > rate 48000
> > }
> > }
> >
> > However, in SKT I can enumerate the audio cards on my machine, but this does not give me alsa plugins, only the audio cards. If I try to open the Aureon at 44.1kHz, I get an error saying rate not supported.
> >
> > Is there any way to have alsa handle the rate conversion for me? Shouldn't or couldn't the driver take care of this? (Was it my mistake in installing the driver? I can post my /etc/modprobe.conf if it helps)
> > Or is there any way to get STK to see the plugin?
>
> This is audio card insanity. All CDs are at 44100 but for some reason many
> card manufacturers designed their cards to run at 48000. This is a real
> problem since this requires rate conversion. Rate conversion is in general
> a very very noisy operation. In particular simple linear interpolation,
> which is quick, is also really really terrible for sound quality.
>
> If you want to see some tests using the sox rate conversion facilities, see
> www.theory.physics.ubc.ca/soundcard/resample.html
>
> Ie, you would be far far better off, rather than using an alsa rate
> conversion, to use say sox to do the rate conversion for you (using either
> resample or polyphase) and then play that through your 48000 card. Ie, why
> in the world would you buy a really good sound card and then feed it crap.
> As far as I know, the alsa conversion facilities are still primative
> although discussions are there to improve it.
> (I suspect the rate conversion in Windows is also crap, but do not know.)
>
>
> See the discussion in
> http://www.hydrogenaudio.org/forums/index.php?showtopic=47591
> The problem with using good samplerate conversion is that it is expensive
> in processor time.
>
>
>
> >
> > Thank you in advance,
> > Enrico
> >
> >
> >
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys -- and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Alsa-user mailing list
> > Alsa-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/alsa-user
> >
>
Takashi Iwai meant to include quality resampler into ALSA - I do not know
what the status is.
A LADSPA plugin can be created for the purpose.
Anyway, there are good quality resamplers, and they consume less than 5% CPU
even on old CPUs.
--Sergei.
--
Visit my http://appsfromscratch.berlios.de/ open source project.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Alsa-user] USB card @48kHz only: at what layer to resample?
2006-09-24 15:28 ` Sergei Steshenko
@ 2006-09-25 6:35 ` Marc Brooker
0 siblings, 0 replies; 10+ messages in thread
From: Marc Brooker @ 2006-09-25 6:35 UTC (permalink / raw)
To: alsa-devel
On 9/24/06, Sergei Steshenko <steshenko_sergei@list.ru> wrote:
>
> Takashi Iwai meant to include quality resampler into ALSA - I do not know
> what the status is.
The resample plugin, written by Takashi Iwai, enables high quality
resampling in ALSA. You need to install the plugin (it's included in
the 1.0.11 and higher source, but most distros don't package it yet)
and add a line to either alsa.conf or .asoundrc enabling it.
Takashi's plugin (which uses libsamplerate) performs very well,
especially when compared to the standard rate converter included in
ALSA. I would recommend it if you are doing any sort of resampling
operation.
In my opinion, it should be enabled by default, but that's a different
argument for a different day.
>
> A LADSPA plugin can be created for the purpose.
>
> Anyway, there are good quality resamplers, and they consume less than 5% CPU
> even on old CPUs.
>
> --Sergei.
>
> --
> Visit my http://appsfromscratch.berlios.de/ open source project.
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
>
--
Increasingly, people seem to misinterpret complexity as
sophistication, which is baffling — the incomprehensible should cause
suspicion rather than admiration - Niklaus Wirth
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Alsa-user] USB card @48kHz only: at what layer to resample?
2006-09-24 15:12 ` [Alsa-user] " Bill Unruh
2006-09-24 15:28 ` Sergei Steshenko
@ 2006-09-24 17:07 ` Lee Revell
2006-09-25 20:51 ` David Greaves
1 sibling, 1 reply; 10+ messages in thread
From: Lee Revell @ 2006-09-24 17:07 UTC (permalink / raw)
To: Bill Unruh; +Cc: alsa-user, alsa-devel
On Sun, 2006-09-24 at 08:12 -0700, Bill Unruh wrote:
> This is audio card insanity. All CDs are at 44100 but for some reason
> many card manufacturers designed their cards to run at 48000. This is
> a real problem since this requires rate conversion. Rate conversion is
> in general a very very noisy operation. In particular simple linear
> interpolation, which is quick, is also really really terrible for
> sound quality.
>
DVDs use 48000. But I seem to recall vendors shipping 48Khz-only cards
before playing DVD on a computer was common...
Lee
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Alsa-user] USB card @48kHz only: at what layer to resample?
2006-09-24 17:07 ` Lee Revell
@ 2006-09-25 20:51 ` David Greaves
2006-09-25 21:05 ` [Alsa-devel] " Sergei Steshenko
0 siblings, 1 reply; 10+ messages in thread
From: David Greaves @ 2006-09-25 20:51 UTC (permalink / raw)
To: Lee Revell; +Cc: alsa-user, Bill Unruh, alsa-devel
Lee Revell wrote:
> On Sun, 2006-09-24 at 08:12 -0700, Bill Unruh wrote:
>> This is audio card insanity. All CDs are at 44100 but for some reason
>> many card manufacturers designed their cards to run at 48000. This is
>> a real problem since this requires rate conversion. Rate conversion is
>> in general a very very noisy operation. In particular simple linear
>> interpolation, which is quick, is also really really terrible for
>> sound quality.
>>
>
> DVDs use 48000. But I seem to recall vendors shipping 48Khz-only cards
> before playing DVD on a computer was common...
>
> Lee
Wasn't it DAT that set the standard at 48000 - and CDs were made incompatible at
44.1 kHz to prevent digital copying...
David
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Alsa-devel] USB card @48kHz only: at what layer to resample?
2006-09-25 20:51 ` David Greaves
@ 2006-09-25 21:05 ` Sergei Steshenko
0 siblings, 0 replies; 10+ messages in thread
From: Sergei Steshenko @ 2006-09-25 21:05 UTC (permalink / raw)
To: David Greaves; +Cc: alsa-user, Lee Revell, alsa-devel, Bill Unruh
On Mon, 25 Sep 2006 21:51:17 +0100
David Greaves <david@dgreaves.com> wrote:
> Lee Revell wrote:
> > On Sun, 2006-09-24 at 08:12 -0700, Bill Unruh wrote:
> >> This is audio card insanity. All CDs are at 44100 but for some reason
> >> many card manufacturers designed their cards to run at 48000. This is
> >> a real problem since this requires rate conversion. Rate conversion is
> >> in general a very very noisy operation. In particular simple linear
> >> interpolation, which is quick, is also really really terrible for
> >> sound quality.
> >>
> >
> > DVDs use 48000. But I seem to recall vendors shipping 48Khz-only cards
> > before playing DVD on a computer was common...
> >
> > Lee
>
> Wasn't it DAT that set the standard at 48000 - and CDs were made incompatible at
> 44.1 kHz to prevent digital copying...
>
> David
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>
44100Hz sampling rate was one of the most idiotic decisions I ever
saw - read about the necessary LPF filter orders, pulse smudging,
etc. because of closeness of Nyquist frequency (22050Hz) to the top
audio frequency (20000Hz).
There is much more mercy in 48000Hz sampling frequency from all the above
points of view.
--Sergei.
--
Visit my http://appsfromscratch.berlios.de/ open source project.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: USB card @48kHz only: at what layer to resample?
@ 2006-09-24 16:41 enrico_groups
2006-09-24 17:02 ` [Alsa-user] " Lee Revell
0 siblings, 1 reply; 10+ messages in thread
From: enrico_groups @ 2006-09-24 16:41 UTC (permalink / raw)
To: mrechberger; +Cc: alsa-user, alsa-devel
Thanks Markus and all for the replies.
My problem is that STK does not seem able to see the alsa plugins.
In other words, when one uses -say- aplay it is possible to specify what device or plugin to use with the -D option, for example:
-D plug:duplex
as you suggest in the example.
In the STK api for alsa I can only select one of the audio cards, in my case I see the following 4:
hw:I82801CAICH3,0
hw:I82801CAICH3,1
hw:U0x4710x311,0
hw:Audio,0
The first two seem to be related to the built-in laptop sound card (intel chip based) (why 2 entries???), the third one is probably the mic input of the webcam and the last one is my terratec.
I can only select one of these by number (i.e. I can select 1, 2, 3 or 4)
If I try to open the last one at 44.1kHz I get:
RtApi: unable to open specified device(s) with given stream parameters:
RtApiAlsa: error setting sample rate (44100) on device (hw:Audio,0): Invalid argument.
If I open it at 48kHz it is fine.
In general, from the discussion I understand that the best (but probably long term for me) solution is to change my code to work at 48kHz, but for now it's really important to get the old code to work.
Does this make any sense?
Any suggestions?
Thanks,
Enrico
---------- Initial Header -----------
>From : "Markus Rechberger" mrechberger@gmail.com
To : "enrico_groups@libero.it" enrico_groups@libero.it
Cc : "alsa-user" alsa-user@lists.sourceforge.net,"alsa-devel" alsa-devel@lists.sourceforge.net
Date : Sun, 24 Sep 2006 16:32:23 +0200
Subject : Re: [Alsa-devel] USB card @48kHz only: at what layer to resample?
> Hi,
>
> you could use the alsa rate plugin.
>
> I used following .asoundrc for testing my driver:
>
> pcm.au600playback {
> type dmix
> ipc_key 1024
> ipc_perm 0777
> slave {
> pcm "hw:2,0"
> period_time 0
> period_size 96
> buffer_size 1920
> format S16_LE
> periods 4
> rate 9600
> }
> }
>
> pcm.au600capture {
> type rate
> slave {
> pcm "hw:2,1"
> format S16_LE
> rate 9600
> }
> }
> pcm.duplex {
> type asym
> playback.pcm "au600playback"
> capture.pcm "au600capture"
> }
>
> aplay -D plug:duplex <filename>
>
> cheers,
> Markus
>
> On 9/24/06, enrico_groups@libero.it <enrico_groups@libero.it> wrote:
> > Dear All,
> >
> > Apologies in advance if I am asking a stupid question, I am quite new with
> > alsa. I posting to both lists because I am not sure about handling this
> > issue at the application development level or at the alsa driver
> > configuration level.
> >
> > I am developing an audio application using the CCRMA synthesis tool-kit
> > (STK) in Fedora Core4 using alsa. I recently bought a Terratec Aureon 5.1
> > USB MKII card, because I needed to have better sound quality than what
> > offered by my laptop.
> >
> > My understanding is that the usb card only works at 48kHz -- is this
> > correct?
> > I manage to get aplay to work using the following plugin in /etc/asound.conf
> > pcm.!default {
> > type plug
> > slave {
> > pcm "hw:2,0"
> > rate 48000
> > }
> > }
> >
> > However, in SKT I can enumerate the audio cards on my machine, but this does
> > not give me alsa plugins, only the audio cards. If I try to open the Aureon
> > at 44.1kHz, I get an error saying rate not supported.
> >
> > Is there any way to have alsa handle the rate conversion for me? Shouldn't
> > or couldn't the driver take care of this? (Was it my mistake in installing
> > the driver? I can post my /etc/modprobe.conf if it helps)
> > Or is there any way to get STK to see the plugin?
> >
> > Thank you in advance,
> > Enrico
> >
> >
> >
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys -- and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/alsa-devel
> >
>
>
> --
> Markus Rechberger
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Alsa-user] USB card @48kHz only: at what layer to resample?
2006-09-24 16:41 enrico_groups
@ 2006-09-24 17:02 ` Lee Revell
0 siblings, 0 replies; 10+ messages in thread
From: Lee Revell @ 2006-09-24 17:02 UTC (permalink / raw)
To: enrico_groups@libero.it; +Cc: alsa-user, mrechberger, alsa-devel
On Sun, 2006-09-24 at 18:41 +0200, enrico_groups@libero.it wrote:
> Thanks Markus and all for the replies.
>
> My problem is that STK does not seem able to see the alsa plugins.
>
> In other words, when one uses -say- aplay it is possible to specify what device or plugin to use with the -D option, for example:
> -D plug:duplex
> as you suggest in the example.
>
> In the STK api for alsa I can only select one of the audio cards, in my case I see the following 4:
>
> hw:I82801CAICH3,0
> hw:I82801CAICH3,1
> hw:U0x4710x311,0
> hw:Audio,0
>
> The first two seem to be related to the built-in laptop sound card (intel chip based) (why 2 entries???)
Probably analog and SPDIF.
> , the third one is probably the mic input of the webcam and the last one is my terratec.
> I can only select one of these by number (i.e. I can select 1, 2, 3 or 4)
>
This is an incorrect use of the ALSA API by STK (It doesn't help that
ALSA has no good device enumeration API). It should allow you to choose
plughw:* devices, but it only lists hw:* devices. This means that only
sample rates supported by the hardware can be chosen.
> If I try to open the last one at 44.1kHz I get:
> RtApi: unable to open specified device(s) with given stream parameters:
> RtApiAlsa: error setting sample rate (44100) on device (hw:Audio,0): Invalid argument.
>
> If I open it at 48kHz it is fine.
>
> In general, from the discussion I understand that the best (but probably long term for me) solution is to change my code to work at 48kHz, but for now it's really important to get the old code to work.
>
You just need to patch STK to allow plughw devices to be used, or give
up and run at 48Khz. There's no other solution.
> Does this make any sense?
> Any suggestions?
>
> Thanks,
> Enrico
>
> ---------- Initial Header -----------
>
> >From : "Markus Rechberger" mrechberger@gmail.com
> To : "enrico_groups@libero.it" enrico_groups@libero.it
> Cc : "alsa-user" alsa-user@lists.sourceforge.net,"alsa-devel" alsa-devel@lists.sourceforge.net
> Date : Sun, 24 Sep 2006 16:32:23 +0200
> Subject : Re: [Alsa-devel] USB card @48kHz only: at what layer to resample?
>
>
>
>
>
>
>
> > Hi,
> >
> > you could use the alsa rate plugin.
> >
> > I used following .asoundrc for testing my driver:
> >
> > pcm.au600playback {
> > type dmix
> > ipc_key 1024
> > ipc_perm 0777
> > slave {
> > pcm "hw:2,0"
> > period_time 0
> > period_size 96
> > buffer_size 1920
> > format S16_LE
> > periods 4
> > rate 9600
> > }
> > }
> >
> > pcm.au600capture {
> > type rate
> > slave {
> > pcm "hw:2,1"
> > format S16_LE
> > rate 9600
> > }
> > }
> > pcm.duplex {
> > type asym
> > playback.pcm "au600playback"
> > capture.pcm "au600capture"
> > }
> >
> > aplay -D plug:duplex <filename>
> >
> > cheers,
> > Markus
> >
> > On 9/24/06, enrico_groups@libero.it <enrico_groups@libero.it> wrote:
> > > Dear All,
> > >
> > > Apologies in advance if I am asking a stupid question, I am quite new with
> > > alsa. I posting to both lists because I am not sure about handling this
> > > issue at the application development level or at the alsa driver
> > > configuration level.
> > >
> > > I am developing an audio application using the CCRMA synthesis tool-kit
> > > (STK) in Fedora Core4 using alsa. I recently bought a Terratec Aureon 5.1
> > > USB MKII card, because I needed to have better sound quality than what
> > > offered by my laptop.
> > >
> > > My understanding is that the usb card only works at 48kHz -- is this
> > > correct?
> > > I manage to get aplay to work using the following plugin in /etc/asound.conf
> > > pcm.!default {
> > > type plug
> > > slave {
> > > pcm "hw:2,0"
> > > rate 48000
> > > }
> > > }
> > >
> > > However, in SKT I can enumerate the audio cards on my machine, but this does
> > > not give me alsa plugins, only the audio cards. If I try to open the Aureon
> > > at 44.1kHz, I get an error saying rate not supported.
> > >
> > > Is there any way to have alsa handle the rate conversion for me? Shouldn't
> > > or couldn't the driver take care of this? (Was it my mistake in installing
> > > the driver? I can post my /etc/modprobe.conf if it helps)
> > > Or is there any way to get STK to see the plugin?
> > >
> > > Thank you in advance,
> > > Enrico
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > > opinions on IT & business topics through brief surveys -- and earn cash
> > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > _______________________________________________
> > > Alsa-devel mailing list
> > > Alsa-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/alsa-devel
> > >
> >
> >
> > --
> > Markus Rechberger
> >
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Alsa-user] USB card @48kHz only: at what layer to resample?
@ 2006-09-24 21:48 enrico_groups
0 siblings, 0 replies; 10+ messages in thread
From: enrico_groups @ 2006-09-24 21:48 UTC (permalink / raw)
To: rlrevell; +Cc: alsa-user, mrechberger, alsa-devel, stk
Hi Lee,
> You just need to patch STK to allow plughw devices to be used, or give
> up and run at 48Khz. There's no other solution.
Thanks for the concise and clear answer.
I decided to change my code and run at 48kHz.
I am now facing a new problem. If I run at 48kHz with the old soundcard everything works fine. If I switch to the Terratec I get quite some problems. The system slows down a lot, things got better switching the module param nrpacks=1 and making the buffer larger, but it still clicks and the system is still very slow.
I am currently using the blocking version of the STK real-time audio classes. Despite the fact that I have them in a separate threads, the new card is slowing also the other threads. Shall I consider switching to the non-blocking callback methods? If so, why?
What else shall I look at to make my system perform normally?
I'll be happy to provide more info if that helps.
Thanks,
Enrico
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-09-25 21:05 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-24 14:27 USB card @48kHz only: at what layer to resample? enrico_groups
2006-09-24 14:32 ` Markus Rechberger
2006-09-24 15:12 ` [Alsa-user] " Bill Unruh
2006-09-24 15:28 ` Sergei Steshenko
2006-09-25 6:35 ` [Alsa-user] " Marc Brooker
2006-09-24 17:07 ` Lee Revell
2006-09-25 20:51 ` David Greaves
2006-09-25 21:05 ` [Alsa-devel] " Sergei Steshenko
-- strict thread matches above, loose matches on Subject: below --
2006-09-24 16:41 enrico_groups
2006-09-24 17:02 ` [Alsa-user] " Lee Revell
2006-09-24 21:48 enrico_groups
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.