Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Airplay speaker disconnects after a few seconds. #2

Closed
eddible opened this issue Apr 16, 2014 · 17 comments
Closed

Airplay speaker disconnects after a few seconds. #2

eddible opened this issue Apr 16, 2014 · 17 comments
Labels

Comments

@eddible
Copy link

eddible commented Apr 16, 2014

When attempting to Airplay to to Airsonos, the AirPlay devices are present and selectable on iOS devices, but after a few second of playback (nothing is heard on the Sonos system, you can just see the time of the track ticking along for a few seconds), the music pauses and returns to the default output (e.g. the iPhone speaker.) At this point, you can reselect the Airsonos speaker in the Airplay settings, but the issue repeats as before.

It appears to be random and every now and again the package works successfully.

When it disconnects, there is nothing logged. However, when I tried with just one of my speakers online, I got this error message (but only once and I cannot reproduce the error!):

/usr/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtsp.js:39
methodMapping[m.method](response, m.headers, m.content);
^
TypeError: Property '
SETUP' of object #<Object> is not a function
at null.<anonymous> (/usr/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtsp.js:39:30)
at EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (/usr/lib/node_modules/airsonos/node_modules/nodetunes/node_modules/httplike/index.js:61:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)

The issue persists when node is installed both globally and in the home directory and also if run as root.

System information:
Ubuntu 13.10 (server)
Airsonos version 0.0.4
Sonos Devices: 2x ZP90s

@stephen stephen added the bug label Apr 17, 2014
@willcosgrove
Copy link

I can confirm, I'm having the same issue. I really like the idea of Airsonos, I'd love to help, but I'm not much of a node developer. I can provide any debug info you need though 😄

@stephen
Copy link
Owner

stephen commented Apr 22, 2014

It's unfortunately fairly difficult with the current codebase for me to debug these types of issues without access to the network. Currently, there's not a lot of testing/verbosity in the code so it's hard to tell what's failing in a given scenario. Hopefully, as I continue to refactor hacked-together parts, I can get a better idea of what's wrong.

For some clarity - The problem could be with either the AirPlay side of things (having OS X/iOS talk to the server, which is handled by nodetunes), or with the Sonos side of things (having the server talk mp3stream to the device, which is handled by nicercast and node-sonos).

Would love any help you guys can provide on fixing these issues.

@svrooij
Copy link

svrooij commented Apr 22, 2014

I tested it again, still gives a few errors but works for now.
The error I got was, strange error while flushing cache.

With all the errors I was on a wired connection. Now working with wireless, and it works!! Still got a few errors but no big deal.

This is a great tool!!!

Ps. I just installed the version from git today, so that might also the solution of the problem.

@stephen
Copy link
Owner

stephen commented Apr 22, 2014

Interesting - is the strange error while flushing cache.. the only error shown? Are there still starts/stops with the audio?

strange error while flushing cache.. is emitted by node-lame, though I'm not sure of the cause at the moment.

@svrooij
Copy link

svrooij commented Apr 22, 2014

Yes only error.

@danburke
Copy link

I traced this down to a leading carriage return in the setup RTSP request.
When I patch rtsp.js to remove this I'm able to get the stream to play.
Hope this helps!

"
SETUP rtsp://192.168.1.27/4932615128151379837 RTSP/1.0
Transport: RTP/AVP/UDP;unicast;mode=record;timing_port=52230;x-events;control_port=55038
CSeq: 3
X-Apple-Device-ID: 0x4db5642d294
DACP-ID: <snip>
Active-Remote: <snip>
User-Agent: AirPlay/200.54

"

@stephen
Copy link
Owner

stephen commented Apr 23, 2014

@danburke Do you mind submitting an issue + patch on https://github.com/stephen/nodetunes so I can take a look?

(nodetunes is the library that handles the rtsp functionality)

Thanks for your help!

@danburke
Copy link

Sure !

@stephen
Copy link
Owner

stephen commented Apr 25, 2014

@teejteej, @danburke - do you have consistent repro steps for that SETUP issue? Am trying to track it down, but can't figure out the conditions to make it happen consistently..

@teejteej
Copy link

Not really, it just happens consistently every time as soon as I choose a Sonos as output device. I haven't managed to get things working yet.

@stephen
Copy link
Owner

stephen commented Apr 25, 2014

What device are trying to AirPlay from? How strong is the network connection?

I've seen it happen on my end before, but not immediately after startup.

@teejteej
Copy link

MBA 11", Mid 2012. The connection is perfect, I’m practically sitting next
to the router, as well as the Sonos players.

On Fri, Apr 25, 2014 at 9:03 AM, Stephen Wan notifications@github.comwrote:

What device are trying to AirPlay from? How strong is the network
connection?

I've seen it happen on my end before, but not immediately after startup.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-41364246
.

@stephen
Copy link
Owner

stephen commented Apr 25, 2014

Gotcha. Unfortunately, I'm not able to repro this problem consistently with my setup (MBP, 1 x Play:3), so will have to for some more clarity on how to make this happen..

@RobertBiehl
Copy link

Hi, I can reproduce this error.
It crashes immediatly when trying to play something over the the airplay device on my Macbook Pro.
I have airsonos 0.0.12 running on a raspberry pi with debian wheezy. My Sonos device is a play:1 connected via ethernet.

@stephen
Copy link
Owner

stephen commented May 5, 2014

Hey @RobertBiehl, AirSonos support on RPI is a different issue with lame encoder performance. (see stephen/nicercast#2).

A possible workaround is to compile the shine encoder, and replace the lame bindings with shine, but currently not officially supported.

@RobertBiehl
Copy link

Does this also fix this error?
TypeError: Property '
SETUP' of object # is not a function

Thanks for the info! I'll try to add trim on the command and see if I need to switch to shineenc.

@stephen
Copy link
Owner

stephen commented May 10, 2014

'SETUP' of object #<Object> is not a function bug is solved as of version 0.0.15.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants