monome / norns

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

duplicate node IDs on pi #92

Closed catfact closed 6 years ago

catfact commented 6 years ago

currently stuck getting this old annoyance when creating a SoftCutVoice on the pi: FAILURE /s_new duplicate node ID

(SoftCutVoice is a light wrapper around a couple audio busses and a single Synth wrapping the SoftCutHead custom ugen.)

this is one of those errors in SC that doesn't mean what it sounds like it means. we're not explicitly using node IDs, we're using client-side node management style. so this error message means something is more subtly broken - the server's node allocator getting reset somehow/somewhere, and/or the client somehow trying to talk to the wrong server, and/or a race condition in the server code (sadly plausible)

it is odd because 1) setting up all the boilerplate synths in AudioContext works fine 2) everything works fine on other systems

should maybe try pulling changes and rebuilding SC, though i haven't seen anything in a quick browser of supercollider github issues that would be obviously related.

in past we were doing weirder things with a remote Server in Crone (to explicitly manage sclang and scsynth processes independently.) but now it should be pretty by-the-book with Server.local

i'm also trying to imagine how the custom ugen's init procedures could be fouling up the server's node allocator. can't.

any thoughts appreciated

tehn commented 6 years ago

these troubles went away for me when i pulled the newest and rebuilt SC. it was pretty quick, again back to this old page: https://supercollider.github.io/development/building-raspberrypi.html

of course there might be something slightly different going on now with the ugen, but i hope this just fixes it all for you

edit: just to say, if you haven't updated SC since i sent you the hardware, it's going to be an old version on there.

catfact commented 6 years ago

thanks, will give it a go

tehn commented 6 years ago

oh, i recall now: i was getting the node issues with the PolyPerc engine for the first 6 or so notes and then they would go away. this error vanished when i rebuilt SC.

catfact commented 6 years ago

dang yo Your branch is behind 'origin/develop' by 21698 commits, and can be fast-forwarded.

catfact commented 6 years ago

@tehn do you happen to recall if you've been using develop branch, 3.9 branch, or something else?

tehn commented 6 years ago
pi@nnnn:~/supercollider$ git status
On branch 3.9
Your branch is up-to-date with 'origin/3.9'.
catfact commented 6 years ago

i'm currently rebuilding SC, and adding norns branch to my SC fork (based on 3.9) for the small patches and defines needed.

should SC submodule be added to norns-image and/or norns?

(norns also needs SC headers now to build ugens (or need to add those directly to SC fork)

catfact commented 6 years ago

@tehn i rebuilt and reinstalled supercollider. rebooted and suddenly the soundcard isn't found. (these things are not necessarily related - i didn't touch jack / alsa / kernel, just SC - but it's suspicious.)

i tried running norns-image/overlays/overlays.sh got a bunch of warnings : /boot/dt-blob.bin: Warning (unit_address_vs_reg): Node [blahblah] has a unit name, but no reg property same with sudo reboots no luck what else?

tehn commented 6 years ago

sc seems like it should go in norns rather than norns-image? since it could be integrated into an installer?

re: no sound. is the card being initialized? check dmesg

tehn commented 6 years ago

overlays.sh recompiles a bunch of dt overlays which is not going to be the problem.

your /boot/config.txt hasn't changed, so the overlays should be loading.

can you see the soundcard with alsamixer or speaker-test?

i can upload a working complete disk image tonight

catfact commented 6 years ago

no, soundcard isn't seen by alsa

pi@nnnn:~ $ aplay -l
aplay: device_list:270: no soundcards found..

right sorry, i'm now looking more properly in norns-image/image.txt ... i guess i can go through more of these steps

what am i looking for in dmesg exactly? i don't see anything like monome or snd

tehn commented 6 years ago

image.txt is a maze, i'd hold off until i get you a new image that works and is updated. i suspect yours is way out of date.

here's the relevant success in dmesg:

[    7.210918] cs4270 1-0048: found device at i2c address 48
[    7.210936] cs4270 1-0048: hardware revision 3
[    7.226230] snd-rpi-monome soc:sound: cs4270-hifi <-> 3f203000.i2s mapping ok

check for errors around here?

this is loaded by /boot/config.txt with the line

dtoverlay=monome

edit: i'd rather spare you the dumb image debugging. i'm going to pull down my current image and upload it. will be available tomorrow morning.

catfact commented 6 years ago

hm, no there's nothing like that:

pi@nnnn:~ $ sudo dmesg
...
[   3.705447] i2c /dev entries driver
[    4.105145] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.229094] systemd-journald[127]: Received request to flush runtime journal from PID 1
[    4.538695] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    5.139966] usbcore: registered new interface driver rtl8192cu
[    6.276711] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SSFS
[    6.543693] random: crng init done
[    7.023086] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    8.776967] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
pi@nnnn:~ $ sudo dmesg | grep monome
pi@nnnn:~ $ sudo dmesg | grep rpi
pi@nnnn:~ $ sudo dmesg | grep snd
pi@nnnn:~ $ sudo dmesg | grep i2s
pi@nnnn:~ $ 

there are a couple warnings... Fast Interrupt Request could be audio-related yeah?

[    0.762699] WARN::dwc_otg_hcd_init:1032: FIQ DMA bounce buffers: virt = 0xbad04000 dma = 0xfad04000 len=9024
[    0.779228] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x8058f5b0
[    0.781525] WARN::hcd_init_fiq:460: FIQ ASM at 0x8058f920 length 36
[    0.783845] WARN::hcd_init_fiq:486: MPHI regs_base at 0xbb87a000

monome-snd overlay is enabled...

pi@nnnn:~ $ sudo cat /boot/config.txt | grep monome
# Enable monome-snd (loads snd_soc_monome)
dtoverlay=monome
pi@nnnn:~ $ 

... and present (i think?)

pi@nnnn:~ $ ls /boot/overlays/ | grep monome
monome.dtbo
pi@nnnn:~ $ 

ok, i guess i'll hold off on any more of this for the moment... its odd though, seemed basically fine last night, and i don't think i've touched anything outside /usr/local... will check alsa config stuff

catfact commented 6 years ago

@tehn you know what, this is totally my fault, i think i wiped out the kernel with an apt-get upgrade without realizing it... arg

i will try to roll back

but yeah just a stable kernel image would be a good thing to have i'll try grabbing the one from here https://github.com/tehn/norns-image/releases/tag/v0.1

catfact commented 6 years ago

ok i got it back by reinstalling the 171221 kernel and then adding the new overlays

sorry for the noise

catfact commented 6 years ago

ok, everything works now.. including the new ugens!

added PR #94 to have a correct version of supercollider on hand