Browse Source

Fix io-audio Internal Capture Client

snd_pcm_read() was failing because we were not attempting to read a
multiple of the fragment size.  This patch fixes that so we read a
whole fragment at a time instead of the fragment size / frame size.
pull/244/head
Shaun Tierney 10 years ago
parent
commit
c0467dec25
2 changed files with 5 additions and 4 deletions
  1. +4
    -4
      qnx/ioaudio/JackIoAudioAdapter.cpp
  2. +1
    -0
      qnx/ioaudio/JackIoAudioAdapter.h

+ 4
- 4
qnx/ioaudio/JackIoAudioAdapter.cpp View File

@@ -229,8 +229,8 @@ namespace Jack
fNumInputPorts = fInputFormat.voices;
ssize_t frameSize = snd_pcm_format_size( fInputFormat.format,
fInputFormat.voices );
fInputBufferFrames = fInputSetup->buf.block.frag_size
/ ( frameSize );
fInputFragmentSize = fInputSetup->buf.block.frag_size;
fInputBufferFrames = fInputFragmentSize / frameSize;

size_t nfrags = fInputSetup->buf.block.frags_max;
size_t nframes = fInputBufferFrames;
@@ -422,7 +422,7 @@ namespace Jack
case 1:
count = snd_pcm_read( fInputDevice,
fInputCardBuffer,
fInputBufferFrames );
fInputFragmentSize );
if( count < 0 )
{
display_error_msg( count,
@@ -465,7 +465,7 @@ namespace Jack
case 0:
count = snd_pcm_read( fInputDevice,
fInputCardBuffer,
fInputBufferFrames );
fInputFragmentSize );
if( count < 0 )
{
display_error_msg( count,


+ 1
- 0
qnx/ioaudio/JackIoAudioAdapter.h View File

@@ -134,6 +134,7 @@ namespace Jack
snd_pcm_channel_params_t *fOutputParams;
snd_pcm_channel_setup_t *fInputSetup;
snd_pcm_channel_setup_t *fOutputSetup;
size_t fInputFragmentSize;

//samples info
snd_pcm_format_t fInputFormat;


Loading…
Cancel
Save