Page 1 of 1

Unable to read .cfg files

Posted: Wed Nov 03, 2021 2:01 am
by bertankursun
Hi,
I am trying to run example .cfg files on the B&C Hub, trying to use it as a remote server.
Could you please tell me what I am doing wrong?
  • I have connected to 10.0.0.1
  • I have transfered the example file with "scp gain_live_getting_started.cfg root@10.0.0.1:/etc/mahalia/"
  • I have double checked that the file is in the directory from mahalia terminal
    mha@mahalia:~$ ls /etc/mahalia
    1speaker_diffNoise_2ch.wav config gain_live_getting_started.cfg mha_configuration
    calibration gain_getting_started.cfg headsets nodered
  • Then I " nc 10.0.0.1 33337 " and mha terminal opens. I type the mha command to read the file but I receive this error below:
    ?read:/etc/mahalia/gain_live_getting_started.cfg
    (mha_parser) (mha_parser) Invalid operator: "" ()
    (while parsing "/etc/mahalia/gain_live_getting_started.cfg" line 1)
    (MHA:failure)
  • I wanted to try the calibration files that are already in the memory but those ones also were failed to read
    ?read:/etc/mahalia/headsets/amplified/calib_outS.cfg
    (mha_parser) (mha_parser) Invalid entry: "peaklevel"
    (while parsing "/etc/mahalia/headsets/amplified/calib_outS.cfg" line 1)
    (MHA:failure)

Re: Unable to read .cfg files

Posted: Thu Nov 04, 2021 11:23 am
by hendrikkayser
Hi,
you're encountering two different issues here.
The first one may be related to file permissions - the mha process on the PHL is run as the user mha, not as root. Scp the file to your system with mha@10.0.0.1:... and try again. Please report if that resolved your issue.

The second issue is related to the configuration itself. The file can be read, but 'calib_outS.cfg' is ususally read from another configuration to assign a value to "peaklevel". This requires to have this part of the configuration already loaded to have peaklevel available. You could try to load /etc/mahalia/generic-hearing-aid/index.cfg which is the starting point for the configuration mentioned above.

Re: Unable to read .cfg files

Posted: Tue Nov 09, 2021 5:01 am
by bertankursun2
Hi Hendrik,

thanks for you help. I have tried what you suggested, however, this time I have encountered another error.
  • I have transfered the file with pass: mahalia

    Code: Select all

    scp gain_live_getting_started.cfg mha@10.0.0.1:
    mha@10.0.0.1's password:
    gain_live_getting_started.cfg                    100%  808    50.7KB/s   00:00
    
  • Then I have confirmed that the file is there

    Code: Select all

    mha@mahalia:~$ ls
    gain_live_getting_started.cfg  trial
  • Then I started mha with nc 10.0.0.1 33337
  • When I wrote

    Code: Select all

    ?read:gain_live_getting_started.cfg
    it gave (mha_parser) not able to open file error
  • I tried moving the file to a folder :

    Code: Select all

    mha@mahalia:~$ sudo mv gain_live_getting_started.cfg trial/
    mha@mahalia:~$ ls
    trial
    mha@mahalia:~$ cd trial
    mha@mahalia:~/trial$ ls
    gain_live_getting_started.cfg
  • Then I tried any combination that I could come up with but it keeps giving me the same error

    Code: Select all

    ?read:trial/gain_live_getting_started.cfg
    (mha_parser) not able to open file "trial/gain_live_getting_started.cfg" for reading.
    (MHA:failure)
    ?read:/trial/gain_live_getting_started.cfg
    (mha_parser) not able to open file "/trial/gain_live_getting_started.cfg" for reading.
    (MHA:failure)
    ?read:~/trial/gain_live_getting_started.cfg
    (mha_parser) not able to open file "~/trial/gain_live_getting_started.cfg" for reading.
    (MHA:failure)
    ?read:mha@mahalia:~/trial/gain_live_getting_started.cfg
    (mha_parser) not able to open file "mha@mahalia:~/trial/gain_live_getting_started.cfg" for reading.
    (MHA:failure)
    ?read:mha@mahalia:/trial/gain_live_getting_started.cfg
    (mha_parser) not able to open file "mha@mahalia:/trial/gain_live_getting_started.cfg" for reading.
    (MHA:failure)
    ?read:mha@mahalia:trial/gain_live_getting_started.cfg
    (mha_parser) not able to open file "mha@mahalia:trial/gain_live_getting_started.cfg" for reading.
    (MHA:failure)
What does it look like I am missing this time?

Re: Unable to read .cfg files

Posted: Tue Nov 09, 2021 7:16 am
by hendrikkayser
Hello,
scp ... mha@10.0.0.1 copied your file to /home/mha, but '~' does not work here, try:

Code: Select all

?read:/home/mha/trial/gain_live_getting_started.cfg

Re: Unable to read .cfg files

Posted: Tue Nov 09, 2021 10:00 pm
by bertankursun2
Thanks for your quick response!

I could confirm that the file is where you have suggested from the mahalia terminal:

Code: Select all

mha@mahalia:~$ cd /home/mha/trial
mha@mahalia:~/trial$ ls
gain_live_getting_started.cfg
Unfortunately, it did not work in the mha terminal.

Code: Select all

?read:mha@mahalia:/home/mha/trial/gain_live_getting_started.cfg
(mha_parser) not able to open file "mha@mahalia:/home/mha/trial/gain_live_getting_started.cfg" for reading.
(MHA:failure)
?read:/home/mha/trial/gain_live_getting_started.cfg
(mha_parser) (mha_parser) The variable is locked.
(while parsing "/home/mha/trial/gain_live_getting_started.cfg" line 2)
(MHA:failure)
Do I need to do anything else after initiating the MHA terminal with "nc 10.0.0.1 33337" ? I am writing the ?read:... command directly.

Re: Unable to read .cfg files

Posted: Tue Nov 09, 2021 10:18 pm
by hendrikkayser
Sorry, I had a typo in my last response. I have corrected it - your second version in your post is correct. The last error occurs because there is already a configuration active and a variable is locked. This may be due to your previous attempts or because the Mahalia system on the PHL automatically loads a configuration at startup.
You can avoid this by disabling the mahalia system service. Please see this thread for more info on that:
viewtopic.php?f=18&t=136