fardog / node-chromecast-osx-audio

Stream OS X audio input to a local Chromecast device.
MIT License
90 stars 16 forks source link

Error: dns service error: no such record #11

Closed hugovk closed 4 years ago

hugovk commented 7 years ago

I installed with npm install -g chromecast-osx-audio

When I run chromecast or chromecast -l I get:

$ chromecast -l
Devices available for casting:
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: dns service error: no such record
    at Error (native)
    at MDNSService.on_get_addr_info_done (/usr/local/lib/node_modules/chromecast-osx-audio/node_modules/mdns/lib/resolver_sequence_tasks.js:72:30)
    at SocketWatcher.MDNSService.self.watcher.callback (/usr/local/lib/node_modules/chromecast-osx-audio/node_modules/mdns/lib/mdns_service.js:18:40)

I have two Chromecasts on 2.4 GHz, and I get the same thing when the MacBook Pro is connected to 2.4 GHz or 5GHz.

I also get this https://github.com/andresgottlieb/soundcast/issues/32 when using soundcast, which uses node-chromecast-osx-audio.

Any ideas?

hugovk commented 7 years ago

I've hacked this up to get it working.

First, I edited the file throwing the error: /usr/local/lib/node_modules/chromecast-osx-audio/node_modules/mdns/lib/resolver_sequence_tasks.js:72:30

And changed:

          if (error) {
            adr_getter.stop()
            next(error);
          } else {

to:

          if (false) {
            adr_getter.stop()
            next(error);
          } else {

Then I rebooted after installing soundflower (it'd be great to include the "How about the Chromecast?" section of http://milkandtang.com/blog/2014/09/26/nodejs-mac-osx-audio-and-a-chromecast/ in this README).

Then selected “Soundflower (2ch)” as both input and output (also from the blogpost).

fardog commented 7 years ago

@hugovk interesting; thanks for opening up an issue at the upstream library! while i never encountered this issue myself, I unfortunately don't have a macOS laptop any longer to test this on. i wouldn't be surprised if this is an issue with a newer version of node.js or something; have you tried with an older version to see if the same error occurs?

(also, thanks tons for the README contributions! that definitely needed some filling in)

hugovk commented 7 years ago

I tried with Node v0.12.16 but the same problem occurs, and the same hack works.

brew unlink node
brew install homebrew/versions/node012
npm uninstall -g chromecast-osx-audio
npm install -g chromecast-osx-audio
chromecast -l

Hopefully the upstream issue can help :)