Skip to contentSkip to conversation

Garbage at end of playback: ecasound or alsa broken?

DISCUSSION Knut Petersen 3 participants 4 messages Jul 20, 2013 – Jul 27, 2013

lore
Share & tools
lore
#0 lore raw

Hi everybody!

======================================================================
Summary: A very short period (about 45ms) garbage is played at the end of every playback.
======================================================================

Hardware
========
mobo: AOpen i915GMm-hfs
cpu: Pentium-M
ram: 2GB
intel hda, realtek codec
rme digi96/pad
onboard intel hda, realtek alc880

Software
=======
opensuse 12.3
linux kernel 3.10.1, 3.11-rc1
ecasound, git ab6a9c3be5440b05f2c9eb240ee0d42578379f8d

Steps to reproduce the problem:
=========================

1: generate test file
===============
Start audacity, generate a 44.1 khz stereo track, one second audio, start 400 Hz, end 4000Hz, start amplitude 0.5, end amplitude 1.0 export to testin.wav as 16bit wav

2: playback test file and record it
=========================
Setup soundcards and cabling, execute
"ecasound -t 2 -f:16,2,44100 -a:1 -i testin.wav -o alsahw,0,0 -a:2 -i alsahw,0,0 -o testout.wav"

3:Expected result:
==============
testout.wav should hold a proper recording of testin.wav, padded with silence at the end.

4: my result
=========
testout.wav
1 - starts with about 90 Samples of silence (not nice, how can I avoid that?)
2 - continues with 1 second of properly recorded audio (expected)
3 - continues with about 1982 samples of audio (0,045s) (unexpected, severly broken)
The garbage audio is part of the original audio, starting at about 26xxHz, ending at about 28xx Hz
4 - continues with silence to the end of the file (expected)

Discussion
=========
The same problem exists if I record rme96 to rme96, hda to rme96 or hda to hda. So it´s probably not a problem of the rme96 or hda alsa drivers.

Is this problem known? Can anybody confirm the problem with different hardware? Should I blame alsa or ecasound? Any ideas?

cu,
Knut

#1 lore raw

Hello Knut!
No idea yet, who's to blame. but have you tried repeating the experiment
with another tool. You can use audacity, so you can use the GUI. There are other recording applications. Or you might even try with the alsa utilities aplay and arecord. this will require two console or terminals.
You might also try the same experiment with JACK, if you're not averse to
it.
I have two soundcards and use them both via JACK. But I've also used two
sound devices in ALSA together with Ecasound and didn't experience such problems. My ecasound call was something like:
ecasound -f:16,2,44100 -c -i alsa,tape -o alsa,default
I did digitise a few tapes and prelistened to the volume and audio quality.
So it's not a problem in general.
Warm regards
Julien

----------------------------------------
http://juliencoder.de/nama/music.html

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ecasound-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ecasound-list

#2 lore raw
Quoted 3 lines · Julien Claassen

Hello Knut!
No idea yet, who's to blame. but have you tried repeating the experiment
with another tool. You can use audacity, so you can use the GUI.

Audacity is even more broken. That´s true for the version from opensuse (2.03), and it´s true for the current development code,

If I mark that 1s of audio described in the original post, a lot of audio is missing at the beginning and a bit of audio is missing at end. In total only about 460 msec of audio is captured, 540 msec is lost.

Audacity currently does not playback correctly with non-memory-mapped alsa devices. But that´s another story ;-(

Quoted 2 lines

There are other recording applications. Or you might even try with the alsa utilities aplay and arecord. this will require two console or terminals.

If I put

arecord -f cd -D hw:0,0 -d 2 testarec.wav &
aplay testin.wav -D hw:0,0

into a script I get a perfect recording: 47 msec silence, exactly 1s of audio data, silence up to the end of the file. Well, that result seems to indicate that I found an ecasound bug. Unless it´s some alsa code unused by aplay ;-)

Quoted 1 line

You might also try the same experiment with JACK, if you're not averse to it.

In the best case that could only mask the bug.

Quoted 3 lines

I did digitise a few tapes and prelistened to the volume and audio quality.
So it's not a problem in general.

Half a second silence at the end of the audio masks the bug. Because of that I agree that it´s not a general problem, most people will never notice it. But it´s still a bug.

cu,
Knut

#3 lore raw
In reply to Knut Petersen

Hi,

Quoted 1 line · Knut Petersen

Summary: A very short period (about 45ms) garbage is played at the end of every playback.

[...]

Quoted 2 lines

Setup soundcards and cabling, execute
"ecasound -t 2 -f:16,2,44100 -a:1 -i testin.wav -o alsahw,0,0 -a:2 -i alsahw,0,0 -o testout.wav"

this usage triggers multitrack recording mode in ecasound (ecasound will try to align recording of testin.wav to playout of testout.wav), and the symptoms sound like an issue with this mechanism.

I couldn't reproduce this with my setup (ice1712), so could you retry the test with "-z:notintbuf"? If the problem still persists, can you send me (may be large, so please send offline) logs when run with "-dd"?