cmusphinx/sphinxbase

sphinx_fe segmentation fault

wentz89 opened this issue · 4 comments

I'm following the tutorial to adapt an acoustic model.
When i ran the command:

sphinx_fe -argfile en-us/feat.params
-samprate 16000 -c arctic20.fileids
-di . -do . -ei wav -eo mfc -mswav yes

i get:

INFO: sphinx_fe.c(967): Processing all remaining utterances at position 0
INFO: sphinx_fe.c(787): Converting ./arctic_0001.wav to ./arctic_0001.mfc
Segmentation fault (core dumped)

gdb output:

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.

and

#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x00007ffff7815980 in printf_positional (s=s@entry=0x7fffffffd0d0,
format=format@entry=0x403fb0 "Sample rate %.1f does not match configured value in file '%s'\n", readonly_format=readonly_format@entry=0, ap=ap@entry=0x7fffffffd248,
ap_savep=ap_savep@entry=0x7fffffffcc68, done=57, nspecs_done=1,
lead_str_end=0x403fbc "%.1f does not match configured value in file '%s'\n",
work_buffer=0x7fffffffcca0 "@\315\377\377\377\177", save_errno=17, grouping=0x0,
thousands_sep=0x7ffff7955b25 "") at vfprintf.c:2023
#2 0x00007ffff78164a6 in _IO_vfprintf_internal (s=s@entry=0x7fffffffd0d0,
format=,
format@entry=0x403fb0 "Sample rate %.1f does not match configured value in file '%s'\n", ap=ap@entry=0x7fffffffd248) at vfprintf.c:1677
#3 0x00007ffff78df896 in ___vsnprintf_chk (
s=s@entry=0x7fffffffd260 "Sample rate 0.0 does not match configured value in file '\200\272\367\377\177", maxlen=, maxlen@entry=1024, flags=flags@entry=1,
slen=slen@entry=1024,
format=0x403fb0 "Sample rate %.1f does not match configured value in file '%s'\n",
args=args@entry=0x7fffffffd248) at vsnprintf_chk.c:63
#4 0x00007ffff7ba80e8 in vsnprintf (__ap=0x7fffffffd248, __fmt=, __n=1024,
__s=0x7fffffffd260 "Sample rate 0.0 does not match configured value in file '\200\272\367\377\177") at /usr/include/x86_64-linux-gnu/bits/stdio2.h:77
#5 err_msg (lvl=lvl@entry=ERR_ERROR, path=path@entry=0x403a09 "sphinx_fe.c", ln=137,
fmt=) at err.c:96
#6 0x00000000004023a7 in detect_riff (wtf=0x60a080) at sphinx_fe.c:137
#7 0x00000000004035bc in detect_audio_type (wtf=0x60a080) at sphinx_fe.c:750
#8 sphinx_wave2feat_convert_file (wtf=wtf@entry=0x60a080, infile=,
outfile=0x61ecc0 "./arctic_0001.mfc") at sphinx_fe.c:792
#9 0x0000000000401a14 in run_control_file (ctlfile=, wtf=0x60a080)
at sphinx_fe.c:992
#10 main (argc=, argv=) at sphinx_fe.c:1032

The Solution is kind of simple,

the tutorial dont mention that the wav-files should be in 16-Bit format. (Since audacity by default use a 32-Bit format i had to change that for my wav-files)

