Changeset 1356 for portaudio/branches

Show
Ignore:
Timestamp:
02/22/08 00:35:29 (10 months ago)
Author:
rossb
Message:

patch from Eliot Blennerhassett to use new stream read write functions that first appeared in HPI version 3.05.05. resolves ticket #51

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • portaudio/branches/v19-devel/src/hostapi/asihpi/pa_linux_asihpi.c

    r1241 r1356  
    19321932    PaUtilZeroer *zeroer; 
    19331933    PaSampleFormat outputFormat; 
     1934#if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 
    19341935    HPI_DATA data; 
    1935  
     1936#endif 
    19361937    assert( stream ); 
    19371938    out = stream->output; 
     
    19491950    zeroer(out->tempBuffer, 1, out->tempBufferSize / Pa_GetSampleSize(outputFormat) ); 
    19501951    /* Write temp buffer to hardware fifo twice, to get started */ 
     1952#if (HPI_VER >= HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 
     1953    PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( out->hpiDevice->subSys, out->hpiStream,  
     1954                                              out->tempBuffer, out->tempBufferSize, &out->hpiFormat), 
     1955                                              paUnanticipatedHostError ); 
     1956    PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( out->hpiDevice->subSys, out->hpiStream,  
     1957                                              out->tempBuffer, out->tempBufferSize, &out->hpiFormat), 
     1958                                              paUnanticipatedHostError ); 
     1959#else 
    19511960    PA_ASIHPI_UNLESS_( HPI_DataCreate( &data, &out->hpiFormat, out->tempBuffer, out->tempBufferSize ), 
    19521961                       paUnanticipatedHostError ); 
     
    19551964    PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( out->hpiDevice->subSys, 
    19561965                                           out->hpiStream, &data ), paUnanticipatedHostError ); 
    1957  
     1966#endif 
    19581967error: 
    19591968    return result; 
     
    20272036        /* Create and start callback engine thread */ 
    20282037        /* Also waits 1 second for stream to be started by engine thread (otherwise aborts) */ 
    2029         PA_ENSURE_( PaUnixThread_New( &stream->thread, &CallbackThreadFunc, stream, 1., 0 ) ); 
     2038        PA_ENSURE_( PaUnixThread_New( &stream->thread, &CallbackThreadFunc, stream, 1., 0 /*rtSched*/ ) ); 
    20302039    } 
    20312040    else 
     
    24742483    { 
    24752484        PaAsiHpiStreamInfo info; 
     2485         
     2486#if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 
    24762487        HPI_DATA data; 
     2488#endif 
    24772489        HW32 framesToGet = *numFrames; 
    24782490 
     
    25002512        } 
    25012513 
     2514#if (HPI_VER >= HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 
     2515        /* Read block of data into temp buffer */ 
     2516        PA_ASIHPI_UNLESS_( HPI_InStreamReadBuf( stream->input->hpiDevice->subSys, 
     2517                                             stream->input->hpiStream,  
     2518                                             stream->input->tempBuffer, 
     2519                                             framesToGet * stream->input->bytesPerFrame), 
     2520                           paUnanticipatedHostError ); 
     2521#else 
    25022522        /* Setup HPI data structure around temp buffer */ 
    25032523        HPI_DataCreate( &data, &stream->input->hpiFormat, stream->input->tempBuffer, 
     
    25072527                                             stream->input->hpiStream, &data ), 
    25082528                           paUnanticipatedHostError ); 
     2529#endif 
    25092530        /* Register temp buffer with buffer processor (always FULL buffer) */ 
    25102531        PaUtil_SetInputFrameCount( &stream->bufferProcessor, *numFrames ); 
     
    25502571    { 
    25512572        PaAsiHpiStreamInfo info; 
     2573#if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 
    25522574        HPI_DATA data; 
    2553  
     2575#endif 
    25542576        /* Check for underflows after the (potentially time-consuming) callback */ 
    25552577        PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) ); 
     
    25592581        } 
    25602582 
     2583#if (HPI_VER >= HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 
     2584        /* Write temp buffer to HPI stream */ 
     2585        PA_ASIHPI_UNLESS_( HPI_OutStreamWriteBuf( stream->output->hpiDevice->subSys, 
     2586                                           stream->output->hpiStream,  
     2587                                           stream->output->tempBuffer, 
     2588                                           numFrames * stream->output->bytesPerFrame,  
     2589                                           &stream->output->hpiFormat), 
     2590                           paUnanticipatedHostError ); 
     2591#else 
    25612592        /* Setup HPI data structure around temp buffer */ 
    25622593        HPI_DataCreate( &data, &stream->output->hpiFormat, stream->output->tempBuffer, 
     
    25662597                                               stream->output->hpiStream, &data ), 
    25672598                           paUnanticipatedHostError ); 
     2599#endif 
    25682600    } 
    25692601