Getting I/O error on writing
Posted: Wed Feb 02, 2022 9:27 pm
I am running a python code that runs the 00-gains/gain_getting_started.cfg as a python code
connected remotely to PHL. I get the following error.
Running: ['ssh', 'mha@10.0.0.1', 'sh', './StopMHA;cd', '/home/mha/Poz/Poz_examples/00-gain;mha', '--interactive', '--interface=10.0.0.1', '--port=33337']
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
mha: no process found
Traceback (most recent call last):
File "/home/pi/Poz/Poz_examples/00-gain/gain_getting_started.py", line 188, in <module>
mha.set_val('cmd','prepare')
File "/home/pi/openMHA-4.16.1/openMHA/mha/tools/python/openMHA/MHAConnection.py", line 235, in set_val
return self.set_val_raw(path, value).decode()
File "/home/pi/openMHA-4.16.1/openMHA/mha/tools/python/openMHA/MHAConnection.py", line 200, in set_val_raw
return self._send_command(cmd)
File "/home/pi/openMHA-4.16.1/openMHA/mha/tools/python/openMHA/MHAConnection.py", line 121, in _send_command
raise ValueError(
ValueError: Error sending message b'cmd=prepare\n' with error code 1:
Response: b'\n(mhafw_lib) IO error: (MHAIOFile) Unable to open "1speaker_diffNoise_2ch_OUT.wav" for writing.\n(MHA:failure)'
I see the following on PHL when I log in directly after the failure:
-rw-r--r-- 1 mha mha 1219560 Sep 20 13:19 1speaker_diffNoise_2ch.wav
-rw-r--r-- 1 mha mha 0 Oct 19 18:20 1speaker_diffNoise_2ch_OUT.wav
So the file name get created, but mha is not allowed to write into it.
If I run the .cfg file directly logged into PHL it runs ok.
My code looks like..
mha=setup_PHL()
setup_alsa(mha)
mha.set_val('iolib ',' MHAIOFile')
mha.set_val('mha.addin.algos','[ gain ]')
mha.set_val('mha.addin.gain.min','-20')
mha.set_val('mha.addin.gain.max','20')
mha.set_val('mha.addin.gain.gains','[ -10 10 0 0 0 0 ]')
#mha.set_val('io.in.device','hw:0')
#mha.set_val('io.out.device','hw:0')
mha.set_val('io.in ','1speaker_diffNoise_2ch.wav')
mha.set_val('io.out ','1speaker_diffNoise_2ch_OUT.wav')
What am I missing?
Dan Poznanovic
connected remotely to PHL. I get the following error.
Running: ['ssh', 'mha@10.0.0.1', 'sh', './StopMHA;cd', '/home/mha/Poz/Poz_examples/00-gain;mha', '--interactive', '--interface=10.0.0.1', '--port=33337']
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
mha: no process found
Traceback (most recent call last):
File "/home/pi/Poz/Poz_examples/00-gain/gain_getting_started.py", line 188, in <module>
mha.set_val('cmd','prepare')
File "/home/pi/openMHA-4.16.1/openMHA/mha/tools/python/openMHA/MHAConnection.py", line 235, in set_val
return self.set_val_raw(path, value).decode()
File "/home/pi/openMHA-4.16.1/openMHA/mha/tools/python/openMHA/MHAConnection.py", line 200, in set_val_raw
return self._send_command(cmd)
File "/home/pi/openMHA-4.16.1/openMHA/mha/tools/python/openMHA/MHAConnection.py", line 121, in _send_command
raise ValueError(
ValueError: Error sending message b'cmd=prepare\n' with error code 1:
Response: b'\n(mhafw_lib) IO error: (MHAIOFile) Unable to open "1speaker_diffNoise_2ch_OUT.wav" for writing.\n(MHA:failure)'
I see the following on PHL when I log in directly after the failure:
-rw-r--r-- 1 mha mha 1219560 Sep 20 13:19 1speaker_diffNoise_2ch.wav
-rw-r--r-- 1 mha mha 0 Oct 19 18:20 1speaker_diffNoise_2ch_OUT.wav
So the file name get created, but mha is not allowed to write into it.
If I run the .cfg file directly logged into PHL it runs ok.
My code looks like..
mha=setup_PHL()
setup_alsa(mha)
mha.set_val('iolib ',' MHAIOFile')
mha.set_val('mha.addin.algos','[ gain ]')
mha.set_val('mha.addin.gain.min','-20')
mha.set_val('mha.addin.gain.max','20')
mha.set_val('mha.addin.gain.gains','[ -10 10 0 0 0 0 ]')
#mha.set_val('io.in.device','hw:0')
#mha.set_val('io.out.device','hw:0')
mha.set_val('io.in ','1speaker_diffNoise_2ch.wav')
mha.set_val('io.out ','1speaker_diffNoise_2ch_OUT.wav')
What am I missing?
Dan Poznanovic