jackaudio / a2jmidid

ALSA sequencer to JACK MIDI bridging (for jack2)
GNU General Public License v2.0
43 stars 16 forks source link

emit more useful message on dbus exception #12

Open Stemby opened 4 years ago

Stemby commented 4 years ago

Hi, I'm just forwarding this bug report issued via Debian BTS.

Best regards, Carlo

Stemby commented 4 years ago

OK, I found the problem: JACK has to be running before launching $ a2j_control --start.

I think a less cryptic message would be fine.

Best regards, Carlo

dvzrv commented 4 years ago

We can certainly look into excepting the dbus.exceptions.DBusException and emitting a more useful message. Unfortunately the exception itself does not necessarily tell us "why" dbus failed.

Pull requests welcome! :)

M1ndo commented 4 years ago

I'm having the same issue on arch linux , and the problem is not jack has to be running before executing a2j_control --start i have it already running and i'm still getting this issue.

dvzrv commented 4 years ago

Could you provide the output of a2j_control --status and whether you have tried to start the hardware export while a2j_control states its bridging to be enabled?

I can not reproduce an issue with a2j_control --start but a DbusException is raised when trying to enable the hardware while the bridge is started:

$ a2j_control --ehw
--- enable export of hardware ports
Traceback (most recent call last):
  File "/usr/bin/a2j_control", line 203, in <module>
    A2JControl()
  File "/usr/bin/a2j_control", line 199, in __init__
    self.call_controller_function()
  File "/usr/bin/a2j_control", line 186, in call_controller_function
    self.controller_export_hardware_ports(True)
  File "/usr/bin/a2j_control", line 151, in controller_export_hardware_ports
    self.controller_interface.set_hw_export(True)
  File "/usr/lib/python3.8/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3.8/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3.8/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.gna.home.a2jmidid.error.bridge_running: Bridge is started
M1ndo commented 4 years ago

i'm not sure what's going here, but it's seems not running a2jmidid -e starts the bridge with no errors and works as expected. while a2jmidid -e is running ,

a2j_control --start
--- start
Traceback (most recent call last):
  File "/usr/bin/a2j_control", line 203, in <module>
    A2JControl()
  File "/usr/bin/a2j_control", line 199, in __init__
    self.call_controller_function()
  File "/usr/bin/a2j_control", line 166, in call_controller_function
    self.controller_start()
  File "/usr/bin/a2j_control", line 94, in controller_start
    self.controller_interface.start()
  File "/usr/lib/python3.8/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3.8/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3.8/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.gna.home.a2jmidid.error.generic: a2j_start() failed.
a2j_control --status
--- status
Bridging disabled
Hardware exported
Allowing unique port names
a2j_control --ehw
--- enable export of hardware ports

without starting a2jmidid -e

a2j_control --start
--- start
~|⇒ a2j_control --status
--- status
Bridging enabled
Hardware exported
Allowing unique port names