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

OpenHome services #45

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open

OpenHome services #45

wants to merge 55 commits into from

Conversation

ademenev
Copy link

I consider OpenHome services working now

There are few things I think could be done:

  • cleanup shared_metadata module
  • moderate writes to playlist file
  • most important - sometimes, when changing tracks, there are huge lags before subscribed devices receive notifications. I have tracked this down to UpnpNotify() taking too long too execute, but have not found the reason and solution yet. Possibly this problem has something to do with the fact that control point periodically sends requests to Time service, and on track change many notifications are sent to different services, and action can somehow interfere with notifications

Andrey Demenev added 30 commits October 20, 2013 09:39
this does not create an OpenHome renderer yet, but can be controlled
with an UPnP device and service analyzer, e.g. UPnP Inspector
OpenHome services do not use LastChange for eventing
…e (same for previous)

This has to be revisited when properly implementing shuffle and repeat
Manually merged upstream commit b59259c,
I am at a point where automatic merge would not work
Manually merged upstream commit fd8f9c7
When using LastChange, not all modified variables must be sent in event.
We use sendevents flag to filter out unwanted variables.
See:
    hzeller@47da829
	hzeller@ed0f527
@@ -191,7 +194,7 @@ enum UPNPTransportError {
[TRANSPORT_VAR_ABS_TIME_POS] = "NOT_IMPLEMENTED",
[TRANSPORT_VAR_REL_CTR_POS] = "2147483647",
[TRANSPORT_VAR_ABS_CTR_POS] = "2147483647",
[TRANSPORT_VAR_LAST_CHANGE] = "<Event xmlns=\"urn:schemas-upnp-org:metadata-1-0/AVT/\"/>",
[TRANSPORT_VAR_LAST_CHANGE] = "<Event xmlns=\"" TRANSPORT_EVENT_XML_NS "\"/>",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is better.

@hzeller
Copy link
Owner

hzeller commented Nov 11, 2013

Sorry, that looks like a lot of comments, but I am kinda used to detailed code-reviews in my day job. Mostly things are ok, often I just have suggestions for future changes.

In general: I like it, nice job! I haven't looked too much into detail in the open-home protocol implementation (what actions are implemented, what variables) - I supposed you did that by spec, so I wasn't looking too much in to cross-verifying that. I played around with BubbleUPnP, and that worked :)

I do have some comments regarding the variable notification changes. I like that asynchronous notification scheme with a separate thread, it could help reducing some latency (I have never seen this myself, but this is good nevertheless). There are some problems with the handover between different threads though: it is possible that sometimes a change notification is missed as the notify_collector can be changed by multiple threads in a race condition ... and only one wins. This is potentially benign. But problematic is the access of the variable contents in different threads. Unless I am mistaken, the variables content is read from within the notification thread without a locked mutex that also protects the variable content writing. This certainly can lead to corrupt variable reads.

Can you fix these things ? I think then we're ready to merge this into the main branch.

Thank you,
Henner.

@ademenev
Copy link
Author

I agree that there is a possible race condition. I think the changes related to notify_mutex I propose can solve this

@ademenev
Copy link
Author

@hzeller , I have now made some modifications you proposed - but only those which are trivial. Will take some time this weekend to do the rest

@hzeller
Copy link
Owner

hzeller commented Nov 22, 2013

Can you already submit and push your changes so far, so that I can have a look ?
(I am now on vacation right now, so I might have some time to look at things)

@ademenev
Copy link
Author

I have just finished a couple of changes, will commit soon

Andrey Demenev added 5 commits November 23, 2013 03:45
service-level mutex was only used to protect access to variable
containers, and notifications thread did not protect access to
containers

The mutex was moved to variable container, and is now used in all places
where variable containers are accessed.

Also, the notification code was improved to make sure variable changes
are not missed
that is the right place where variable names belong, and this allows to not
pass complete service descriptor to  variable container constructor
distinguish SENDEVENT_YES from SENDEVENT_LASTCHANGE
@hzeller
Copy link
Owner

hzeller commented Dec 11, 2013

I am back from vacation now. I ended up travelling so much, that my internet access was actually not that great so couldn't do much of a review.
I'll no revisit your pull request ASAP.

@triplem
Copy link

triplem commented Jan 8, 2014

Any progress on this one?

@triplem
Copy link

triplem commented Jan 17, 2014

Currently testing this pull request. Looks like the events if the song changed are not send correctly to the UPnP services (e.g. UPnP-display).

Well, I wander if this works for gmrender in the original version as well anyway....

@christiscarborough
Copy link
Contributor

Shame that this kind of went quiet. You can get OpenHome services with the current code using the bubbleupnp-server wrapper (see http://www.coraline.org/non-fiction/raspi-upnp-renderer for details of how I did it), but a native implementation would probably work better.

@hzeller
Copy link
Owner

hzeller commented Feb 5, 2014

On 5 February 2014 14:54, christiscarborough [email protected]:

Shame that this kind of went quiet. You can get OpenHome services with the
current code using the bubbleupnp-server wrapper (see
http://www.coraline.org/non-fiction/raspi-upnp-renderer for details of
how I did it), but a native implementation would probably work better.

I am very sorry for the delay, things went kind of crazy here and I am busy
each weekend. But I have it very high on my TODO list to finish the
review...

-h

@christiscarborough
Copy link
Contributor

No worries. Glad to see it may still be on the cards.

@whyman
Copy link

whyman commented Sep 12, 2017

Any news?

@sqlfairy
Copy link

sqlfairy commented Oct 6, 2019

This looks perfect for a project I'm working on. Tantalizingly close... Any chance of a merge?

Edit: Nevermind. I see this has been forked already.

@hzeller
Copy link
Owner

hzeller commented Oct 22, 2019

There were a lot of changes needed and the review fizzled out eventually as this was touching so much code that testing without access to a control-point was a gamble.

Anyway, want to pick this up again. To do so, it needs to be tested and compared against the specification. This means

  • It needs to be testable somehow. Is there an open source OpenHome control point or some Android app that this can be tested with ?
  • specifiction needed. Is there a link to the OpenHome specification somewhere ?

@hzeller hzeller mentioned this pull request Oct 22, 2019
@christiscarborough
Copy link
Contributor

christiscarborough commented Oct 22, 2019 via email

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

Successfully merging this pull request may close these issues.

6 participants