Menu

Cross compile the pocketsphinx and sphinxbase librarys for OpenWRT RT3883

Help
Louwi
2014-03-19
2014-05-05
  • Louwi

    Louwi - 2014-03-19

    Hello everyone,

    I had sucsesfully built an project based on pocketsphinx for home voice controle.
    Now I'm trying to cross compile my project to work on OpenWRT Rt3883.

    So is theire any one that had already cross compile the pocketsphinx and sphinxbase librarys for OpenWRT RT3883?

     
  • Nickolay V. Shmyrev

    So is theire any one that had already cross compile the pocketsphinx and sphinxbase librarys for OpenWRT RT3883?

    Yes, it's pretty straightforward, there is no specific issue. You can compile pocketpshinx and sphinxbase just like any automake-based project.

     
  • Louwi

    Louwi - 2014-03-25

    Should I execute the commands :

    for Sphinxs base
    ./autogen.sh
    ./configure

    for pocketsphinx
    ./configure

    before running the cross-compilation chain-tool ?

     
  • Nickolay V. Shmyrev

    Yes, and you need to specify the target architecture:

    ./configure --build=arm-something

    I suggest you to check any manual on cross-compilation first

     
  • Louwi

    Louwi - 2014-04-07

    I notced that the makefile produced by the cros-compiling tool chaine and the one produced in my pc don't use the same libraries !

    in my PC :

    LIBS = -lpulse -lpulse-simple -lpthread -lm

    the one pruduced by the crosscompiling toolchaine :

    LIBS = -lpthread -lm

    How can I force the toolchaine to considerate thoses non used libraries -lpulse -lpulse-simple and other related changes ?

     

    Last edit: Louwi 2014-04-07
  • Nickolay V. Shmyrev

    I notced that the makefile produced by the cros-compiling tool chaine and the one produced in my pc don't use the same libraries !

    That's ok, you probably don't need to use pulseaudio on your device. Is it supported at all there?

     
  • Louwi

    Louwi - 2014-04-07

    I don't understand "is it supported at all there?" !

     
  • Nickolay V. Shmyrev

    Does pulseaudio run on your device?

     
  • Louwi

    Louwi - 2014-04-07

    no I didn't installed it yet !

    I still have problem with the compiling toolchaine. cause it break at the end. just after compiling all codes it sucssed at creating the .o of all .c files but when creating the package it fail :/

    I'm using OpenWRT SDK for cross-compiling. it provide a tool chaine with all prerecuired configuration.

    If you can help me on telling me what is the source of the error I will be so thunkfull :)

    here is my log file :

    http://www.speedyshare.com/ZsAmc/logfile.txt

    I get the log file by tupping this commade :

    make package/sphinxbase-0.8/compile V=99 > logfile.txt

    That command is supported by the OpenWRT SDK.

    The log file don't containe any error or warning I chekked it.
    the error and warning are showed on the Terminal :

    configure: WARNING: unrecognized options: --disable-nls
    configure: WARNING: Disabling python since development headers were not found
    configure: WARNING: unrecognized options: --disable-nls
    install: omitting directory `/home/amir/Bureau/openwrt/build_dir/target-mipsel_r2_uClibc-0.9.32/sphinxbase-0.8'
    make[2]: [/home/amir/Bureau/openwrt/bin/ramips/packages/sphinxbase-0.8_0.8-1_ramips.ipk] Error 1
    make[1]:
    [package/sphinxbase-0.8/compile] Error 2
    make: *** [package/sphinxbase-0.8/compile] Error 2

     
  • Nickolay V. Shmyrev

    If you can help me on telling me what is the source of the error I will be so thunkfull :)

    In your sphinxbase openwrt package you have additional --disable-nls option to configure. You need to remove that option to not confuse configure.

     
  • Nickolay V. Shmyrev

    In the future you can just look for files containing --disable-nls, it will give you the exact location for a trouble. If you know how to search inside files it can help you a lot.

     
  • Louwi

    Louwi - 2014-04-08

    thunk you a lot.

    I will post how to fix this as soon as it work. may be some one else need it one day.

     
  • Louwi

    Louwi - 2014-04-08

    So I succed to remove that option "--disable-nls"

    by modificate the file : "~/openwrt/rules.mk"
    in fact I changed those lignes :


    ifeq ($(CONFIG_ENABLE_LOCALE),true)
    DISABLE_NLS:=--enable-nls
    else
    DISABLE_NLS:=--disable-nls
    endif


    to be ;


    ifeq ($(CONFIG_ENABLE_LOCALE),true)
    DISABLE_NLS:=
    else
    DISABLE_NLS:=
    endif


    so the worning " configure: WARNING: unrecognized options: --disable-nls" don't appear any more.

    but the excution of
    $make package/sphinxbase-0.8/compile V=99 > logfile.txt
    always end with the same error.

    here is the log file :
    http://speedy.sh/hvFYP/logfile.txt

    & here is the messages showed in the Terminal :


    configure: WARNING: Disabling python since development headers were not found
    install: omitting directory `/home/amir/Bureau/openwrt/build_dir/target-mipsel_r2_uClibc-0.9.32/sphinxbase-0.8'
    make[2]: [/home/amir/Bureau/openwrt/bin/ramips/packages/sphinxbase-0.8_0.8-1_ramips.ipk] Error 1
    make[1]:
    [package/sphinxbase-0.8/compile] Error 2
    make: *** [package/sphinxbase-0.8/compile] Error 2


    //for the first warning it's normal even when I compile the project for my PC it show and it end with succes.


    when I excute { $./configure } manualy for my PC configuration this script show error and telling me
    ./configure: line 2116: config.log: Permission denied
    ./configure: line 2126: config.log: Permission denied

    unless I excute it with root : { $sudo ./configure }

    any way I don't think that this is the source of problem cause what is done in my pc when I excute the configure script with root is maked when the configure is excuted by the OpenWRT SDK.

     
  • Louwi

    Louwi - 2014-04-10

    problem had been solved.

    it was this line in the makefile

    $(INSTALL_BIN) $(PKG_BUILD_DIR) $(1)/bin/

    $(PKG_BUILD_DIR) don't contain the sared libraries ".so" that had been cross-compiled.
    infact the
    .so files are palced in the src directorie incide lib folders.

     
  • Louwi

    Louwi - 2014-05-05

    Hello everyone,

    At this stage I succeed implementing the recognition program on my target "RT3883" OS OpenWRT, I installed pulse-audio deamon 5.0 and the tow libraries sphinxbase-0.8 and pocketsphinx-0.8.

    the problem is that the program return error :

    Error opening audio device alsa_input.0.analog-mono for capture: Connection refused
    FATAL_ERROR: "fr-recognizer.c", line 117: Failed to open audio device

    I get the name of the device by using this command :

    pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
    alsa_input.0.analog-mono
    auto_null.monitor

    searching for the source of the problem I noticed that pulseaudio is automatically killed when the program try to execute this line witch open the audio source device :

    if ((ad = ad_open_dev(mic_name, (int)cmd_ln_float32_r(config, "-samprate"))) == NULL)
    E_FATAL("Failed to open audio device\n");

    when I cross-compiled pulse-audio I used this set of preconfiguration :

    CONFIGURE_ARGS += \ --with-system-user=root \ --with-system-group=root \ --with-access-group=root \ --enable-alsa \ --disable-hal \ --disable-gconf \ --disable-tcpwrap \ --disable-nls \ --disable-solaris \ --disable-glib2 \ --disable-gtk2 \ --disable-jack \ --disable-asyncns \ --disable-lirc \ --disable-bluez \ --without-caps


    I also tried to use alsalib without pulseaudio support to access to my device and it had succeed to get into it without the need of pulseaudio but the program it wasn't able to configure the sample Rate.

    Does any one have an idea how to fix this ?

     

    Last edit: Louwi 2014-05-05

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.