Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause audio streaming #30

Closed
PavelKuzub opened this issue Jun 28, 2014 · 14 comments
Closed

Pause audio streaming #30

PavelKuzub opened this issue Jun 28, 2014 · 14 comments

Comments

@PavelKuzub
Copy link

Hello,

As advised by Memphiz from XBMC team - posting my issue here:

When I AirPlay music from iPhone to XBMC and then within XBMC start playing any other source like video/audio - the source of AirPlay continue to send audio to XBMC, but it is not playing it. When I stop playing the video/audio (that has interrupted AirPlay) - XBMC is idling, but AirPlay source is still sending audio. If I stop and start audio at source (iPhone) - nothing happens - silence. iPhone believe it is streaming audio, but XBMC is not following anymore. I have to switch AirPlay target on iPhone from XBMC to local and then back to XBMC in order to restore streaming.

If I compare with streaming to AV receiver - then when I change source on AV receiver - iPhone puts streaming on pause and switch off AV target.

I would appreciate the following behaviors instead:
XBMC send pause back to AirPlay source (iPhone/iTunes) before starting playing another video/audio and then:

  1. when another video/audio is stopped - switch back to AirPlay and send pause/play signal again to restore play
  2. if above not possible - then disconnect the source from XBMC, so that iPhone/iTunes is back to it's internal speakers

As per Memphiz, XBMC use shairplay library for audio streaming and it does not support sending pause or disconnect.
Can pause and disconnect features be implemented in library? Thank you

@juhovh
Copy link
Owner

juhovh commented May 1, 2015

Copying from another issue:

This is a valid feature, but I'm not sure if this should be part of shairplay library itself. What shairplay could do is to pass the DACP-ID to the calling client, but I think the actual DACP part should be in a separate library or script really.

@steve1977
Copy link

Thanks. You also suggested in the other post quote Documentation is at http://nto.github.io/AirPlay.html#audio-remotecontrol I wonder what @Memphiz has to comment on this, does Kodi support DACP in any way? quote

@Memphiz
Copy link
Contributor

Memphiz commented May 2, 2015

kodi has no support for dacp as far as i know. Just for double checking - @Montellese i guess the upnp control stuff is different right?

@juhovh
Copy link
Owner

juhovh commented May 2, 2015

Upnp control is different from dacp, but dacp itself is pretty easy and small thing to do. The reason why it doesn't fit well shairplay library is that it requires doing mDNS discovery in order to get the TCP port correctly for the control, and mDNS is something I'm kind of trying to get rid of in the library.

After all kodi is not even using the mDNS functionality of shairplay lib and if we talk about kodi and dacp it would be much easier to do it on a higher level like python if possible. And my understanding is that dacp can be used for controlling even when airplay is not being used, so it's not that closely tied to it. Airplay protocol just gives an identifier of which dacp device is the same one that is sending data right now.

@Memphiz
Copy link
Contributor

Memphiz commented May 2, 2015

Doing the mdns Discovery inside kodi is not a problem - Integration of the controls should be done like a remote player i guess - so basically similar like upnp Remote renderers are integrated - question is if its worth to have a dacp lib which gets inited with id, ip and tcp port and use it to control the corresponding Player (in our case the AirTunes client)

@steve1977
Copy link

Thanks guys, this is fantastic. Appreciate you looking into this. I just opened another feature request about showing albumart in Kodi when airplaying (http://forum.kodi.tv/showthread.php?tid=225954). Is this related? Thanks again for all your development work!!!

@Memphiz
Copy link
Contributor

Memphiz commented May 3, 2015

@juhovh for a Start i would need a way to get the id and the active-remote Header from libshairplay during Streaming for determining the correct dacp server

@juhovh
Copy link
Owner

juhovh commented May 3, 2015

@Memphiz you are right, I will try to add them to the master soonish (it should be just one additional callback with no API breakage) and let you know when they're in.

@Memphiz
Copy link
Contributor

Memphiz commented May 3, 2015

@juhovh maybe something like

void audio_remote_control_id(const char *identifier, const char *active_remote_header)

Even if the identiier is an 64bit int i would prefer to have it as hex string so i can do a string compare with the bonjour announcement (at least if the DACP-ID header has a hex string in it in the rtsp request...)

@juhovh
Copy link
Owner

juhovh commented May 5, 2015

I merged the pull request #37 so I guess this can be closed, should get things rolling.

@juhovh juhovh closed this as completed May 5, 2015
@Memphiz
Copy link
Contributor

Memphiz commented May 5, 2015

Yes ... will last a while until this will be available in kodi - it needs majore intrusive changes to support controlling the airtunes client from the internal player ... just fyi for the requesters ...

@Memphiz
Copy link
Contributor

Memphiz commented May 6, 2015

teaser: https://youtu.be/cldS8Bq_3jg :)

@juhovh
Copy link
Owner

juhovh commented May 6, 2015

Looks nice!

@steve1977
Copy link

Wow, this looks much nearer to completion than I had ever anticipated. Really cool!!!

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

No branches or pull requests

4 participants