nodesign / weio

weio
http://we-io.net
128 stars 35 forks source link

arecord creates a lot of useless files #178

Open ukicar opened 9 years ago

ukicar commented 9 years ago

When trying to record sound arecord produces a huge amount of useless files, only the first one in the chain has sound. Other thing is that program don't exit when duration of recording is expired. I'm afraid that our arecord has some kind of bug... tested the same program under Rpi where it works well here is test instruction cd /tmp arecord -f cd -d 5 tt.wav

instruction means : record in cd quality duration of 5 seconds

ks156 commented 9 years ago

What are the other files created ? Also .wav files ?

ukicar commented 9 years ago

yes exactly a lot of wav files that can't be read. Wave files 44bits in size not usable except the first one... I haven't see this behavior when tested on raspberry pi for example... I couldn't find similar case on google

ks156 commented 9 years ago

Is the behavior identical when the file is stored on flash, sd and usbFlash ? And what's the name of the other files ?

ukicar commented 9 years ago

same thing! other files are named with numbers name-xxx.wav

ks156 commented 9 years ago

http://superuser.com/questions/583826/recording-using-arecord-creates-thousands-of-files http://stackoverflow.com/questions/24629915/multiple-files-created-by-arecord

drasko commented 8 years ago

@ukicar can you please take a look at new version or alternative solution. Please research and advise how to proceed with this.

ks156 commented 8 years ago

To be tested with the new openWRT version

dasariarun commented 8 years ago

How to over come the issue??any clue?

drasko commented 8 years ago

Is this re-appearing in the new version v1.2 as well?

ks156 commented 8 years ago

I don't have an USB soundcard. @ukicar, can you try with v1.2 ?

bcpu commented 8 years ago

I was struggling with this as well but this is these are the parameters that allowed me to record a 10 second wav file with no other files being created.

arecord -D plughw:1,0 -d 10 test.wav

ThisNameNotUsed commented 8 years ago

Well I have some other bug that seems to record to the .wav file okay but doesn't output sound with I play or use sox to "play." The weird thing is too is that sox's "play" command shows an equalizer bar that goes up and down as if sound is coming out but it really isn't.

So I can arecord with a -f command that outputs thousands of blank .wav files or I can leave out the -f and get a .wav file that seems to have when played with with sox but doesn't actually output anything.

nagimov commented 8 years ago

The problem seems to appear on ARM architecture starting from 1.0.28 arecord version (arecord --version). On Raspberry Pi 3 running Raspbian Jessie I had the exact same issue (creating bunch of files, not stopping after --duration seconds). Downgrading alsa-utils from 1.0.28-1 to 1.0.25-4 (rolling back to Wheezy's repo) fixed the problem.

ctownj30 commented 8 years ago

navimov - any way you could share how you downgraded alsa-utils? the apt repository on jessie does not seem to list older versions and I'm a bit new to this.

nagimov commented 8 years ago

ctownj30 -- http://blog.nagimov.com/alsa-utils-arecord-bug-lots-of-wav-files-ignoring-duration-parameter/

dmarman commented 7 years ago

I am not able to downgrade alsa-utils. I get this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1.0.25-4' for 'alsa-utils' was not found
nagimov commented 7 years ago

@dmarman platform? linux distro & version? output of sudo aptitude versions alsa-utils ?

dmarman commented 7 years ago

ARM Raspberry Pi 3

Linux version 4.4.26-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) )

pi@raspberrypi:~ $ sudo aptitude versions alsa-utils
Package alsa-utils:
i   1.0.28-1                                      stable                    500
nagimov commented 7 years ago

@dmarman have you modified your /etc/apt/sources.list ?

dmarman commented 7 years ago
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free r$
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

Do I have to uncomment that?

nagimov commented 7 years ago

@dmarman

saurabhvyas commented 7 years ago

I can confirm this is a bug , It happened with me on my pi 3

slmnv5 commented 7 years ago

The same happens on my Pi 3 with Jessie. This command creates small files and does not stop in 5 seconds: arecord -f s16_le -r 44100 -D hw:0 -d 5 test44.wav however this similar command works just fine: arecord -f s16_le -r 48000 -D hw:0 -d 5 test.wav

dmarman commented 7 years ago

This is a bug in alsa 1.0.28 on ARM. A solution is to upgrade your alsa-utils to 1.1.3 from source code. I followed the last answer here:

link

If I remember correctly I got a problem with the installation. I think I didn't have libasound2 installed in my raspberry.