]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aplay: Fix for arecord recording ghost data
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Thu, 5 May 2022 11:08:33 +0000 (13:08 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 31 May 2022 12:09:29 +0000 (14:09 +0200)
When recording we should only write the amount of data read to output
file instead of copying whole buffer. This fixes glitches appearing at
the end of recorded file, when stopping recording.

Fixes: https://github.com/alsa-project/alsa-utils/pull/150
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsaucm/go.sh
aplay/aplay.c

index 8f1b93bf4f96366d43f11b73e9dafbd14c86eae0..80164cb29addefab251ea9d31af9da7b079b4baa 100755 (executable)
@@ -5,8 +5,8 @@
 #GDB="valgrind --leak-check=yes --show-reachable=yes"
 #GDB="perf stat"
 PROG=./alsaucm
-PROG=/home/perex/git/pipewire/builddir/spa/plugins/alsa/spa-acp-tool
-PROG="$HOME/git/pulseaudio/build/src/daemon/pulseaudio -n -F $HOME/git/pulseaudio/build/src/daemon/default.pa -p $HOME/git/pulseaudio/build/src/modules/"
+#PROG=/home/perex/git/pipewire/builddir/spa/plugins/alsa/spa-acp-tool
+#PROG="$HOME/git/pulseaudio/build/src/daemon/pulseaudio -n -F $HOME/git/pulseaudio/build/src/daemon/default.pa -p $HOME/git/pulseaudio/build/src/modules/"
 #PROG=pulseaudio
 
 #ALSA_CONFIG_UCM="$HOME/alsa/alsa-ucm-conf/ucm" \
index 86826c01441ba939399cbf72c645bb95b7706417..b3b36352761022d66bd50193b1c416bd5e985e38 100644 (file)
@@ -2268,7 +2268,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
                }
        }
 abort:
-       return rcount;
+       return result;
 }
 
 static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
@@ -3326,7 +3326,7 @@ static void capture(char *orig_name)
                        }
                        count -= c;
                        rest -= c;
-                       fdcount += c;
+                       fdcount += save;
                }
 
                /* re-enable SIGUSR1 signal */