Running mod-sdk on Raspberry Pi 4

:wave:

After having no luck getting the mod-sdk running on MacOS, or Ubuntu using virtualisation, I am now trying to get it running on a Raspberry Pi 4 running Raspbian.

  1. Install dependancies
sudo apt-get install build-essential liblilv-dev python3-pil python3-pystache python3-setuptools python3-pyinotify
pip install tornado==4.3
  1. Build
sudo python3 setup.py build
  1. Install
sudo python3 setup.py install
  1. Run
modsdk

Here’s the error message it returns when I go to localhost:9000

Using raw lilv for plugin info (without checks)

Please configure your environment properly. The following issues were found:

  - PhantomJS not found. Please install it and make sure the binary is located at /usr/local/bin/phantomjs


Welcome to the MOD-SDK
The goal of this SDK is to implement the MODGUI specification for LV2, so you must be familiar with LV2 first.
Please check http://lv2plug.in/ if you need help on that.

To start testing your plugin interfaces, open your webkit-based browser (Google Chrome, Chromium, Safari) and point to http://localhost:9000
ERROR:tornado.application:Uncaught exception GET /?v=1675377874 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:9000', method='GET', uri='/?v=1675377874', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Host': 'localhost:9000', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (X11; CrOS armv7l 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.105 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Sec-Fetch-Site': 'none', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-User': '?1', 'Sec-Fetch-Dest': 'document', 'Sec-Ch-Ua': '" Not A;Brand";v="99", "Chromium";v="104"', 'Sec-Ch-Ua-Mobile': '?0', 'Sec-Ch-Ua-Platform': '"Linux"', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8'})
Traceback (most recent call last):
  File "/home/dmh-pi/.local/lib/python3.9/site-packages/tornado/web.py", line 1443, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/usr/local/lib/python3.9/dist-packages/modsdk/webserver.py", line 467, in get
    with open(DEFAULT_ICON_TEMPLATE, 'r') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/mod-sdk/html/resources/templates/pedal-default.html'
ERROR:tornado.access:500 GET /?v=1675377874 (127.0.0.1) 67.31ms
WARNING:tornado.access:404 GET /favicon.ico (127.0.0.1) 1.38ms

When I go to /usr/share/ I can see there is no mod-sdk folder.

Any clues as to what is going wrong? I’d love to be able to contribute.

Happy to make an issue on GitHub instead if that is easier.

2 Likes

If I try and brute force it by copying my mod-sdk folder to /usr/share/ the errors go away. But I get the following message in the browser

1 Like

One last one, if I try sudo modsdk I get:

Traceback (most recent call last):
  File "/usr/local/bin/modsdk", line 33, in <module>
    sys.exit(load_entry_point('modsdk==2.0.0', 'console_scripts', 'modsdk')())
  File "/usr/local/bin/modsdk", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/dist-packages/modsdk/webserver.py", line 15, in <module>
    from tornado import web, options, ioloop, template, httpclient, websocket
ModuleNotFoundError: No module named 'tornado'

:frowning_face:

1 Like

Hi
I never installed mod-sdk, but running it directly from the source folder by pointing my terminal to the source folder ~/mod-sdk/ and run ./development_server.py Then open localhost in my web-browser.
Don’t use mod-sdk as root!
This way all needed files been in place, also, for hacking on the sources I didn’t need to be root.

Anyway, nice you got it running so far. Now you need to install some LV2 plugins. Rasbian is based on debian, so you could run in your terminal
apt-cache search .lv2
this will give you a huge list of available LV2 plugs. As a suggestion you could use for a start
sudo apt install dpf-plugins-lv2 guitarix-lv2

after that, when you open the development_server.py (localhost) next time, you could select a plug to work with from the list. When you follow now the assistant you’ll quickly save your first modui. That will go into ~/.lv2
From there you could start hacking the modui files. When you keep the browser open on localhost you get direct feedback for what you’ve done with the sources.
That, could later ported back to the mod-sdk sources.

3 Likes

@brummer, thanks for taking the time to read my comments. I really appreciate your thoughtful reply.

Ah ok, I’ll give it a try. I interpreted the instructions on the repo to mean that this wouldn’t work.

If I get it running this way, I’ll create an MR for the read me to clarify.

This state is expected? :sweat_smile:

Whoops, I’ve been here a few times. But I guess I made the wrong assumption about what the message meant. I think I assumed there’s be at least one LV2 built in to avoid a dependency.

I’ll think about the experience for a novice like myself and try create some MRs to improve that.

Thanks for this info! I think I’d have been looking everywhere :see_no_evil:

I’ll give it all another try when I get a few hours

2 Likes

I’m in! I don’t believe it :joy: what a journey.

I can’t generate a screenshot, but I have enough confidence to start optimising assets.

Here’s the errors I get when trying to generate a screenshot

Browser alert:

localhost:9000 says

Error: Can't generate thumbnail. Is your server running? Check the logs.

[OK]

terminal output:

ERROR:tornado.application:Uncaught exception GET /screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=251&height=434&_=1675453875052 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:9000', method='GET', uri='/screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=251&height=434&_=1675453875052', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Host': 'localhost:9000', 'Connection': 'keep-alive', 'Sec-Ch-Ua': '" Not A;Brand";v="99", "Chromium";v="104"', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'X-Requested-With': 'XMLHttpRequest', 'Sec-Ch-Ua-Mobile': '?0', 'User-Agent': 'Mozilla/5.0 (X11; CrOS armv7l 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.105 Safari/537.36', 'Sec-Ch-Ua-Platform': '"Linux"', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty', 'Referer': 'http://localhost:9000/?v=1675453743', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8'})
Traceback (most recent call last):
  File "/home/dmh-pi/.local/lib/python3.9/site-packages/tornado/web.py", line 1401, in _stack_context_handle_exception
    raise_exc_info((type, value, traceback))
  File "<string>", line 3, in raise_exc_info
  File "/home/dmh-pi/.local/lib/python3.9/site-packages/tornado/web.py", line 1603, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/dmh-pi/Desktop/oss/mod-sdk/modsdk/webserver.py", line 508, in get
    self.make_screenshot()
  File "/home/dmh-pi/Desktop/oss/mod-sdk/modsdk/webserver.py", line 516, in make_screenshot
    proc = subprocess.Popen([ PHANTOM_BINARY,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/usr/local/bin/phantomjs'
ERROR:tornado.access:500 GET /screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=251&height=434&_=1675453875052 (127.0.0.1) 34.64ms
ERROR:tornado.access:500 GET /screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=251&height=434&_=1675453875052 (127.0.0.1) 35.12ms
NOTICE: Plugin 'http://guitarix.sourceforge.net/plugins/gx_bossds1_#_bossds1_' was not (fully) cached, scanning it now...
ERROR:tornado.application:Uncaught exception GET /screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=277&height=518&_=1675453875054 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:9000', method='GET', uri='/screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=277&height=518&_=1675453875054', version='HTTP/1.1', remote_ip='127.0.0.1', headers={'Host': 'localhost:9000', 'Connection': 'keep-alive', 'Sec-Ch-Ua': '" Not A;Brand";v="99", "Chromium";v="104"', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'X-Requested-With': 'XMLHttpRequest', 'Sec-Ch-Ua-Mobile': '?0', 'User-Agent': 'Mozilla/5.0 (X11; CrOS armv7l 13597.84.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.105 Safari/537.36', 'Sec-Ch-Ua-Platform': '"Linux"', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty', 'Referer': 'http://localhost:9000/?v=1675453743', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8'})
Traceback (most recent call last):
  File "/home/dmh-pi/.local/lib/python3.9/site-packages/tornado/web.py", line 1401, in _stack_context_handle_exception
    raise_exc_info((type, value, traceback))
  File "<string>", line 3, in raise_exc_info
  File "/home/dmh-pi/.local/lib/python3.9/site-packages/tornado/web.py", line 1603, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/dmh-pi/Desktop/oss/mod-sdk/modsdk/webserver.py", line 508, in get
    self.make_screenshot()
  File "/home/dmh-pi/Desktop/oss/mod-sdk/modsdk/webserver.py", line 516, in make_screenshot
    proc = subprocess.Popen([ PHANTOM_BINARY,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/usr/local/bin/phantomjs'
ERROR:tornado.access:500 GET /screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=277&height=518&_=1675453875054 (127.0.0.1) 27.30ms
ERROR:tornado.access:500 GET /screenshot?uri=http%3A%2F%2Fguitarix.sourceforge.net%2Fplugins%2Fgx_bossds1_%23_bossds1_&width=277&height=518&_=1675453875054 (127.0.0.1) 28.02ms

I’m going to have another go at trying to get it to run on macOS as that will make my workflow much easier.

Thanks for all your help so far!

Update: Nice, got it working on the mac with some more hackery. Still no screenshot generation.

Update: I was wrong, I didn’t get it working on the mac :frowning:

4 Likes

First MR lets gooooo feat(noBundles) add suggestion for user to resolve error by danmizziharris · Pull Request #32 · moddevices/mod-sdk · GitHub

All feedback welcome.

If the process isn’t too painful, I can start thinking about recreating some of the assets / contributing some more plugin themes.

3 Likes