- Timestamp:
- 02/22/08 00:35:29 (10 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
portaudio/branches/v19-devel/src/hostapi/asihpi/pa_linux_asihpi.c
r1241 r1356 1932 1932 PaUtilZeroer *zeroer; 1933 1933 PaSampleFormat outputFormat; 1934 #if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 1934 1935 HPI_DATA data; 1935 1936 #endif 1936 1937 assert( stream ); 1937 1938 out = stream->output; … … 1949 1950 zeroer(out->tempBuffer, 1, out->tempBufferSize / Pa_GetSampleSize(outputFormat) ); 1950 1951 /* 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 1951 1960 PA_ASIHPI_UNLESS_( HPI_DataCreate( &data, &out->hpiFormat, out->tempBuffer, out->tempBufferSize ), 1952 1961 paUnanticipatedHostError ); … … 1955 1964 PA_ASIHPI_UNLESS_( HPI_OutStreamWrite( out->hpiDevice->subSys, 1956 1965 out->hpiStream, &data ), paUnanticipatedHostError ); 1957 1966 #endif 1958 1967 error: 1959 1968 return result; … … 2027 2036 /* Create and start callback engine thread */ 2028 2037 /* 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*/ ) ); 2030 2039 } 2031 2040 else … … 2474 2483 { 2475 2484 PaAsiHpiStreamInfo info; 2485 2486 #if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 2476 2487 HPI_DATA data; 2488 #endif 2477 2489 HW32 framesToGet = *numFrames; 2478 2490 … … 2500 2512 } 2501 2513 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 2502 2522 /* Setup HPI data structure around temp buffer */ 2503 2523 HPI_DataCreate( &data, &stream->input->hpiFormat, stream->input->tempBuffer, … … 2507 2527 stream->input->hpiStream, &data ), 2508 2528 paUnanticipatedHostError ); 2529 #endif 2509 2530 /* Register temp buffer with buffer processor (always FULL buffer) */ 2510 2531 PaUtil_SetInputFrameCount( &stream->bufferProcessor, *numFrames ); … … 2550 2571 { 2551 2572 PaAsiHpiStreamInfo info; 2573 #if (HPI_VER < HPI_VERSION_CONSTRUCTOR( 3, 5, 5 )) 2552 2574 HPI_DATA data; 2553 2575 #endif 2554 2576 /* Check for underflows after the (potentially time-consuming) callback */ 2555 2577 PA_ENSURE_( PaAsiHpi_GetStreamInfo( stream->output, &info ) ); … … 2559 2581 } 2560 2582 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 2561 2592 /* Setup HPI data structure around temp buffer */ 2562 2593 HPI_DataCreate( &data, &stream->output->hpiFormat, stream->output->tempBuffer, … … 2566 2597 stream->output->hpiStream, &data ), 2567 2598 paUnanticipatedHostError ); 2599 #endif 2568 2600 } 2569 2601
