Open cary-rowen opened 1 month ago
Hi @cary-rowen,
Sorry, I don't have any computer with MetecBD driver installed, which is hard to be accomplished without sight.
You may do the following steps to help me update the addon:
addons\MetecBD\manifest.ini
by notepad
.lastTestedNVDAVersion
to the recent available version, e.g. 2024.4.Thanks.
Hi After upgrading to the latest version of NVDA, the way of loading DLL seems to have changed a little. I made some changes. But still getting the error, I haven't looked into it carefully yet!
IO - braille.BrailleBuffer.update (19:20:47.528) - MainThread (4360):
Braille regions text: ['日志片段开始点已标记,再按一次复制到剪贴板']
IO - braille.BrailleHandler.update (19:20:47.528) - MainThread (4360):
Braille window dots:
IO - speech.speech.speak (19:20:47.528) - MainThread (4360):
Speaking ['日志片段开始点已标记,再按一次复制到剪贴板']
IO - inputCore.InputManager.executeGesture (19:20:48.300) - winInputHook (9120):
Input: kb(laptop):enter
DEBUG - autoSettingsUtils.autoSettings.AutoSettings._registerConfigSaveAction (19:20:48.300) - MainThread (4360):
registering pre_configSave action: <class 'brailleDisplayDrivers.MetecBD.BrailleDisplayDriver'>
ERROR - braille.BrailleHandler.setDisplayByName (19:20:51.490) - MainThread (4360):
Error initializing display driver 'MetecBD'
Traceback (most recent call last):
File "braille.pyc", line 2304, in setDisplayByName
File "braille.pyc", line 2371, in _setDisplay
File "braille.pyc", line 2341, in _switchDisplay
File "extensionPoints\util.pyc", line 216, in callWithSupportedKwargs
File "C:\Users\Administrator\AppData\Roaming\nvda\addons\MetecBD\brailleDisplayDrivers\MetecBD.py", line 180, in __init__
raise RuntimeError("No MetecBD found")
RuntimeError: No MetecBD found
IO - braille.BrailleBuffer.update (19:20:51.571) - MainThread (4360):
Braille regions text: ['点显器错误 对话框 无法加载 MetecBD 显示。']
IO - braille.BrailleHandler.update (19:20:51.571) - MainThread (4360):
Braille window dots:
IO - speech.speech.speak (19:20:51.571) - MainThread (4360):
Speaking ['点显器错误', '对话框', '无法加载 MetecBD 显示。', CancellableSpeech (still valid)]
IO - braille.BrailleBuffer.update (19:20:51.576) - MainThread (4360):
Braille regions text: ['点显器错误 对话框 无法加载 MetecBD 显示。', ' 确认 按钮']
IO - braille.BrailleHandler.update (19:20:51.576) - MainThread (4360):
Braille window dots:
IO - speech.speech.speak (19:20:51.576) - MainThread (4360):
Speaking ['确认', '按钮', CancellableSpeech (still valid)]
IO - inputCore.InputManager.executeGesture (19:20:52.302) - winInputHook (9120):
Input: kb(laptop):enter
IO - braille.BrailleBuffer.update (19:20:52.363) - MainThread (4360):
Braille regions text: ['选择盲文点显器 对话框']
IO - braille.BrailleHandler.update (19:20:52.363) - MainThread (4360):
Braille window dots:
IO - speech.speech.speak (19:20:52.363) - MainThread (4360):
Speaking ['选择盲文点显器', '对话框', CancellableSpeech (still valid)]
IO - braille.BrailleBuffer.update (19:20:52.363) - MainThread (4360):
Braille regions text: ['选择盲文点显器 对话框', ' 点显器(D): 组合框 METEC USP Devices 已折叠 Alt+d']
IO - braille.BrailleHandler.update (19:20:52.363) - MainThread (4360):
Braille window dots:
IO - speech.speech.speak (19:20:52.363) - MainThread (4360):
Speaking ['点显器(D):', '组合框', 'METEC USP Devices', '已折叠', 'Alt+d', CancellableSpeech (still valid)]
DEBUGWARNING - IAccessibleHandler.internalWinEventHandler._shouldGetEvents (19:20:52.637) - MainThread (4360):
Foreground took too long to change. Foreground still 6227040 (#32770). Should be 721898 (CherryWindowClass)
DEBUG - speech.manager.SpeechManager._handleIndex (19:20:53.013) - MainThread (4360):
Unknown index 69, speech probably cancelled from main thread.
IO - inputCore.InputManager.executeGesture (19:20:53.237) - winInputHook (9120):
Input: kb(laptop):NVDA+shift+control+f1
Here is the code block I changed:
DLL_NAME = "MetecBD.dll"
path = os.environ.get('PATH')
currentPath = os.path.dirname(__file__)
if currentPath not in path.split(os.pathsep):
os.environ['PATH'] = os.pathsep.join([path, currentPath])
dllPath = os.path.join(currentPath, DLL_NAME)
try:
MetecBD = cdll.LoadLibrary(dllPath)
except:
MetecBD = None
log.error("LoadLibrary failed " + dllPath)
Hi @cary-rowen,
Could you give me the initial error log before any modification, please?
Line 180 is not raise RuntimeError("No MetecBD found")
in the original MetecBD.py
.
Furthermore, from your current log, the error is caused by the improper returned value of a dll function BrdInitDevice
.
I cannot determine the reason of the error. Could you find the FIRST NVDA version where the error appears?
Hi @school510587
Here is the original error log, I managed to capture it: I reproduced the error below using NVDA-2024.4rc1 and using the latest master code from the repo.
log```
ERROR - external:brailleDisplayDrivers.MetecBD (23:52:32.100) - MainThread (22252):
LoadLibrary failed MetecBD.dll
ERROR - braille.getDisplayDrivers (23:52:32.100) - MainThread (22252):
Error while importing braille display driver MetecBD
Traceback (most recent call last):
File "braille.pyc", line 3674, in getDisplayDrivers
File "braille.pyc", line 462, in _getDisplayDriver
File "importlib__init__.pyc", line 126, in import_module
File "
Hi @cary-rowen,
OK, I have modified the code according to its opinion: the full path with constructor syntax.
Please try whether you can reproduce the previous RuntimeError with the latest NVDA.
If yes, could you try earlier NVDA, e.g. 2021.1 and 2022.1, to find the first version that produces the RuntimeError?
I will test it out later and provide further feedback.
Hi @school510587
I used the latest master branch for testing and still received the following error. I used 2024.4rc1 and 2021.3.5 and it seemed that the errors I encountered were no different.
IO - speech.speech.speak (19:58:08.444) - MainThread (3492):
Speaking [LangChangeCommand ('zh_CN'), '日志片段开始点已标记,再按一次复制到剪贴板']
IO - inputCore.InputManager.executeGesture (19:58:09.033) - winInputHook (12128):
Input: kb(desktop):enter
DEBUG - autoSettingsUtils.autoSettings.AutoSettings._registerConfigSaveAction (19:58:09.043) - MainThread (3492):
registering pre_configSave action: <class 'brailleDisplayDrivers.MetecBD.BrailleDisplayDriver'>
ERROR - braille.BrailleHandler.setDisplayByName (19:58:12.194) - MainThread (3492):
Error initializing display driver 'MetecBD'
Traceback (most recent call last):
File "braille.pyc", line 2304, in setDisplayByName
File "braille.pyc", line 2371, in _setDisplay
File "braille.pyc", line 2341, in _switchDisplay
File "extensionPoints\util.pyc", line 216, in callWithSupportedKwargs
File "C:\Users\Lenovo\AppData\Roaming\nvda\addons\MetecBD\brailleDisplayDrivers\MetecBD.py", line 177, in __init__
raise RuntimeError("No MetecBD found")
RuntimeError: No MetecBD found
IO - speech.speech.speak (19:58:12.246) - MainThread (3492):
Speaking [LangChangeCommand ('zh_CN'), '点显器错误', '对话框', '无法加载 MetecBD 显示。', CancellableSpeech (still valid)]
IO - speech.speech.speak (19:58:12.247) - MainThread (3492):
Speaking [LangChangeCommand ('zh_CN'), '确认', '按钮', CancellableSpeech (still valid)]
IO - inputCore.InputManager.executeGesture (19:58:13.623) - winInputHook (12128):
Input: kb(desktop):enter
IO - speech.speech.speak (19:58:13.660) - MainThread (3492):
Speaking [LangChangeCommand ('zh_CN'), '选择盲文点显器', '对话框', CancellableSpeech (still valid)]
IO - speech.speech.speak (19:58:13.661) - MainThread (3492):
Speaking [LangChangeCommand ('zh_CN'), '点显器(D):', '组合框', 'METEC USP Devices', '已折叠', 'Alt+', CharacterModeCommand(True), 'd', CharacterModeCommand(False), CancellableSpeech (still valid)]
IO - inputCore.InputManager.executeGesture (19:58:14.399) - winInputHook (12128):
Input: kb(desktop):NVDA+shift+control+f1
Hi @cary-rowen,
Could you get the string from 3 NVDA versions: 2020.3, 2020.4, and 2021.1?
Using the latest master uploaded at 11:30pm, there should be one more information in the report.
For example, self._BrdDeviceNr.value = 0, self._BrdDeviceTyp.value = 1
.
Thanks.
Hi below is the complete log I captured according to your instructions:
Hi @cary-rowen,
I find RuntimeError: No MetecBD found
in all of the 3 versions, and the reason is the same, failure of MetecBD.BrdInitDevice.
Has the driver ever successfully executed on this computer before? If yes, what is the last NVDA version then?
Otherwise, i doubt that the actual driver program does not work on Windows successfully.
Hi @school510587
I guess the driver never executed successfully on this machine. I don't know if this has anything to do with Windows 11. I'd love to find a machine that actually does the metec driver to get more information.
Since we don't have the source code of MetecBD.dll, it may be difficult for us to debug further in this case.
Hi @cary-rowen,
Is it possible to install and run CKBS (晴光) successfully on your machine? If the driver works, CKBS will have normal braille functions. An alternative is to borrow a notebook with CKBS installed on Windows 11 from TKU.
Considering only the purpose to update the add-on, a computer with the latest NVDA and working Metec driver is enough, regardless of the OS.
Hi @school510587
Will you upgrade this add-on to be compatible with NVDA2024.4 or even 2025.1?