monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
633 stars 147 forks source link

Question: help debugging norns docker environment #1414

Closed winder closed 3 years ago

winder commented 3 years ago

I'm trying to get the norns environment running in a docker container. The configuration is based on norns-dev, which works (including audio passthrough from the container), but it's configured to use software from 2018. I've updated the software to recent versions and everything is building and the stack runs, but is not working properly.

If someone could review the output I have below and suggest where to go from here I would really appreciate it.

jackd started with no error (once things are working I'll try :

we@e719483be391:~$ jackd --no-realtime -d dummy
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in non-realtime mode
self-connect-mode is "Don't restrict self connect requests"

crone started with no error:

we@2a57a8b183f5:~/norns$ ./crone.sh 
we@2a57a8b183f5:~/norns$ attempting to bind socket at url ws://*:5556
constructed Client: crone
constructed Client: softcut
initializing buffer management worker..
setting up jack clients..
engine sample rate: 48000
engine sample rate: 48000
starting jack clients..
compiling class library...
connecting ports... 
starting OSC interface...
osc methods: 
/hello []
/goodbye []
/quit []
/poll/start/vu []
/poll/stop/vu []
/set/level/adc [f]
/set/level/dac [f]
/set/level/ext [f]
/set/level/cut_master [f]
/set/level/ext_rev [f]
/set/level/rev_dac [f]
/set/level/monitor [f]
/set/level/monitor_mix [if]
/set/level/monitor_rev [f]
/set/level/compressor_mix [f]
/set/enabled/compressor [f]
/set/enabled/reverb [f]
/set/param/compressor/ratio [f]
/set/param/compressor/threshold [f]
/set/param/compressor/attack [f]
/set/param/compressor/release [f]
/set/param/compressor/gain_pre [f]
/set/param/compressor/gain_post [f]
/set/param/reverb/pre_del [f]
/set/param/reverb/lf_fc [f]
/set/param/reverb/low_rt60 [f]
/set/param/reverb/mid_rt60 [f]
/set/param/reverb/hf_damp [f]
/set/enabled/cut [if]
/set/level/cut [if]
/set/pan/cut [if]
/set/level/adc_cut [f]
/set/level/ext_cut [f]
/set/level/tape_cut [f]
/set/level/cut_rev [f]
/set/level/in_cut [iif]
/set/level/cut_cut [iif]
/set/param/cut/rate [if]
/set/param/cut/loop_start [if]
/set/param/cut/loop_end [if]
/set/param/cut/loop_flag [if]
/set/param/cut/fade_time [if]
/set/param/cut/rec_level [if]
/set/param/cut/pre_level [if]
/set/param/cut/rec_flag [if]
/set/param/cut/play_flag [if]
/set/param/cut/rec_offset [if]
/set/param/cut/position [if]
/set/param/cut/pre_filter_fc [if]
/set/param/cut/pre_filter_fc_mod [if]
/set/param/cut/pre_filter_rq [if]
/set/param/cut/pre_filter_lp [if]
/set/param/cut/pre_filter_hp [if]
/set/param/cut/pre_filter_bp [if]
/set/param/cut/pre_filter_br [if]
/set/param/cut/pre_filter_dry [if]
/set/param/cut/post_filter_fc [if]
/set/param/cut/post_filter_rq [if]
/set/param/cut/post_filter_lp [if]
/set/param/cut/post_filter_hp [if]
/set/param/cut/post_filter_bp [if]
/set/param/cut/post_filter_br [if]
/set/param/cut/post_filter_dry [if]
/set/param/cut/voice_sync [iif]
/set/param/cut/level_slew_time [if]
/set/param/cut/pan_slew_time [if]
/set/param/cut/recpre_slew_time [if]
/set/param/cut/rate_slew_time [if]
/set/param/cut/buffer [ii]
/softcut/buffer/read_mono [sfffii]
/softcut/buffer/read_stereo [sfff]
/softcut/buffer/write_mono [sffi]
/softcut/buffer/write_stereo [sff]
/softcut/buffer/clear []
/softcut/buffer/clear_channel [i]
/softcut/buffer/clear_region [ff]
/softcut/buffer/clear_region_channel [iff]
/softcut/buffer/clear_fade_region [ffff]
/softcut/buffer/clear_fade_region_channel [iffff]
/softcut/buffer/copy_mono [iifffffi]
/softcut/buffer/copy_stereo [fffffi]
/softcut/buffer/render [iffi]
/softcut/query/position [i]
/softcut/reset []
/set/param/cut/phase_quant [if]
/set/param/cut/phase_offset [if]
/poll/start/cut/phase []
/poll/stop/cut/phase []
/tape/record/open [s]
/tape/record/start []
/tape/record/stop []
/tape/play/open [s]
/tape/play/start []
/tape/play/stop []
/set/level/tape [f]
/set/level/tape_rev [f]
entering main loop...
    Found 738 primitives.
    Compiling directory '/usr/local/share/SuperCollider/SCClassLibrary'
    Compiling directory '/usr/local/share/SuperCollider/Extensions'
    Compiling directory '/home/we/.local/share/SuperCollider/Extensions'
    numentries = 1110845 / 12508526 = 0.089
    4223 method selectors, 2962 classes
    method table size 16489448 bytes, big table size 100068208
    Number of Symbols 11760
    Byte Code Size 330868
    compiled 455 files in 0.15 seconds

Info: 4 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll

compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Adding path: /home/we/norns/sc/core
Adding path: /home/we/norns/sc/engines
Adding path: /home/we/norns/sc/ugens
Adding path: /home/we/dust
Class tree inited in 0.02 seconds

*** Welcome to SuperCollider 3.12.0. *** For help type ctrl-c ctrl-h (Emacs) or :SChelp (vim) or ctrl-U (sced/gedit).
sc3> 

Maiden starts with a dbus error, but I'm able to load the webapp, and the REPL connection to matron works:

we@2a57a8b183f5:~/maiden$ ./maiden server --app ./app/build --data /home/we/dust --doc /home/we/norns/doc
[info] maiden (1.0.2)
[info]   http: port 5000
[info]    app: ./app/build
[info]   data: /home/we/dust
[info]    doc: /home/we/norns/doc
[warning] dbus connection error: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory

Matron starts but there are errors. The ones during startup don't seem to be a problem, but the lua engine is not properly started and there is a timeout failure. When loading a script there are more errors and a stack trace:

we@24fd765f6f4d:~/norns$ ./norns.sh
bash: ./norns.sh: No such file or directory
we@24fd765f6f4d:~/norns$ ./matron.sh 
attempting to bind socket at url ws://*:5555
ERROR (screen) cannot open framebuffer device: /dev/fb0
Unable to check temperature: vcgencmd not in path
*** WARNING *** The program 'matron' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
init oracle...
OSC rx port: 8888 
OSC crone port: 9999
OSC ext port: 57120
init weaver...
starting lua vm
running lua config file: dofile('/home/we/norns/lua/core/config.lua')
MATRON
norns version: 0.0.0
git hash: 79842a1

platform: 1
init dev_monitor...
setting cleanup...
init input...
running startup...
start_audio(): 
---> I added the next line. the arguments to scan are null so it uses these defaults, which don't seem to be correct.
r = /home/we/dust/code/, p = */lib/mod.lua
lua: /home/we/norns/lua/core/mods.lua:60: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
    [C]: in function 'pairs'
    /home/we/norns/lua/core/mods.lua:60: in function 'core/mods.load'
    /home/we/norns/lua/core/startup.lua:111: in main chunk
    [C]: in function 'require'
    /home/we/norns/lua/core/norns.lua:238: in function '_startup'
scanning devices...
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event5
dev_list_add: error allocating device data
failed to open hid device: /dev/input/mouse0
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event17
dev_list_add: error allocating device data
failed to open hid device: /dev/input/mouse3
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event16
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event18
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event24
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event23
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event19
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event20
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event21
dev_list_add: error allocating device data
device_monitor: skipping node-less entry in /dev/input
failed to open hid device: /dev/input/event22
dev_list_add: error allocating device data
handling pending events...
_norns.midi.add: 1, virtual, userdata: 0x55e7e2566bb0
running post-startup...
_norns._post_startup
# script clear
norns.startup_status.timeout
### SCRIPT ERROR: SUPERCOLLIDER FAIL
# script load: /home/we/dust/scripts/tehn/awake.lua
# cleanup
# script clear
### initializing data folder
### SCRIPT ERROR: load fail

<< load  awake.lua here >>

/home/we/dust/scripts/tehn/awake.lua:29: module 'mark_eats/musicutil' not found:
    no field package.preload['mark_eats/musicutil']
    no file '/home/we/norns/lua/mark_eats/musicutil.lua'
    no file '/home/we/norns/lua/core/mark_eats/musicutil.lua'
    no file '/home/we/norns/lua/core/params/mark_eats/musicutil.lua'
    no file '/home/we/norns/lua/lib/mark_eats/musicutil.lua'
    no file '/home/we/norns/lua/softcut/mark_eats/musicutil.lua'
    no file '/home/we/dust/code/mark_eats/musicutil.lua'
    no file '/usr/local/share/lua/5.3/mark_eats/musicutil.lua'
    no file '/usr/local/share/lua/5.3/mark_eats/musicutil/init.lua'
    no file '/usr/local/lib/lua/5.3/mark_eats/musicutil.lua'
    no file '/usr/local/lib/lua/5.3/mark_eats/musicutil/init.lua'
    no file '/usr/share/lua/5.3/mark_eats/musicutil.lua'
    no file '/usr/share/lua/5.3/mark_eats/musicutil/init.lua'
    no file './mark_eats/musicutil.lua'
    no file './mark_eats/musicutil/init.lua'
    no file '/usr/local/lib/lua/5.3/mark_eats/musicutil.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.3/mark_eats/musicutil.so'
    no file '/usr/lib/lua/5.3/mark_eats/musicutil.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './mark_eats/musicutil.so'
stack traceback:
    /home/we/norns/lua/core/norns.lua:145: in function </home/we/norns/lua/core/norns.lua:145>
    [C]: in function 'require'
    /home/we/dust/scripts/tehn/awake.lua:29: in main chunk
    [C]: in function 'dofile'
    /home/we/norns/lua/core/script.lua:190: in function </home/we/norns/lua/core/script.lua:190>
    [C]: in function 'xpcall'
    /home/we/norns/lua/core/norns.lua:146: in field 'try'
    /home/we/norns/lua/core/script.lua:190: in function 'core/script.load'
    (...tail calls...)
# script clear
<ok>

lua: /home/we/norns/lua/core/clock.lua:59: bad argument #1 to 'resume' (thread expected)
stack traceback:
    [C]: in function 'coroutine.resume'
    /home/we/norns/lua/core/clock.lua:59: in function 'core/clock.resume'
winder commented 3 years ago

After further investigation, the first real error seems to be:

_norns._post_startup
# script clear
norns.startup_status.timeout
### SCRIPT ERROR: SUPERCOLLIDER FAIL
azubieta commented 3 years ago

Same issue here!

catfact commented 3 years ago

in the OP, it looks like this is the system's first run of supercollider after installing norns/sc/norns-config.sc to the SC extensions path.

we use this small installed extension as a "trampoline" to tell SC how to bring in all the other norns-related SC code (system and user/engines.)

on the second run you should see more stuff, including a block like

-------------------------------------------------
 Norns startup

 OSC rx port: 57120
 OSC tx port: 8888
 server port: 57110
 crone port: 9999
--------------------------------------------------

and it should boot an scsynth server and make the norns startup sound. (warbly stereo sinewaves.)


that should take care of this particular error. of course there are likely to be other issues...

winder commented 3 years ago

@catfact thanks. Running it twice did change things:

we@6e9b2feae228:~/norns$ sclang
compiling class library...
    Found 738 primitives.
    Compiling directory '/usr/local/share/SuperCollider/SCClassLibrary'
    Compiling directory '/usr/local/share/SuperCollider/Extensions'
    Compiling directory '/home/we/.local/share/SuperCollider/Extensions'
    Compiling directory '/home/we/norns/sc/core'
    Compiling directory '/home/we/norns/sc/engines'
WARNING: Could not open directory: '/home/we/norns/sc/ugens'
    To resolve this, either create the directory or remove it from your compilation paths.

    Compiling directory '/home/we/dust'
ERROR: duplicate Class found: 'AudioTaper' 
/home/we/norns/sc/engines/AudioTaper.sc
/home/we/dust/lib/sc/abstractions/AudioTaper.sc

ERROR: duplicate Class found: 'ReverseAudioTaper' 
/home/we/norns/sc/engines/AudioTaper.sc
/home/we/dust/lib/sc/abstractions/AudioTaper.sc

ERROR: duplicate Class found: 'PatchMatrix' 
/home/we/norns/sc/engines/PatchMatrix.sc
/home/we/dust/lib/sc/abstractions/PatchMatrix.sc

ERROR: duplicate Class found: 'CroneGenEngine' 
/home/we/norns/sc/engines/CroneGenEngine.sc
/home/we/dust/lib/sc/abstractions/CroneGenEngine.sc

ERROR: duplicate Class found: 'CroneSynthDefIntrospectionUtil' 
/home/we/norns/sc/engines/CroneGenEngine.sc
/home/we/dust/lib/sc/abstractions/CroneGenEngine.sc

ERROR: duplicate Class found: 'BufUtil' 
/home/we/norns/sc/engines/BufUtil.sc
/home/we/dust/lib/sc/abstractions/BufUtil.sc

ERROR: There is a discrepancy.
numClassDeps 1560   gNumClasses 3108
sc3> ?
Library has not been compiled successfully.
sc3> 

One thing I noticed is that supercollider is no longer listed by waf configure in the beta branches, do you know if that could be related?

Setting top to                           : /home/we/norns 
Setting out to                           : /home/we/norns/build 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Checking for program 'pkg-config'        : /usr/bin/pkg-config 
Checking for 'alsa'                      : yes 
Checking for 'libudev'                   : yes 
Checking for 'libevdev'                  : yes 
Checking for 'liblo'                     : yes 
Checking for 'cairo'                     : yes 
Checking for 'cairo-ft'                  : yes 
Checking for 'lua53'                     : yes 
Checking for 'nanomsg'                   : yes 
Checking for 'avahi-compat-libdns_sd'    : yes 
Checking for 'sndfile'                   : yes 
Checking for 'jack'                      : yes 
Checking for libmonome                   : yes 
Checking for program 'dpkg-architecture' : /usr/bin/dpkg-architecture 
Checking boost includes                  : 1.67.0 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
Checking for 'ncursesw'                  : yes 
Checking for 'panel'                     : yes 
Checking for 'nanomsg'                   : yes 
'configure' finished successfully (0.296s)

I may try going back to the 2.5.4 branch

catfact commented 3 years ago

remove /home/we/dust/lib, that shouldn't be there. it looks like you cloned the monome/dust repo. this is not recommended anywhere - if it is, that is a mistake: i don't know how @tehn constructs ~/dust in the norns image but i don't think it is that way. (and we should either clean up that repo, retire it, and/or clarify its use.)

i would just create empty folders ~/dust/code and ~/dust/data. (these are intended to be locations administered by the user, where scripts are installed (code) and where scripts and system can write persistent state (data).) if the lua stack complains about missing subdirectories then you can go ahead and create those too.

catfact commented 3 years ago

One thing I noticed is that supercollider is no longer listed by waf configure in the beta branches, do you know if that could be related?

we removed build targets for some custom ugens that are no longer needed and would be better distributed as quarks/packages anyway. therefore we do not need to compile any c/c++ targets against SC sources. no, it's not related to this issue of duplicate classes in the sclang class library.

winder commented 3 years ago

@catfact thanks for the hint. After fixing the dust folder supercollider starts and matron gets further!

tehn commented 3 years ago

i've added a note to the dust repo and archived it, sorry for the confusion

winder commented 3 years ago

This is working now, thanks for all of the help.