2018-04-14 Fred Gleason <fredg@paravelsystems.com>

* Cleaned up spurious HPI error messages being sent to the syslog.
This commit is contained in:
Fred Gleason
2018-04-14 12:46:11 -04:00
parent 5e3fe7ac5e
commit 0caabc137f
3 changed files with 12 additions and 23 deletions

View File

@@ -16634,3 +16634,5 @@
2018-04-14 Fred Gleason <fredg@paravelsystems.com> 2018-04-14 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in the HPI audio interface that broke capture * Fixed a regression in the HPI audio interface that broke capture
on adapters lacking DMA bus-mastering support. on adapters lacking DMA bus-mastering support.
2018-04-14 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up spurious HPI error messages being sent to the syslog.

View File

@@ -196,11 +196,7 @@ bool RDHPIPlayStream::formatSupported(RDWaveFile::Format format)
if(!found) { if(!found) {
return false; return false;
} }
if(LogHpi(HPI_OutStreamHostBufferAllocate(NULL,hostream,dma_buffer_size), if(HPI_OutStreamHostBufferAllocate(NULL,hostream,dma_buffer_size));
__LINE__)!=0) {
LogHpi(HPI_OutStreamClose(NULL,hostream),__LINE__);
return false;
}
} }
else { else {
hostream=hpi_stream; hostream=hpi_stream;
@@ -246,7 +242,7 @@ bool RDHPIPlayStream::formatSupported(RDWaveFile::Format format)
break; break;
} }
if(!is_open) { if(!is_open) {
LogHpi(HPI_OutStreamHostBufferFree(NULL,hostream),__LINE__); if(HPI_OutStreamHostBufferFree(NULL,hostream));
LogHpi(HPI_OutStreamClose(NULL,hostream),__LINE__); LogHpi(HPI_OutStreamClose(NULL,hostream),__LINE__);
} }
if(state!=0) { if(state!=0) {
@@ -759,7 +755,7 @@ void RDHPIPlayStream::tickClock()
else { else {
if(state==HPI_STATE_DRAINED) { if(state==HPI_STATE_DRAINED) {
LogHpi(HPI_OutStreamStop(NULL,hpi_stream),__LINE__); LogHpi(HPI_OutStreamStop(NULL,hpi_stream),__LINE__);
LogHpi(HPI_OutStreamHostBufferFree(NULL,hpi_stream),__LINE__); if(HPI_OutStreamHostBufferFree(NULL,hpi_stream));
LogHpi(HPI_OutStreamClose(NULL,hpi_stream),__LINE__); LogHpi(HPI_OutStreamClose(NULL,hpi_stream),__LINE__);
hpi_err=LogHpi(HPI_AdapterClose(NULL,card_index[card_number]),__LINE__); hpi_err=LogHpi(HPI_AdapterClose(NULL,card_index[card_number]),__LINE__);
clock->stop(); clock->stop();
@@ -795,8 +791,7 @@ int RDHPIPlayStream::GetStream()
if(++stream_mutex[card_number][i]==1) { if(++stream_mutex[card_number][i]==1) {
LogHpi(HPI_OutStreamOpen(NULL,card_index[card_number],i,&hpi_stream), LogHpi(HPI_OutStreamOpen(NULL,card_index[card_number],i,&hpi_stream),
__LINE__); __LINE__);
LogHpi(HPI_OutStreamHostBufferAllocate(NULL,hpi_stream,dma_buffer_size), if(HPI_OutStreamHostBufferAllocate(NULL,hpi_stream,dma_buffer_size));
__LINE__);
stream_number=i; stream_number=i;
return stream_number; return stream_number;
} }
@@ -823,13 +818,12 @@ void RDHPIPlayStream::FreeStream()
{ {
#ifdef RDHPIPLAYSTREAM_USE_LOCAL_MUTEX #ifdef RDHPIPLAYSTREAM_USE_LOCAL_MUTEX
stream_mutex[card_number][stream_number]--; stream_mutex[card_number][stream_number]--;
LogHpi(HPI_OutStreamHostBufferFree(NULL,hpi_stream),__LINE__); if(HPI_OutStreamHostBufferFree(NULL,hpi_stream));
LogHpi(HPI_OutStreamClose(NULL,hpi_stream),__LINE__); LogHpi(HPI_OutStreamClose(NULL,hpi_stream),__LINE__);
stream_number=-1; stream_number=-1;
#else #else
LogHpi(HPI_OutStreamHostBufferFree(NULL,hpi_stream),__LINE__); if(HPI_OutStreamHostBufferFree(NULL,hpi_stream));
LogHpi(HPI_OutStreamClose(NULL,hpi_stream),__LINE__); LogHpi(HPI_OutStreamClose(NULL,hpi_stream),__LINE__);
// syslog(LOG_ERR,"HPI closing ostream: %d",stream_number);
stream_number=-1; stream_number=-1;
#endif #endif
} }

View File

@@ -210,12 +210,7 @@ bool RDHPIRecordStream::formatSupported(RDWaveFile::Format format)
if(!found) { if(!found) {
return false; return false;
} }
if(LogHpi(HPI_InStreamHostBufferAllocate(NULL,histream,dma_buffer_size), if(HPI_InStreamHostBufferAllocate(NULL,histream,dma_buffer_size));
__LINE__)!=0) {
LogHpi(HPI_InStreamHostBufferFree(NULL,histream),__LINE__);
LogHpi(HPI_InStreamClose(NULL,histream),__LINE__);
return false;
}
} }
else { else {
histream=hpi_stream; histream=hpi_stream;
@@ -262,7 +257,7 @@ bool RDHPIRecordStream::formatSupported(RDWaveFile::Format format)
break; break;
} }
if(!is_open) { if(!is_open) {
LogHpi(HPI_InStreamHostBufferFree(NULL,histream),__LINE__); if(HPI_InStreamHostBufferFree(NULL,histream));
LogHpi(HPI_InStreamClose(NULL,histream),__LINE__); LogHpi(HPI_InStreamClose(NULL,histream),__LINE__);
} }
if(state!=0) { if(state!=0) {
@@ -724,7 +719,7 @@ bool RDHPIRecordStream::GetStream()
} }
return false; return false;
} }
hpi_err=HPI_InStreamHostBufferAllocate(NULL,hpi_stream,dma_buffer_size); if(HPI_InStreamHostBufferAllocate(NULL,hpi_stream,dma_buffer_size));
return true; return true;
} }
@@ -732,9 +727,7 @@ bool RDHPIRecordStream::GetStream()
void RDHPIRecordStream::FreeStream() void RDHPIRecordStream::FreeStream()
{ {
hpi_err_t hpi_err; if(HPI_InStreamHostBufferFree(NULL,hpi_stream));
hpi_err=HPI_InStreamHostBufferFree(NULL,hpi_stream);
LogHpi(HPI_InStreamClose(NULL,hpi_stream),__LINE__); LogHpi(HPI_InStreamClose(NULL,hpi_stream),__LINE__);
} }