Richienb / audic

Play some audio.
MIT License
68 stars 9 forks source link

Weird connection error on linux executation... #7

Closed insign closed 3 years ago

insign commented 3 years ago

Now I'm on Linux, ArchLinux, Gnome. I tried reinstall audic, but clearly it doesnt compile vlc, as did in Windows, not sure if is related to the problem... Maybe in Linux it doesn't need compile vlc, which is already installed here...

                    /-
                   ooo:
                  yoooo/
                 yooooooo
                yooooooooo
               yooooooooooo                 helio@xps 
             .yooooooooooooo                --------- 
            .oooooooooooooooo               OS: ArcoLinux 
           .oooooooarcoooooooo              Kernel: 5.9.8-arch1-1 
          .ooooooooo-oooooooooo             Uptime: 1 hour, 49 mins 
         .ooooooooo-  oooooooooo            Packages: 1421 (pacman) 
        :ooooooooo.    :ooooooooo           Shell: zsh 5.8 
       :ooooooooo.      :ooooooooo          Resolution: 1920x1080, 1920x1080, 1920x1080 
      :oooarcooo         .oooarcooo         DE: GNOME 3.38.1 
     :ooooooooy           .ooooooooo        WM: Mutter 
    :ooooooooo   /ooooooooooooooooooo       WM Theme: Arc-Dark 
   :ooooooooo      .-ooooooooooooooooo.     Theme: Arc-Dark [GTK2/3] 
  ooooooooo-             -ooooooooooooo.    Icons: Papirus [GTK2/3] 
 ooooooooo-                 .-oooooooooo.   Terminal: guake 
ooooooooo.                     -ooooooooo   CPU: Intel i7-8550U (8) @ 4.000GHz 
                                            GPU: Intel UHD Graphics 620 
                                            Memory: 6420MiB / 7653MiB (83%) 

ready.js file

const Audic = require("audic")
new Audic("./ready.wav").play()
// setTimeout(() => process.exit(), 2000)

yarn v1.22.10

$ node ready.js
node:internal/process/promises:218
          triggerUncaughtException(err, true /* fromPromise */);
          ^

RequestError: connect ECONNREFUSED 192.168.100.18:34405
    at ClientRequest.<anonymous> (/home/helio/MEGA/WORK/simpleads/easycontent/frontend/node_modules/got/dist/source/core/index.js:953:111)
    at Object.onceWrapper (node:events:436:26)
    at ClientRequest.emit (node:events:341:22)
    at ClientRequest.origin.emit (/home/helio/MEGA/WORK/simpleads/easycontent/frontend/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
    at Socket.socketErrorListener (node:_http_client:478:9)
    at Socket.emit (node:events:329:20)
    at emitErrorNT (node:internal/streams/destroy:188:8)
    at emitErrorCloseNT (node:internal/streams/destroy:153:3)
    at processTicksAndRejections (node:internal/process/task_queues:80:21)
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1128:16) {
  code: 'ECONNREFUSED',
  timings: {
    start: 1605551281085,
    socket: 1605551281085,
    lookup: undefined,
    connect: undefined,
    secureConnect: undefined,
    upload: undefined,
    response: undefined,
    end: undefined,
    error: 1605551281086,
    abort: undefined,
    phases: {
      wait: 0,
      dns: undefined,
      tcp: undefined,
      tls: undefined,
      request: undefined,
      firstByte: undefined,
      download: undefined,
      total: 1
    }
  }
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Richienb commented 3 years ago

@insign Can you run which vlc?

insign commented 3 years ago
 which vlc
/usr/bin/vlc
Richienb commented 3 years ago

While I was testing it myself, I also noticed that vlc would sometimes stall. Does this happen all the time or only occasionally? Perhaps we can fix this by waiting much longer for web requests to respond.

insign commented 3 years ago

Always, but I don't get why need a web request if my file is local. Or it is to install vlc?

Richienb commented 3 years ago

To use vlc, we launch the executable with command arguments that make it launch local server that we connect to in order to provide it files to play via VLC API.

insign commented 3 years ago

Understood. Have you any clue how to fix?

Richienb commented 3 years ago

@insign After creating a new Audic instance check if a vlc process ever appears in the process list.

insign commented 3 years ago

No, it doesn't .

Richienb commented 3 years ago

It must be having some sort of trouble hosting the web server. Try running vlc --extraintf http --intf wx --http-host <YOUR INTERNAL IP ADDRESS> --http-port <AN UNUSED PORT> --http-password <ANY PASSWORD>. If it works, try navigating to the address and port you specified in the command and use the password when prompted.

If the site loads, install the internal-ip npm package and see if the promise returned by internalIp.v4() resolves with a value that is not null. If it resolves with null, we can pass this issue to that package.

If the site doesn't load or the command fails, be sure to provide the command output.

Richienb commented 3 years ago

Fixed in https://github.com/Richienb/vlc/pull/1