hw/plughw strange behaviour
Hi,
I have a problem using the plughw device with slave the hw:0,0 device: a pcm in an AWE 64 Gold. When invoking snd_pcm_hw_params on plughw:0,0 I get an 'Invalid argument' error (-22). However, running the same program directly on hw:0,0 works fine. Also, both versions run without complaints in another PC with a VIA686A (but when adding a simple sinusoidal wave playback test, hw and plughw sound with different pitch, suggesting a problem with frequencies perhaps due to conversions having place in plughw). Both PCs are running Mandrake 10, which provides:
linux-2.6.3-7mdk
libalsa2-1.0.2-3mdk
Below are the source code for the program and the output of running it, first with hw:0,0, then using plughw:0,0, for the AWE 64 Gold.
Thank you in advace.
Regards,
Carlos.
test-alsa.c
-----------
#include <stdio.h>
#include <alsa/asoundlib.h>
int main() {
snd_pcm_t *handle;
snd_pcm_hw_params_t *hwparams;
#define device "hw:0,0" //#define device "plughw:0,0" #define requested_rate 44100 int rate = requested_rate; int dir = 1; /* exact_rate > rate => dir = 1 */ #define numchannels 2 #define numperiods 2 #define periodsize (8192 / 4) #define requested_buffersize (numperiods * periodsize) snd_pcm_uframes_t buffersize = requested_buffersize;
int errnum;
snd_output_t *output;
snd_pcm_open(&handle, "plughw:0,0", SND_PCM_STREAM_PLAYBACK, 0);
/* set hw params */
snd_pcm_hw_params_malloc(&hwparams); snd_pcm_hw_params_any(handle, hwparams); snd_pcm_hw_params_set_access(handle, hwparams,SND_PCM_ACCESS_RW_INTERLEAVED);
snd_pcm_hw_params_set_format(handle, hwparams, SND_PCM_FORMAT_S16_LE); snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &dir); printf("Rate = %d, requested rate = %d.\n", rate, requested_rate); snd_pcm_hw_params_set_channels(handle, hwparams, numchannels); snd_pcm_hw_params_set_periods(handle, hwparams, numperiods, 0); snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffersize); printf("Buffer size: %d, requested buffer size: %d.\n", buffersize,requested_buffersize);
if ((errnum = snd_pcm_hw_params(handle, hwparams)) < 0) {
fprintf(stderr, "Error (%d) setting parameters: %s.\n", errnum,
snd_strerror(errnum));
return(-1); }
snd_pcm_hw_params_free(hwparams);
/* dump device */ snd_output_stdio_attach(&output, stdout, 0); snd_pcm_dump_hw_setup(handle, output); fflush(stdout); // play(handle, periodsize);
snd_pcm_close(handle);
}
Output for hw:0,0
-----------------
Rate = 44100, requested rate = 44100.
Buffer size: 4096, requested buffer size: 4096.
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16buffer_size : 4096period_size : 2048period_time : 46439tick_time : 1000
Output for plughw:0,0
---------------------
Rate = 44100, requested rate = 44100.
Buffer size: 4096, requested buffer size: 4096.
Error (-22) setting parameters: Invalid argument.
-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
Quoted 11 lines · Carlos Pita
I have a problem using the plughw device with slave the hw:0,0 device: a pcm in an AWE 64 Gold. When invoking
snd_pcm_hw_paramson plughw:0,0 I get an 'Invalid argument' error (-22). However, running the same program directly on hw:0,0 works fine.snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); snd_pcm_hw_params_set_format(handle, hwparams, SND_PCM_FORMAT_S16_LE); snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &dir); snd_pcm_hw_params_set_channels(handle, hwparams, numchannels); snd_pcm_hw_params_set_periods(handle, hwparams, numperiods, 0); snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffersize);
Does any of these calls return an error?
Regards,
Clemens
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
Quoted 1 line
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504
Quoted 7 lines
Quoted 2 lines
snd_pcm_hw_params_set_access(handle, hwparams,
SND_PCM_ACCESS_RW_INTERLEAVED);Quoted 1 line
snd_pcm_hw_params_set_format(handle, hwparams,
SND_PCM_FORMAT_S16_LE);Quoted 1 line
snd_pcm_hw_params_set_rate_near(handle,
hwparams, &rate, &dir);
Quoted 9 lines
Quoted 1 line
snd_pcm_hw_params_set_channels(handle,
hwparams, numchannels);
Quoted 1 line
snd_pcm_hw_params_set_periods(handle, hwparams,
numperiods, 0);
Quoted 1 line
snd_pcm_hw_params_set_buffer_size_near(handle,
hwparams, &buffersize);
Does any of these calls return an error?
No, I have stripped out error checking code for brevity purposes; but none of the snd_pc_hw_params_set_XXX invokations return an error, just snd_pc_hw_params do it, as I described in my previous post.
Regards,
Carlos
------------
Los mejores usados y las más tentadoras
ofertas de 0km están en Yahoo! Autos.
Comprá o vendé tu auto en
http://autos.yahoo.com.ar
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
Quoted 1 line
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504
Re: a bug? (was: hw/plughw strange behaviour)
Playing a little with the code that produced the strange behaviour I reported in my previous posts in this thread I discovered this potential bug (in my code or in alsalib?, that's the question):
1) In alsa/pcm.h, snd_pcm_hw_params_set_rate_near is declared as:
int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm,
snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
(Here I'm not sure if dir is an output, an input or an inout param. Doxygen doc is rather vague about this.)
2) When handle corresponds to the "hw:0,0" device any of the next invocations work fine:
a) dir is NULL:
snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, 0);
b) dir is an int = 0:
snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &dir);
c) dir is an int = 1:
snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &dir);3) But when handle corresponds to the "plughw:0,0" device the third invocation fails (well, to be precise, it doesn't fail until snd_pcm_hw_params is called -see my previous posts in this thread-).
4) I've attached an example test to this post which tries to snd_pcm_hw_params using any of the following 6 combinations:
device is dir is dir value is
-------------------------------------------------
hw:0,0 NULL ?
plughw:0,0 NULL ?
hw:0,0 a pointer 0
plughw:0,0 a pointer 0
hw:0,0 a pointer 1
plughw:0,0 a pointer 1The output of running it is:
Settings params for 'hw:0,0', dir is NULL... Settings params for 'plughw:0,0', dir is NULL... Settings params for 'hw:0,0', dir is pointer = 0... Settings params for 'plughw:0,0', dir is pointer = 0... Settings params for 'hw:0,0', dir is pointer = 1... Settings params for 'plughw:0,0', dir is pointer = 1... Buffer time doesn't match (requested 100000us, get 100022us) Unable to set hw params for playback: Invalid argument
Just to be sure, I asked for 100022us of buffer. Then I didn't get the buffer time mismatch, but still:
Settings params for 'hw:0,0', dir is NULL... Settings params for 'plughw:0,0', dir is NULL... Settings params for 'hw:0,0', dir is pointer = 0... Settings params for 'plughw:0,0', dir is pointer = 0... Settings params for 'hw:0,0', dir is pointer = 1... Settings params for 'plughw:0,0', dir is pointer = 1... Unable to set hw params for playback: Invalid argument
Thank you in advance.
Regards,
Carlos.
#include <stdio.h>
#include <alsa/asoundlib.h>
void setparams(char *device, int dir_is_NULL, int dir_value);
int main() {
printf("Settings params for 'hw:0,0', dir is NULL...\n"); setparams("hw:0,0", 1, 0);
printf("Settings params for 'plughw:0,0', dir is NULL...\n"); setparams("plughw:0,0", 1, 0);
printf("Settings params for 'hw:0,0', dir is pointer = 0...\n"); setparams("hw:0,0", 0, 0);
printf("Settings params for 'plughw:0,0', dir is pointer = 0...\n"); setparams("plughw:0,0", 0, 0);
printf("Settings params for 'hw:0,0', dir is pointer = 1...\n"); setparams("hw:0,0", 0, 1);
printf("Settings params for 'plughw:0,0', dir is pointer = 1...\n"); setparams("plughw:0,0", 0, 1);
return 0;
}
void setparams(char *device, int dir_is_NULL, int dir_value) {
snd_pcm_t *handle;
snd_pcm_hw_params_t *hwparams;
snd_pcm_format_t format = SND_PCM_FORMAT_S16;
unsigned int rate = 44100, rrate = 44100;
unsigned int channels = 2;
unsigned int buffer_time = 200000, rbuffer_time = 200000; /* in us */
unsigned int period_time = 100000, rperiod_time = 100000; /* in us */
int err, dir;
snd_output_t *output;
snd_pcm_hw_params_alloca(&hwparams);
if ((err = snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
printf("Playback open error: %s\n", snd_strerror(err));
exit(err);
} err = snd_pcm_hw_params_any(handle, hwparams);
if (err < 0) {
printf("Broken configuration for playback: no configurations available: %s\n",
snd_strerror(err));
exit(err);}
err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0) {
printf("Access type not available for playback: %s\n", snd_strerror(err));
exit(err);
}
err = snd_pcm_hw_params_set_format(handle, hwparams, format);
if (err < 0) {
printf("Sample format not available for playback: %s\n", snd_strerror(err));
exit(err);
}
err = snd_pcm_hw_params_set_channels(handle, hwparams, channels);
if (err < 0) {
printf("Channels count (%i) not available for playbacks: %s\n", channels, snd_strerror(err));
exit(err);
}
if(dir_is_NULL) {
err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &rrate, 0);
} else {
dir = dir_value;
err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &rrate, &dir);
}
if (err < 0) {
printf("Rate %iHz not available for playback: %s\n", rate, snd_strerror(err));
exit(err);
}
if (rrate != rate) {
printf("Rate doesn't match (requested %iHz, get %iHz)\n", rrate, rate);
} if (err < 0) {
printf("Unable to set buffer time %i for playback: %s\n",
buffer_time, snd_strerror(err));
exit(err); }
if (rbuffer_time != buffer_time) {
printf("Buffer time doesn't match (requested %ius, get %ius)\n",
rbuffer_time, buffer_time);
}
err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, &period_time, &dir);
if (err < 0) {
printf("Unable to set period time %i for playback: %s\n",
period_time, snd_strerror(err));
exit(err); }
if (rperiod_time != period_time) {
printf("Buffer time doesn't match (requested %ius, get %ius)\n",
rperiod_time, period_time);
}
err = snd_pcm_hw_params(handle, hwparams);
if (err < 0) {
printf("Unable to set hw params for playback: %s\n", snd_strerror(err));
exit(err);
}
snd_pcm_close(handle); return;
}
Re: a bug? (was: hw/plughw strange behaviour)
Quoted 4 lines · Carlos Pita
Playing a little with the code that produced the strange behaviour I reported in my previous posts in this thread I discovered this potential bug (in my code or in alsalib?, that's the question):
Quoted 8 lines
1) In
alsa/pcm.h,snd_pcm_hw_params_set_rate_nearis declared as:int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm,
snd_pcm_hw_params_t*params, unsigned int *val, int *dir);(Here I'm not sure if dir is an output, an input or an inout param.
Both.
Quoted 6 lines
c) dir is an int = 1:
snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &dir);3) But when handle corresponds to the "plughw:0,0" device the third invocation fails (well, to be precise, it doesn't fail until
snd_pcm_hw_paramsis called -see my previous posts in this thread-).
Please add a call to snd_pcm_hw_params_dump() before snd_pcm_hw_params(). What is the difference between the configuration that fails and the others?
Quoted 1 line
4) I've attached an example test to this post
It seems the call to set_buffer_size is missing.
And it reuses the dir value returned by set_rate_near for the set_period_time_near call.
Regards,
Clemens
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
Quoted 1 line
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504
Re: a bug? (was: hw/plughw strange behaviour)
Quoted 3 lines
Please add a call to
snd_pcm_hw_params_dump()beforesnd_pcm_hw_params(). What is the difference between the configuration that fails and the others?
Ok. Attached to this email, I'm sending you the output and the code for the revised (according to your observations) program.
Quoted 3 lines
Quoted 1 line
4) I've attached an example test to this post
It seems the call to
set_buffer_sizeis missing.
Yep. It probably have been erased during a last time editing before posting the code. Anyway my binary was compiled from the correct source.
Quoted 2 lines
And it reuses the dir value returned by
set_rate_nearfor theset_period_time_nearcall.
Mmmm. I've fixed this issue setting dir to 1 before calling set_period_time_near and set_buffer_time_near.
Anyway, the problem remains.
Regards,
Carlos.
Settings params for 'hw:0,0', dir is NULL...
********************************************
Dump of hwparams
----------------
ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 44100 PERIOD_TIME: 100000 PERIOD_SIZE: 4410 PERIOD_BYTES: 17640 PERIODS: 2 BUFFER_TIME: 200000 BUFFER_SIZE: 8820 BUFFER_BYTES: 35280 TICK_TIME: 1000
Dump of device setup
--------------------
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16buffer_size : 8820period_size : 4410period_time : 100000tick_time : 1000
Settings params for 'plughw:0,0', dir is NULL...
************************************************
Dump of hwparams
----------------
ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 44100 PERIOD_TIME: 100000 PERIOD_SIZE: 4410 PERIOD_BYTES: 17640 PERIODS: 2 BUFFER_TIME: 200000 BUFFER_SIZE: 8820 BUFFER_BYTES: 35280 TICK_TIME: 1000
Dump of device setup
--------------------
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16buffer_size : 8820period_size : 4410period_time : 100000tick_time : 1000
Settings params for 'hw:0,0', dir is pointer = 0...
***************************************************
Dump of hwparams
----------------
ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 44100 PERIOD_TIME: 100000 PERIOD_SIZE: 4410 PERIOD_BYTES: 17640 PERIODS: 2 BUFFER_TIME: 200000 BUFFER_SIZE: 8820 BUFFER_BYTES: 35280 TICK_TIME: 1000
Dump of device setup
--------------------
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16buffer_size : 8820period_size : 4410period_time : 100000tick_time : 1000
Settings params for 'plughw:0,0', dir is pointer = 0...
*******************************************************
Dump of hwparams
----------------
ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 44100 PERIOD_TIME: 100000 PERIOD_SIZE: 4410 PERIOD_BYTES: 17640 PERIODS: 2 BUFFER_TIME: 200000 BUFFER_SIZE: 8820 BUFFER_BYTES: 35280 TICK_TIME: 1000
Dump of device setup
--------------------
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16buffer_size : 8820period_size : 4410period_time : 100000tick_time : 1000
Settings params for 'hw:0,0', dir is pointer = 1...
***************************************************
Dump of hwparams
----------------
ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: 44100 PERIOD_TIME: 100000 PERIOD_SIZE: 4410 PERIOD_BYTES: 17640 PERIODS: 2 BUFFER_TIME: 200000 BUFFER_SIZE: 8820 BUFFER_BYTES: 35280 TICK_TIME: 1000
Dump of device setup
--------------------
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16buffer_size : 8820period_size : 4410period_time : 100000tick_time : 1000
Settings params for 'plughw:0,0', dir is pointer = 1...
*******************************************************
Buffer time doesn't match (requested 200000us, get 199999us) Period time doesn't match (requested 100000us, get 100022us)
Dump of hwparams
----------------
ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD SAMPLE_BITS: 16 FRAME_BITS: 32 CHANNELS: 2 RATE: (44100 44101) PERIOD_TIME: (100022 100023) PERIOD_SIZE: 4411 PERIOD_BYTES: 17644 PERIODS: (1 2) BUFFER_TIME: (199999 200000) BUFFER_SIZE: 8820 BUFFER_BYTES: 35280 TICK_TIME: 1000
Unable to set hw params for playback: Invalid argument
#include <stdio.h>
#include <alsa/asoundlib.h>
void setparams(char *device, int dir_is_NULL, int dir_value);
int main() {
printf("\nSettings params for 'hw:0,0', dir is NULL...\n"); printf("********************************************\n\n"); setparams("hw:0,0", 1, 0);
printf("\nSettings params for 'plughw:0,0', dir is NULL...\n"); printf("************************************************\n\n"); setparams("plughw:0,0", 1, 0);
printf("\nSettings params for 'hw:0,0', dir is pointer = 0...\n"); printf("***************************************************\n\n"); setparams("hw:0,0", 0, 0);
printf("\nSettings params for 'plughw:0,0', dir is pointer = 0...\n"); printf("*******************************************************\n\n"); setparams("plughw:0,0", 0, 0);
printf("\nSettings params for 'hw:0,0', dir is pointer = 1...\n"); printf("***************************************************\n\n"); setparams("hw:0,0", 0, 1);
printf("\nSettings params for 'plughw:0,0', dir is pointer = 1...\n"); printf("*******************************************************\n\n"); setparams("plughw:0,0", 0, 1);
return 0;
}
void setparams(char *device, int dir_is_NULL, int dir_value) {
snd_pcm_t *handle;
snd_pcm_hw_params_t *hwparams;
snd_pcm_format_t format = SND_PCM_FORMAT_S16;
unsigned int rate = 44100, rrate = 44100;
unsigned int channels = 2;
unsigned int buffer_time = 200000, rbuffer_time = 200000; /* in us */
unsigned int period_time = 100000, rperiod_time = 100000; /* in us */
int err, dir;
snd_output_t *output;
snd_pcm_hw_params_alloca(&hwparams);
if ((err = snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) {
printf("Playback open error: %s\n", snd_strerror(err));
exit(err);
} err = snd_pcm_hw_params_any(handle, hwparams);
if (err < 0) {
printf("Broken configuration for playback: no configurations available: %s\n",
snd_strerror(err));
exit(err);}
err = snd_pcm_hw_params_set_access(handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0) {
printf("Access type not available for playback: %s\n", snd_strerror(err));
exit(err);
}
err = snd_pcm_hw_params_set_format(handle, hwparams, format);
if (err < 0) {
printf("Sample format not available for playback: %s\n", snd_strerror(err));
exit(err);
}
err = snd_pcm_hw_params_set_channels(handle, hwparams, channels);
if (err < 0) {
printf("Channels count (%i) not available for playbacks: %s\n", channels, snd_strerror(err));
exit(err);
}
if(dir_is_NULL) {
err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &rrate, 0);
} else {
dir = dir_value;
err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &rrate, &dir);
}
if (err < 0) {
printf("Rate %iHz not available for playback: %s\n", rate, snd_strerror(err));
exit(err);
}
if (rrate != rate) {
printf("Rate doesn't match (requested %iHz, get %iHz)\n", rrate, rate);
} dir = 0;
err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, &buffer_time, &dir);
if (err < 0) {
printf("Unable to set buffer time %i for playback: %s\n",
buffer_time, snd_strerror(err));
exit(err); }
if (rbuffer_time != buffer_time) {
printf("Buffer time doesn't match (requested %ius, get %ius)\n",
rbuffer_time, buffer_time);
}
dir = 0;
err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, &period_time, &dir);
if (err < 0) {
printf("Unable to set period time %i for playback: %s\n",
period_time, snd_strerror(err));
exit(err); }
if (rperiod_time != period_time) {
printf("Period time doesn't match (requested %ius, get %ius)\n",
rperiod_time, period_time);
}
snd_output_stdio_attach(&output, stdout, 0);
printf("\nDump of hwparams\n");
printf("----------------\n\n");
snd_pcm_hw_params_dump(hwparams, output);
err = snd_pcm_hw_params(handle, hwparams);
if (err < 0) {
printf("Unable to set hw params for playback: %s\n", snd_strerror(err));
exit(err);
}
printf("\nDump of device setup\n");
printf("--------------------\n\n");
snd_pcm_dump_hw_setup(handle, output);
fflush(stdout);
snd_pcm_close(handle); return;
}
Re: a bug? (was: hw/plughw strange behaviour)
Quoted 1 line · Carlos Pita
Anyway, the problem remains.
It works on my hardware, if I use an AC'97 codec (AD1985) or a YMF754 card:
Settings params for 'hw:0,0', dir is pointer = 1... Buffer time doesn't match (requested 200000us, get 199999us) Period time doesn't match (requested 100000us, get 99999us)
Dump of hwparams
----------------
RATE: (44100 44101)PERIOD_TIME: (99999 100000)PERIOD_SIZE: 4410
PERIODS: 2BUFFER_TIME: (199999 200000)BUFFER_SIZE: 8820
Dump of device setup
--------------------
rate : 44100buffer_size : 8820period_size : 4410period_time : 99999
Settings params for 'plughw:0,0', dir is pointer = 1... Buffer time doesn't match (requested 200000us, get 199999us) Period time doesn't match (requested 100000us, get 66666us)
Dump of hwparams
----------------
RATE: (44100 44101)PERIOD_TIME: (66666 66667)PERIOD_SIZE: 2940
PERIODS: 3BUFFER_TIME: (199999 200000)BUFFER_SIZE: 8820
Dump of device setup
--------------------
rate : 44100buffer_size : 8820period_size : 2940period_time : 66666
With an UA-1A (which supports 44.1 kHz only), using "hw:0,0" forces the sample rate to be exactly 44100. Using "plug:" fails:
Settings params for 'plug:ua1a', dir is pointer = 1... Buffer time doesn't match (requested 200000us, get 199999us) Period time doesn't match (requested 100000us, get 99977us)
Dump of hwparams
----------------
RATE: (44100 44101)PERIOD_TIME: (99977 99978)PERIOD_SIZE: 4409
PERIODS: (2 3)BUFFER_TIME: (199999 200000)BUFFER_SIZE: 8820
Unable to set hw params for playback: Invalid argument
It may be possible that the plug plugin tries to force that hardware to use a non-integer sample rate. Looks like a bug in the constraint (matching) code.
And why are you trying to use dir=1 anyway? Having a non-integer sample rate doesn't make much sense to me. :-)
Regards,
Clemens
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND