PeteManchester / MediaPlayer

61 stars 20 forks source link

Wrong InputSource selected while playing AvTransport streams #80

Closed ik666 closed 3 years ago

ik666 commented 3 years ago

Hi there,

I've one issue with selected input sources from a control point of view.

in app.properties the AVTransport is enabled : mediaplayer_enable_avTransport=true.

The Control Point is calling OpenHome.ProductService.sourceXml receiving available input sources: Playlist, Airplay, UpnpAV, Receiver, Radio so far ok.

First strange thing is, that the visibility attribute of UpnpAV is set to false. Not nice, but the service is still online und running.

Playing a RadioStation will event a new sourceIndex value of 4 -> Radio. This is ok. Playing a Playlist will event a new sourceIndex value of 0 -> Playlist. This is ok.

Now I switch to a player which is able to play music to UPnP devices like foobar 2000 or Audirvana: I believe they eventually call AvTransport.play(). This will however event a new sourceIndex value of 4 -> Radio. I think the expected sourceIndex should be 2 -> UpnpAV.

The Stacktrace indicates, that this call is originated from classes within ohnet-generated.jar class DvProviderAvOpenhomeOrgRadio1

foto

That's probably the reason, why the sourceIndex is set to Radio.

I haven't digged to much in the source, but shouldn't the call be initiated from DvProviderAvOpenhomeOrgTransport1 and the

PlayManager should call something like PluginGateWay.getInstance().setSourceByname("AVTransport");

For this to work, one small change is needed: The PrvProduct sources of type Receiver and of type UpnpAv are both named Mediaplayer. I'd suggest to rename the type UpnpAvto AVTransport according to the above example.

I'd do the changes by myself, and provide a pull request, but I don't know how the ohnet-generated.jar package is being generated and how to glue the first call ...

maybe you could fix this, or provide some developer docs for me?

Cheers

IK

PeteManchester commented 3 years ago

Hi,

I've made some changes to the code, can you try the beta version located here:

https://github.com/PeteManchester/MediaPlayer/tree/master/com.upnp.mediaplayer/download/beta

One thing to note, if you are using the InputSources.xml to define the AvTransport the format is now:

    <Source>
    <name>Default</name>
    <type>UpnpAv</type>
    <visible>true</visible>
</Source>

The name tag is ignored, instead the name of the MediaPlayer is used for the name of the AVTransport.

Cheers,

Pete.

ik666 commented 3 years ago

Hi Pete,

your fix is working. Thank you very much!

IK