Make ALSA complaints mention the device name.
authorbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 12 Mar 2014 22:46:46 +0000 (22:46 +0000)
committerbruceperens <bruceperens@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 12 Mar 2014 22:46:46 +0000 (22:46 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1432 01035d8c-6547-0410-b346-abe4f91aad63

freedv-server/source/platform/linux/audio_in_alsa.cpp
freedv-server/source/platform/linux/audio_out_alsa.cpp

index 64d1de5416caaeb2825ae8dac3fa2ae0c7ad4a7e..0c8b938992dc0639cb8b8ce0f18d687c360d3d72 100644 (file)
@@ -15,7 +15,6 @@ namespace FreeDV {
   class AudioInALSA : public AudioInput {
   private:
     static const int   overlong_delay = 300;
-    static const int   delay_goal = 50;
 
     char * const       parameters;
     snd_pcm_t *                handle;
@@ -99,7 +98,7 @@ namespace FreeDV {
     if ( result == -EPIPE ) {
       snd_pcm_recover(handle, result, 1);
       result = snd_pcm_readi(handle, array, length);
-      std::cerr << "ALSA input: read underrun." << std::endl;
+      std::cerr << "ALSA input " << parameters << ": read underrun." << std::endl;
       if ( result == -EPIPE )
         return 0;
     }
@@ -144,14 +143,17 @@ namespace FreeDV {
       snd_pcm_start(handle);
 
       const double seconds = (double)delay / (double)SampleRate;
-      std::cerr << "ALSA input: program paused, dropped "
+
+      error = snd_pcm_avail_delay(handle, &available, &delay);
+
+      std::cerr << "ALSA input " << parameters << ": overlong delay, dropped "
        << seconds << " seconds of queued audio samples." << std::endl;
     }
 
     if ( error == -EPIPE ) {
       snd_pcm_recover(handle, error, 1);
       available = snd_pcm_avail_delay(handle, &available, &delay);
-      std::cerr << "ALSA input: read underrun." << std::endl;
+      std::cerr << "ALSA input " << parameters << ": read underrun." << std::endl;
     }
 
     if ( error >= 0 )
index 62b41c67dcd1076e55bdb57c338e824c60f11b95..427141fe76719d03a560e5fbd3ef2445d3877e18 100644 (file)
@@ -94,7 +94,7 @@ namespace FreeDV {
     if ( result == -EPIPE ) {
       snd_pcm_recover(handle, result, 1);
       result = snd_pcm_writei(handle, array, length);
-      std::cerr << "ALSA output: write underrun." << std::endl;
+      std::cerr << "ALSA output " << parameters << ": write underrun." << std::endl;
       if ( result == -EPIPE )
         return 0;
     }
@@ -129,7 +129,7 @@ namespace FreeDV {
     if ( error == -EPIPE ) {
       snd_pcm_recover(handle, error, 1);
       available = snd_pcm_avail_delay(handle, &available, &delay);
-      std::cerr << "ALSA output: write underrun." << std::endl;
+      std::cerr << "ALSA output " << parameters << ": write underrun." << std::endl;
     }
     if ( error == 0 )
       return available;