Commit 39a91ffa authored by Alexandre Savard's avatar Alexandre Savard

[#2050] Fix capture volume control in ALSA

parent 76e80641
...@@ -120,13 +120,13 @@ AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize, ...@@ -120,13 +120,13 @@ AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize,
ost::MutexLock lock (_mutex); ost::MutexLock lock (_mutex);
std::string pcmp = buildDeviceTopo (plugin , indexOut , 0); std::string pcmp = buildDeviceTopo (plugin, indexOut, 0);
std::string pcmc = buildDeviceTopo (PCM_PLUGHW , indexIn , 0); std::string pcmc = buildDeviceTopo (PCM_PLUGHW, indexIn, 0);
_converter = new SamplerateConverter (_audioSampleRate, _frameSize); _converter = new SamplerateConverter (_audioSampleRate, _frameSize);
return open_device (pcmp , pcmc , stream); return open_device (pcmp, pcmc, stream);
} }
void void
...@@ -507,7 +507,7 @@ AlsaLayer::write (void* buffer, int length) ...@@ -507,7 +507,7 @@ AlsaLayer::write (void* buffer, int length)
break; break;
default: default:
//_debugAlsa ("Write error unknown - dropping frames **********************************: %s\n", snd_strerror(err)); _debugAlsa ("Write error unknown - dropping frames **********************************: %s\n", snd_strerror(err));
stopPlaybackStream (); stopPlaybackStream ();
break; break;
...@@ -868,6 +868,9 @@ void AlsaLayer::audioCallback (void) ...@@ -868,6 +868,9 @@ void AlsaLayer::audioCallback (void)
toPut = (micAvailBytes <= micAvailPut) ? micAvailBytes : micAvailPut; toPut = (micAvailBytes <= micAvailPut) ? micAvailBytes : micAvailPut;
in = (SFLDataFormat*)malloc(toPut * sizeof(SFLDataFormat)); in = (SFLDataFormat*)malloc(toPut * sizeof(SFLDataFormat));
toPut = read (in, toPut* sizeof(SFLDataFormat)); toPut = read (in, toPut* sizeof(SFLDataFormat));
adjustVolume (in, toPut, SFL_PCM_CAPTURE);
if (in != 0) if (in != 0)
{ {
int _mainBufferSampleRate = getMainBuffer()->getInternalSamplingRate(); int _mainBufferSampleRate = getMainBuffer()->getInternalSamplingRate();
...@@ -893,12 +896,11 @@ void AlsaLayer::audioCallback (void) ...@@ -893,12 +896,11 @@ void AlsaLayer::audioCallback (void)
} }
free(in); in=0; free(in); in=0;
} }
/* else if(micAvailBytes < 0)
else if(micAvailAlsa < 0)
{ {
_debug("AlsaLayer::audioCallback (mic): error: %s\n", snd_strerror(micAvailAlsa)); _debug("AlsaLayer::audioCallback (mic): error: %s\n", snd_strerror(micAvailBytes));
} }
*/
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment