philippe44 / LMS-uPnP

Integrate UPnP players with LogitechMediaServer
108 stars 17 forks source link

Roon unlimited streams and break of playback. #47

Closed DrCWO closed 3 years ago

DrCWO commented 3 years ago

Hi Philippe, I write today cause I like to communicate feedback I got from my rooUPnP Roon Extension with your software under the hood (https:\rooExtend.com).

Major and in my eys the only one common issue: Problems with the potential unlimited audiostreams cause no metadata and stop playback if samplerate changes.

I run your application in full processing mode with Roon delivering Flac or Pcm as I think this is best.

The issues arise because a lot of players can play wav or flac but have problems with unlimites streams. I know that you have no chance to slice the continuous data stream Roon provides, because you don't have metadata. My software is a Roon extension and I have access to metadata! So here my idea I like to discuss with you:

  1. The bridge starts getting Audio Data but does not create UPnP output.
  2. If audiodata arrives the bridge send to stdout a request for metadata (some fancy sting I can grab with a regular expressions).
  3. On reception I deliver metadata in Json Format incl. a Link to coverart that I will send to stdin of the bridge.
  4. Getting this the bridge creates an audiofile header with the correct length of audiodata it calculates from my metadata.
  5. The bridge starts the webserver for delivering this audiodata.
  6. If the requested amount of data was sent you stop sending data and close the stream.
  7. Loop to 1.

This behaviour might be activated with an additional flag in the command line. If the players support net audio URL they hopefully will also play gapless. This would create consistent audiostreams like playing back audio files. I am shure it would work with all players and also create cover artwork on players with a display.

I see two options now.

  1. As you still actively develop your bridge I guess it would be very easy and quick for you, to integrate this behaviour. In this case I will provide a Roon Extension in node.js you can publish with your bridge in your repository for tinkering people.
  2. If you don't like to do it, I will try it by myself. It was quite a while I programmed C but hopefully...

Please let me kow. Best Charly

philippe44 commented 3 years ago

I'm not sure I'm following the comment on sample rate change. The full processing mode is where data is decoded and re-encoded potentially to a different format. Flow is an extension where everything is a single stream and then must be re-encoded at the same rate. But in non-flow mode, tracks are separated and you can chose or not to re-encode them with the same format.

The lack of metadata access will not solve everything because metadata does not give me the size of the file (at least on LMS, might be good enough with Roon if the size is know and no transcoding happens, which I doubt). I don't have metadata because Roon does not offer the LMS Command Line Interface I'm using, but rather want JSON/HTTP that I have not developed. So the proper solution would be JSON over HTTP but I don't have a need for that hence I did not do it.

DrCWO commented 3 years ago

Thank's for the answer. The metadata I can access within my roon extenion has the information of the length. But I understood you are not interested in my proposal? Please let me know if you change your mind. I will start developing the necessary extensions during next week. Maybe I come back to you asking for some help regarding compiling. We will see. Thanks Charly

philippe44 commented 3 years ago

It's not that I'm not interested but I mean if I want to solve the Roon size issue, the better way is for me to implement the other LMS protocol (using JSON/HTTP)

DrCWO commented 3 years ago

That I understand. I read a bit about that JSON LSM protocol and I will check it out, probably next week. Maybe this it also a working solution can be build. My strongest concern at the moment is the unlimited stream length that Roon sends. It has to be sliced in separate pieces. I will see…

DrCWO commented 3 years ago

Hi Phillipe, before doing the metadata I had to make it compile on my Pi but I was not able (see separate issue). To get ahead a bit despite compiling, I like to ask you for a small change. Maybee you can do it and build a modified version I can use.

Here my request: In slimproto.c(114) "sendHelo" is called whenever a new device is discovered. In (118) you set the "base_cap" with the parameter "ModelName" (sq_model_name) that I define at startup voa -M parameter. Is is all the same for every new discovered device.

Would you please add to this ModelName the UDN of the device separated by a space if is "1".

I need this to identify the output devices in my Roon Extension and offer the correct output names in the dialog. This is only a small change for you and would be a big improvement for me.