Getting same error. Used Audacity, Files are exported as WAV (Microsoft) signed 16-bit PCM. All files appear proper. Below are the directory listings (abbreviated - trust me, there all there, just figured no one needs to see all 46 when it dies on #1..), and the messages that are generated after running sphinx_fe from the command line. I've spent several hours now generating, editing and re-exporting from the original 32 bit to 16 bit.... would really love to know what I'm doing wrong. I have uploaded one of the audio files to https://www.xanatos.com/sounds/xanatos_0001.wav if anyone can take a look at it to see if it's somehow not properly set. Thanks for any help.

pi@Delos-CR4D-L:~/Desktop/workingdir $ ls -Fal

total 32852
drwxr-xr-x 3 pi pi     4096 Mar 11 19:53 ./
drwxr-xr-x 4 pi pi     4096 Mar 11 13:23 ../
-rw-r--r-- 1 pi pi  3406880 Mar  3 14:16 cmudict-en-us.dict
drwxr-xr-x 2 pi pi     4096 Mar 11 13:23 en-us/
-rw-r--r-- 1 pi pi 27114385 Mar  3 12:43 en-us.lm.bin
-rw-r--r-- 1 pi pi    119634 Mar 11 15:25 xanatos_0001.wav
-rw-r--r-- 1 pi pi    38730 Mar 11 15:24 xanatos_0002.wav
-rw-r--r-- 1 pi pi    36782 Mar 11 15:24 xanatos_0003.wav
............
-rw-r--r-- 1 pi pi    96260 Mar 11 15:49 xanatos_0044.wav
-rw-r--r-- 1 pi pi   128982 Mar 11 15:48 xanatos_0045.wav
-rw-r--r-- 1 pi pi   120968 Mar 11 15:48 xanatos_0046.wav
-rw-r--r-- 1 pi pi      646 Mar  3 08:58 xanatos.fileids
-rw-r--r-- 1 pi pi     3023 Mar  3 09:01 xanatos.transcription

pi@Delos-CR4D-L:~/Desktop/workingdir $ sudo sphinx_fe -argfile en-us/feat.params -samprate 16000 -c xanatos.fileids -di . -do . -ei wav -eo mfc -mswav yes

Current configuration:
[NAME]			[DEFLT]		[VALUE]
-alpha			0.97		9.700000e-01
-argfile				en-us/feat.params
-blocksize		2048		2048
-build_outdirs		yes		yes
-c					xanatos.fileids
-cep2spec		no		no
-di					.
-dither			no		no
-do					.
-doublebw		no		no
-ei					wav
-eo					mfc
-example		no		no
-frate			100		100
-help			no		no
-i					
-input_endian		little		little
-lifter			0		0
-logspec		no		no
-lowerf			133.33334	1.333333e+02
-mach_endian		little		little
-mswav			no		yes
-ncep			13		13
-nchans			1		1
-nfft			512		512
-nfilt			40		40
-nist			no		no
-npart			0		0
-nskip			0		0
-o					
-ofmt			sphinx		sphinx
-part			0		0
-raw			no		no
-remove_dc		no		no
-remove_noise		yes		yes
-remove_silence		yes		yes
-round_filters		yes		yes
-runlen			-1		-1
-samprate		16000		1.600000e+04
-seed			-1		-1
-smoothspec		no		no
-spec2cep		no		no
-sph2pipe		no		no
-transform		legacy		legacy
-unit_area		yes		yes
-upperf			6855.4976	6.855498e+03
-vad_postspeech		50		50
-vad_prespeech		20		20
-vad_startspeech	10		10
-vad_threshold		2.0		2.000000e+00
-verbose		no		no
-warp_params				
-warp_type		inverse_linear	inverse_linear
-whichchan		0		0
-wlen			0.025625	2.562500e-02

Current configuration:
[NAME]			[DEFLT]		[VALUE]
-alpha			0.97		9.700000e-01
-argfile				en-us/feat.params
-blocksize		2048		2048
-build_outdirs		yes		yes
-c					xanatos.fileids
-cep2spec		no		no
-di					.
-dither			no		no
-do					.
-doublebw		no		no
-ei					wav
-eo					mfc
-example		no		no
-frate			100		100
-help			no		no
-i					
-input_endian		little		little
-lifter			0		22
-logspec		no		no
-lowerf			133.33334	1.300000e+02
-mach_endian		little		little
-mswav			no		yes
-ncep			13		13
-nchans			1		1
-nfft			512		512
-nfilt			40		25
-nist			no		no
-npart			0		0
-nskip			0		0
-o					
-ofmt			sphinx		sphinx
-part			0		0
-raw			no		no
-remove_dc		no		no
-remove_noise		yes		yes
-remove_silence		yes		yes
-round_filters		yes		yes
-runlen			-1		-1
-samprate		16000		1.600000e+04
-seed			-1		-1
-smoothspec		no		no
-spec2cep		no		no
-sph2pipe		no		no
-transform		legacy		dct
-unit_area		yes		yes
-upperf			6855.4976	6.800000e+03
-vad_postspeech		50		50
-vad_prespeech		20		20
-vad_startspeech	10		10
-vad_threshold		2.0		2.000000e+00
-verbose		no		no
-warp_params				
-warp_type		inverse_linear	inverse_linear
-whichchan		0		0
-wlen			0.025625	2.562500e-02

INFO: sphinx_fe.c(967): Processing all remaining utterances at position 0
INFO: sphinx_fe.c(787): Converting ./xanatos_0001.wav to ./xanatos_0001.mfc
Segmentation fault

PS., Running Linux, Raspbian Stretch, if it makes a difference.

@DaveXanatos it is better to open a separate issue for your problem

It seems your sphinxbase is pretty old because your file is 8khz instead of required 16 and sphinxbase should tell you about it.

Thanks all. I re-recorded my files at 16kHz and successfully ran sphinx_fe on them. I now have my .mfc files. I also ran

pocketsphinx_mdef_convert -text en-us/mdef en-us/mdef.txt

and now I have my mdef.txt file and it looks good as well.

But... I appear to be missing the bw tool. I have downloaded sphinxtrain-5prealpha.tar.gz in hopes that I will find it in there once I unzip it... tomorrow. If I'm headed in the wrong direction and anyone reads this before Sunday morning Eastern USA time - and wants to send me a quick message telling me so... I would be appreciative :) Thanks

PS., Sorry, just realized that - perhaps this isn't the correct place now to ask this question... being that the original issue is closed/resolved due to it being a sample rate issue....