Skip to contentSkip to conversation

Problem deducing buffer time with non-integer samplerate?

DISCUSSION Arve Knudsen 1 participant 2 messages Mar 4, 2004 – Mar 5, 2004

lore
Share & tools
lore
#0 lore raw

Hi

A PortAudio user has been experiencing a problem with his SB128 (Ensoniq AudioPCI driver), which we tracked down to a call to snd_pcm_hw_params_get_buffer_time returning -EINVAL. A dump of the current hw configuration space looks like this:

ACCESS:  MMAP_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: (44099 44100)
PERIOD_TIME: (5804 5805)
PERIOD_SIZE: 256
PERIOD_BYTES: 1024
PERIODS: 5
BUFFER_TIME: (29024 29026)
BUFFER_SIZE: 1280
BUFFER_BYTES: 5120
TICK_TIME: 10000

Is the problem that the delta between min and max BUFFER_TIME exceeds one (1)? The exact samplerate is 44099.81 which should correlate with the integer min/max values. While I'm at it, is it correct to translate samplerate fractions from 0.5 and upwards to dir == -1 and 1 for fractions less than 0.5 (ie. 44099.81 translates to 44100 with dir == -1)? There's also a "bug" in the documentation for snd_pcm_hw_params_set_buffer_size, which mentions "dir", although its not part of the function signature.

Thanks

Arve Knudsen

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click

#1 lore raw

Maybe I should add that this is after a successful call to snd_pcm_hw_params (hardwarespace configured), in case it wasn't clear. Does the driver return wrong approximation thresholds (delta > 1), or is it supposed to work this way?? I mean, can't ALSA deduce a single approximate value which can be returned?

Regards

Arve Knudsen

Quoted 19 lines · Arve Knudsen

Hi

A PortAudio user has been experiencing a problem with his SB128 (Ensoniq AudioPCI driver), which we tracked down to a call to snd_pcm_hw_params_get_buffer_time returning -EINVAL. A dump of the current hw configuration space looks like this:

ACCESS:  MMAP_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: (44099 44100)
PERIOD_TIME: (5804 5805)
PERIOD_SIZE: 256
PERIOD_BYTES: 1024
PERIODS: 5
BUFFER_TIME: (29024 29026)
BUFFER_SIZE: 1280
BUFFER_BYTES: 5120
TICK_TIME: 10000
Quoted 7 lines

Is the problem that the delta between min and max BUFFER_TIME exceeds one (1)? The exact samplerate is 44099.81 which should correlate with the integer min/max values. While I'm at it, is it correct to translate samplerate fractions from 0.5 and upwards to dir == -1 and 1 for fractions less than 0.5 (ie. 44099.81 translates to 44100 with dir == -1)? There's also a "bug" in the documentation for
snd_pcm_hw_params_set_buffer_size, which mentions "dir", although its not part of the function signature.

Thanks

Arve Knudsen

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click