jensrossbach / node-red-contrib-sony-audio

Node-RED nodes for accessing Sony Audio Control API
MIT License
2 stars 0 forks source link

extInput:Line not working on SRS-ZR5 #18

Closed MarshallAthmos closed 4 years ago

MarshallAthmos commented 4 years ago

Hi Jens,

Thanks for the awesome nodes. I immediately had to start using them when I stumbled upon it! I only encountered one issue so far: When using a controller node to set the active source of my SRS-ZR5 speakers, I can't use the nodes default parameters to switch to AUX-Line In. I did some research and it worked using the following low-level request:

{
    "topic": "avContent/setPlayContent/1.2",
    "payload":
        {"uri": "extInput:line?port=1"}
}

I did not dig very deep in your code, but I suppose in your function (starting line 126)

        function setPlayContent(context, source, port = 0, zone = 0)
        {
            var uri = source;
            if ((source == "extInput:hdmi") && (port > 0))
            {
                uri += "?port=" + port;
            }

you are building an exceptional uri for HDMI including the port. I suppose the problem will be done, if you add another exception for line here, because the port needs to be specified (see here).

I'm pretty bad at JS, so please be gentle if this is a stupid issue to start with. Thanks again for the good work!

edit: I'm running node-red-contrib-sony-audio v1.6 and node-RED 1.0.6 on a Raspberry Pi 2B

Cheers Marcel

jensrossbach commented 4 years ago

Hi Marcel,

thank you for bringing up this issue. I'm happy to hear that you like the Sony Audio nodes. Your pre-analysis seems to be correct, I was not aware that the line input source also requires a port parameter. Unfortunately this is not very well documented in the API documentation.

I will have a deeper look into the code in order to figure out what needs to be changed.

jensrossbach commented 4 years ago

@MarshallAthmos I pushed a change to the bugfix_line branch. Unfortunately I cannot verify the fix as I don't have an SRS-ZR5 and my HT-XT3 soundbar does not support the line-in source at all.

If you like and have time, you can download the code from bugfix line and test on your side before I will publish a new release.

MarshallAthmos commented 4 years ago

Cool! I'll give it a try this weekend.