|
From: Brendon C. <bre...@gm...> - 2010-03-30 05:03:01
|
Hi all, I am using sox with a program of mine. My program opens a named pipe and expects to read 1 channel 16KHz little endian 32 bit floating point data directly from the pipe. I am using sox to read from the default input device and write the data to the pipe. The problem is that I am seeing a large delay on the input. My sox command is something like: sox -V4 -d --channels 1 --encoding floating-point --rate 16k --type raw --bits 32 --buffer 1280 /tmp/pipename Is there some way I can reduce this delay? I am seeing maybe a 1 sec delay at least 500ms for the energy meter in sox to show the input. The other 500ms i cant easily account for, but I am wondering if a portion of it is on the output of sox (My app may be the problem too, but if i can at least fix the input side that would be great). In case it helps I have included the output from sox -V4 which also includes a uname describing my Ubunti system Thanks, Brendon. bcosta@bcosta-laptop:~$ sox -V4 -d --channels 1 --encoding floating-point --rate 16k --type raw --bits 32 --buffer 1280 /tmp/axon_clientlib_* sox DBUG formats: opening format plugin `lsx_alsa_format_fn': library 0x15063f0, entry point 0x7f7132636450 sox DBUG formats: opening format plugin `lsx_ao_format_fn': library 0x1507380, entry point 0x7f7132152b70 sox DBUG formats: opening format plugin `lsx_caf_format_fn': library 0x1507fb0, entry point 0x7f7131d4a290 sox DBUG formats: opening format plugin `lsx_fap_format_fn': library 0x150a460, entry point 0x7f7130e8c290 sox DBUG formats: opening format plugin `lsx_ffmpeg_format_fn': library 0x150ac40, entry point 0x7f7130c883e0 sox DBUG formats: opening format plugin `lsx_flac_format_fn': library 0x150e890, entry point 0x7f712efa98e0 sox DBUG formats: opening format plugin `lsx_gsm_format_fn': library 0x150f5d0, entry point 0x7f712eb9daa0 sox DBUG formats: opening format plugin `lsx_lpc10_format_fn': library 0x150fcf0, entry point 0x7f712e99ab50 sox DBUG formats: opening format plugin `lsx_mat4_format_fn': library 0x1510400, entry point 0x7f712e7972b0 sox DBUG formats: opening format plugin `lsx_mat5_format_fn': library 0x1510c10, entry point 0x7f712e593290 sox DBUG formats: opening format plugin `lsx_mp3_format_fn': library 0x1511390, entry point 0x7f712e38e900 sox DBUG formats: opening format plugin `lsx_oss_format_fn': library 0x15125f0, entry point 0x7f712dd54a10 sox DBUG formats: opening format plugin `lsx_paf_format_fn': library 0x1512d00, entry point 0x7f712db51290 sox DBUG formats: opening format plugin `lsx_pulseaudio_format_fn': library 0x1513660, entry point 0x7f712d94d9f0 sox DBUG formats: opening format plugin `lsx_pvf_format_fn': library 0x1519900, entry point 0x7f712b6bb290 sox DBUG formats: opening format plugin `lsx_sd2_format_fn': library 0x151a040, entry point 0x7f712b4b7290 sox DBUG formats: opening format plugin `lsx_sndfile_format_fn': library 0x151a840, entry point 0x7f712b2b3250 sox DBUG formats: opening format plugin `lsx_vorbis_format_fn': library 0x151b010, entry point 0x7f712b0af5f0 sox DBUG formats: opening format plugin `lsx_w64_format_fn': library 0x151b770, entry point 0x7f712aeab290 sox DBUG formats: opening format plugin `lsx_wavpack_format_fn': library 0x151bdf0, entry point 0x7f712aca7340 sox DBUG formats: opening format plugin `lsx_xi_format_fn': library 0x151cc30, entry point 0x7f712a87b290 sox: SoX v14.3.0 time: Aug 29 2009 15:10:27 issue: Debian GNU/Linux uname: Linux bcosta-laptop 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 gcc: 4.4.1 arch: 1288 48 88 L OMP Input File : 'default' (alsa) Channels : 2 Sample Rate : 48000 Precision : 16-bit Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no Output File : '/tmp/axon_clientlib_pid26817_devid1_input' (raw) Channels : 1 Sample Rate : 16000 Precision : 16-bit Sample Encoding: 32-bit Floating Point PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no Comment : 'Processed by SoX' sox DBUG remix: 0: sox DBUG remix: 0 0.5 sox DBUG remix: 1 0.5 sox DBUG rate: i/o=3; 3:4 @ level 1 sox DBUG effects_i_dsp: 1 0.29345 1.5 sox DBUG effects_i_dsp: make_lpf(n=119, Fc=0.301638 beta=13.7461 dc-norm=1 scale=4) sox DBUG rate: fir_len=30 phases=4 coef_interp=0 mult=1 size=960 sox DBUG effects_i_dsp: 0.4655 0.020248 0.5 sox DBUG effects_i_dsp: make_lpf(n=409, Fc=0.479752 beta=12.8525 dc-norm=1 scale=1) sox DBUG rate: fir_len=409 dft_length=4096 Fp=0.931 att=125 mult=1 sox DBUG effects_i_dsp: 0.32 0.105642 0.5 sox DBUG effects_i_dsp: make_lpf(n=81, Fc=0.394358 beta=12.8525 dc-norm=1 scale=1) sox DBUG rate: fir_len=81 dft_length=4096 Fp=0.64 att=125 mult=1 sox DBUG rate: stage=0 pre_post=0 pre=0 preload=40 sox DBUG rate: stage=1 pre_post=29 pre=0 preload=14 sox DBUG rate: stage=2 pre_post=0 pre=0 preload=204 sox INFO sox: effects chain: input 48000Hz 2 channels 16 bits (multi) sox INFO sox: effects chain: channels 48000Hz 1 channels 32 bits (multi) sox INFO sox: effects chain: rate 16000Hz 1 channels 32 bits sox INFO sox: effects chain: dither 16000Hz 1 channels 32 bits sox INFO sox: effects chain: output 16000Hz 1 channels 16 bits (multi) |