monome/norns

Long file and directory names confuse audio fileselect

xmacex opened this issue · 2 comments

xmacex commented

It seems that long names of directories or files, those long enough to get the ellipsis "...", too long for screen confuse fileselect on updated norns. Choosing such a file or directory leaves the norns on-screen UI incl. menus unresponsive for a while, but pressing K1 a few times seems to work to get back to an earlier state.

Specimen

  • File "kubish_transformer.wav" exhibits the problem.
  • Same file as "kubish.wav" is fine.
  • Folder "2023-06-08-monheim" is fine.
  • Same folder as "peace-to-ukraine-finally-this-is-taking-too-long" exhibits the problem
  • A long symlink e.g. "all-wars-must-end-we-cannot-go-on-like-this.wav" to a short filename exhibits the problem.
  • A short symlink e.g "peace" to a long directory name is fine.

Maiden when trying to enter a directory with a long name:

lua: /home/we/norns/lua/lib/util.lua:221: bad argument #2 to 'format' (number has no integer representation)
stack traceback:
	[C]: in function 'string.format'
	/home/we/norns/lua/lib/util.lua:221: in function 'util.s_to_hms'
	home/we/dust/code/nice-tapes/lib/tape_inject.lua:114: in function 'fileselect.callback'
	/home/we/norns/lua/lib/fileselect.lua:52: in function 'fileselect.exit'
	/home/we/norns/lua/lib/fileselect.lua:168: in function 'fileselect.key'
	/home/we/norns/lua/core/menu.lua:147: in function </home/we/norns/lua/core/menu.lua:124>

Discussed in CC2 thread.

Please let me know if I can test something etc. I'll try to read the code to see how the filename travels into util.lua:221.

dndrks commented

@xmacex thanks so much for logging the issue and building up a super-useful repro case!
i think i've got this fixed in #1682, but would love your (and anyone watching) stress-testing <3

to merge this PR'd change into your norns, SSH in and execute:

cd norns
git fetch origin pull/1681/head:1681
git checkout 1681
./waf configure
./waf -j2
systemctl restart norns-matron

to switch back:

cd norns
git checkout main
./waf -j2

hopefully we can get this tested with a few of your failure cases! thanks so much!

xmacex commented

The branch is 1682, and with that.

  • ✅ File "free-ukraine-free-everyone-abolish-all-military-action-worldwide-forever-and-start-raising-a-sequence-of-generations-who-do-not-know-what-warfare-is.wav" is fine.
  • ✅ Same file as "is-possible.wav" is fine.
  • ✅ Folder "peace" is fine.
  • ✅ Same folder ar "abolish-all-militaries-and-find-better-ways" is fine.
  • ✅ A long symlink e.g. "purge-militarism-from-your-mind-and-culture.wav" to a short filename is fine.
  • ✅ A short symlink e.g. "slava-ukraini.wav" to a long directory name is fine.

Looks good to me, good job @dndrks.