Thank's a lot Charly

philippe44 commented 3 years ago

I know I'm going to sound like a pain but it's not logical to do that. The ModelName is not supposed to be the player's name or an identification unique per device, it is describing a global name for that family

You can query the player's name to identify it uniquely by sending a SETD slimproto message with an ID of 0

DrCWO commented 3 years ago

Phillipe,

I can’t do it from Roon!

The structure I attached is part of the zones array I can access from within my Roon extension.

The green highlighted name is the Name the User enters in the “Settings-->Extensions-->Audio” menu for the device.

The yellow highlighted name is what I get from the bridge.

What I else have is the UPnP friendly name I got from your XML config.

I nee to assign green to blue to be able to display the green name in the settings dialog of my Extension.

This might be easily done by me if the yellow name will include the UDN.

So PLEASE, may also be enabled by a separate parameter in the command line…

I will continue try to build your code in the meanwile…

Thanks

Charly

{ "zone_id": "160140520552b033db43f6eb498722d9c45e", "display_name": "my UPnP Volumio", "outputs": [ { "output_id": "170140520552b033db43f6eb498722d9c45e", "zone_id": "160140520552b033db43f6eb498722d9c45e", "can_group_with_output_ids": [ "170140520552b033db43f6eb498722d9c45e" ], "display_name": "Volumio", "volume": { "type": "number", "min": 0, "max": 100, "value": 29, "step": 1, "is_muted": false, "hard_limit_min": 0, "hard_limit_max": 100, "soft_limit": 100 }, "source_controls": [ { "control_key": "1", "display_name": "rooUPnP", "supports_standby": true, "status": "indeterminate" } ] } ], "state": "paused", "is_next_allowed": true, "is_previous_allowed": false, "is_pause_allowed": false, "is_play_allowed": true, "is_seek_allowed": true, "queue_items_remaining": 12, "queue_time_remaining": 3080, "settings": { "loop": "disabled", "shuffle": false, "auto_radio": true }, "now_playing": { "seek_position": 0, "length": 243, "one_line": { "line1": "Bye Bye Blackbird - Adam Nussbaum / Marc Johnson / Patricia Barber / Ray Henderson / Mort Dixon" }, "two_line": { "line1": "Bye Bye Blackbird", "line2": "Adam Nussbaum / Marc Johnson / Patricia Barber / Ray Henderson / Mort Dixon" }, "three_line": { "line1": "Bye Bye Blackbird", "line2": "Adam Nussbaum / Marc Johnson / Patricia Barber / Ray Henderson / Mort Dixon", "line3": "Nightclub" }, "image_key": "78d6ce201640f0bc04e77dd70b20a85d", "artist_image_keys": [ "566eaed9fef24e5336b47788da984c56", "0107b973f716d9735a1cfd62aa2927b7" ] } },

Von: philippe44 @.> Gesendet: Samstag, 20. März 2021 20:03 An: philippe44/LMS-to-uPnP @.> Cc: DrCWO @.>; Author @.> Betreff: Re: [philippe44/LMS-to-uPnP] Roon unlimited streams and break of playback. (#47)

I know I'm going to sound like a pain but it's not logical to do that. The ModelName is not supposed to be the player's name or an identification unique per device, it is describing a global name for that family

You can query the player's name to identify it uniquely by sending a SETD slimproto message with an ID of 0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philippe44/LMS-to-uPnP/issues/47#issuecomment-803446283 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APRCIDXBHD7GM2T3LRQGEITTETWNFANCNFSM4ZHDGSEA .

philippe44 commented 3 years ago

I can't see any color highlighting. If you want, send me a PM at my address you can find from the LMS forum or in the plugin extension

DrCWO commented 3 years ago

Now that I could build your application by myself, I made the changes I needed for my application. Thank you for your support and sorry for bothering you quite a bit.

philippe44 commented 3 years ago

No worries - as said, I'm always happy to make change but they have to fit my objectives of "genericity". I understand that yours, in that case, differ hence I'm happy you were able to rebuild the application