open-dynaMIX / simple-mpv-webui

A web based user interface with controls for the mpv mediaplayer.
Other
137 stars 16 forks source link

Lua error: error loading module 'socket.core' #452

Closed thosoo closed 1 year ago

thosoo commented 1 year ago

Hi,

I am trying to run this on an old android phone inside a termux environment to use it as a wireless music station. Unfortunately I am gettings the following error:

~/KH-Disc 1 $ mpv .
[simple_mpv_webui]
[simple_mpv_webui] stack traceback:
[simple_mpv_webui]      [C]: in ?
[simple_mpv_webui]      [C]: in function 'require'
[simple_mpv_webui]      /data/data/com.termux/files/usr/share/lua/5.2/socket.lua:12: in main chunk
[simple_mpv_webui]      [C]: in function 'require'
[simple_mpv_webui]      ...files/home/.config/mpv/scripts/simple-mpv-webui/main.lua:4: in main chunk
[simple_mpv_webui]      [C]: in ?
[simple_mpv_webui]      [C]: in ?
[simple_mpv_webui] Lua error: error loading module 'socket.core' from file '/data/data/com.termux/files/usr/lib/lua/5.2/socket/core.so':
[simple_mpv_webui]      dlopen failed: cannot locate symbol "lua_createtable" referenced by "/data/data/com.termux/files/usr/lib/lua/5.2/socket/core.so"...
[file] This is a directory - adding to playlist.

lua -v gives me

~/KH-Disc 1 $ lua -v
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio

Additionally, luasocket I have installed using luarocks the following way:

~/KH-Disc 1 $ luarocks --lua-version 5.2 install luasocket
Warning: falling back to wget - install luasec to get native HTTPS support
Installing https://luarocks.org/luasocket-3.1.0-1.src.rock

luasocket 3.1.0-1 depends on lua >= 5.1 (5.2-1 provided by VM)
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/mime.c -o src/mime.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/compat.c -o src/compat.o -DLUASOCKET_DEBUG
gcc  -shared -o mime/core.so src/mime.o src/compat.o
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/buffer.c -o src/buffer.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/compat.c -o src/compat.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/auxiliar.c -o src/auxiliar.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/options.c -o src/options.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/timeout.c -o src/timeout.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/io.c -o src/io.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/usocket.c -o src/usocket.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/serial.c -o src/serial.o -DLUASOCKET_DEBUG
gcc  -shared -o socket/serial.so src/buffer.o src/compat.o src/auxiliar.o src/options.o src/timeout.o src/io.o src/usocket.o src/serial.o
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/buffer.c -o src/buffer.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/compat.c -o src/compat.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/auxiliar.c -o src/auxiliar.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/options.c -o src/options.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/timeout.c -o src/timeout.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/io.c -o src/io.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/usocket.c -o src/usocket.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/unix.c -o src/unix.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/unixdgram.c -o src/unixdgram.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/unixstream.c -o src/unixstream.o -DLUASOCKET_DEBUG
gcc  -shared -o socket/unix.so src/buffer.o src/compat.o src/auxiliar.o src/options.o src/timeout.o src/io.o src/usocket.o src/unix.o src/unixdgram.o src/unixstream.o
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/luasocket.c -o src/luasocket.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/timeout.c -o src/timeout.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/buffer.c -o src/buffer.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/io.c -o src/io.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/auxiliar.c -o src/auxiliar.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/options.c -o src/options.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/inet.c -o src/inet.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/except.c -o src/except.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/select.c -o src/select.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/tcp.c -o src/tcp.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/udp.c -o src/udp.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/compat.c -o src/compat.o -DLUASOCKET_DEBUG
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.2 -c src/usocket.c -o src/usocket.o -DLUASOCKET_DEBUG
gcc  -shared -o socket/core.so src/luasocket.o src/timeout.o src/buffer.o src/io.o src/auxiliar.o src/options.o src/inet.o src/except.o src/select.o src/tcp.o src/udp.o src/compat.o src/usocket.o
luasocket 3.1.0-1 is now installed in /data/data/com.termux/files/usr (license: MIT)

Checking stability of dependencies in the absence of
luasocket 3.0rc1-2...

Removing luasocket 3.0rc1-2...
Removal successful.

Any advice how I could get this script running properly? Thanks

k2helix commented 1 year ago

I'm getting the same error. Did you manage to solve it?

thosoo commented 1 year ago

I'm getting the same error. Did you manage to solve it?

No, unfortunately not.

open-dynaMIX commented 1 year ago

I do not use mpv on android personally. I've tried to get it to work within termux, but ran into the same problems, as described in this issue.

This is an issue with termux + mpv + lua + lua packages in general and not directly related to simple-mpv-webui. So you might have more success getting support from the guys at mpv or termux.

As there is nothing I can do here, I'm gonna close this issue. If you feel that this is in fact related to simple-mpv-webui (i.e. other lua scripts are working with additional lua dependencies), feel free to reopen.

Edit: The problem is not with termux + mpv + lua in gerneral, but only with additional lua packages.

thosoo commented 1 year ago

I have opened a discussion at https://github.com/termux/termux-packages/discussions/15676

open-dynaMIX commented 1 year ago

@thosoo great! Please see my updated comment above. The problem doesn't stem from mpv + lua alone, but only if the script depends on additional lua packages.