Announcement

Collapse
No announcement yet.

LMS 8.1.1 (and above) break radio streaming on SB Radio

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by gordonb3 View Post
    Interesting.

    Since the number of changes were limited I did some tracing and found the offending change:

    Code:
    diff --git a/Slim/Player/Squeezebox.pm b/Slim/Player/Squeezebox.pm
    index e3411fe0e94..786c5a8600e 100644
    --- a/Slim/Player/Squeezebox.pm
    +++ b/Slim/Player/Squeezebox.pm
    @@ -705,12 +705,8 @@ sub stream_s {
     
     # container type and bitstream format: '1' (adif), '2' (adts), '3' (latm within loas), 
     # '4' (rawpkts), '5' (mp4ff), '6' (latm within rawpkts)
    -#
    -# This is a hack that assumes:
    -# (1) If the original content-type of the track is MP4 or SLS then we are streaming an MP4 file (without any transcoding);
    -# (2) All other AAC streams will be adts.
    -
    -$pcmsamplesize   = Slim::Music::Info::contentType($track) =~ /^(?:mp4|sls)$/ ? '5' : '2';
    +
    +$pcmsamplesize   =  $controller->song->wantFormat ne 'aac' ? '5' : '2';
     $pcmsamplerate   = '?';
     $pcmendian       = '?';
     $pcmchannels     = '?';
    Thanks for finding the correct method to fix this.
    This is part of what I had to do to allow players that support aac to play mp4 streams but also to allow LMS to transcode when they don’t. It’s true that LMS does not benefit from mp4 to aac unwrapping when transcoding is disabled. Candidly, when I was writing that I was of the opinion that the notranscoding option should simply be removed
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

    Comment


      #17
      Originally posted by philippe_44 View Post
      This is part of what I had to do to allow players that support aac to play mp4 streams but also to allow LMS to transcode when they don’t. It’s true that LMS does not benefit from mp4 to aac unwrapping when transcoding is disabled. Candidly, when I was writing that I was of the opinion that the notranscoding option should simply be removed
      That would place higher requirements on the server CPU and subsequently either rule out green devices completely or require them to be dedicated for LMS and even then you would likely run into trouble when copying new music files onto them while also listening.

      This said, my armv5te device actually does a pretty good job even with transcoding enabled (though last time I had it configured that way I only had two SB devices). The trouble started when I added some python scripts to my home automation app that also runs on that machine to pull data from a web service and the CPU load from python caused the players to start stuttering and sometimes even become completely silent for several seconds. That is why I require the notranscoding and really the only drawback is that I need to convert media files that come in `weird` formats (like Apple lossless) to native supported formats prior to adding them to LMS (effectively I recode everything to flac16 or if the original format was lossy to mp3).

      Honestly, if I had enough time I would likely make an attempt to rewrite LMS in C++. I know there's lots of people that dislike compiling stuff but at current energy prices the difference between 10 Watts and 100 Watts approaches 500 euros a year. That is money I'd rather spend on a nice diner.

      Comment


        #18
        Originally posted by gordonb3 View Post
        That would place higher requirements on the server CPU and subsequently either rule out green devices completely or require them to be dedicated for LMS and even then you would likely run into trouble when copying new music files onto them while also listening.

        This said, my armv5te device actually does a pretty good job even with transcoding enabled (though last time I had it configured that way I only had two SB devices). The trouble started when I added some python scripts to my home automation app that also runs on that machine to pull data from a web service and the CPU load from python caused the players to start stuttering and sometimes even become completely silent for several seconds. That is why I require the notranscoding and really the only drawback is that I need to convert media files that come in `weird` formats (like Apple lossless) to native supported formats prior to adding them to LMS (effectively I recode everything to flac16 or if the original format was lossy to mp3).

        Honestly, if I had enough time I would likely make an attempt to rewrite LMS in C++. I know there's lots of people that dislike compiling stuff but at current energy prices the difference between 10 Watts and 100 Watts approaches 500 euros a year. That is money I'd rather spend on a nice diner.
        But you can get LMS running with transcoding even on an old PiZero 1st gen with arm1176. Transcoding does not use that much CPU and compilers are really efficient (remember that all transcoders are native compiled application)
        LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

        Comment


          #19
          Originally posted by philippe_44 View Post
          But you can get LMS running with transcoding even on an old PiZero 1st gen with arm1176. Transcoding does not use that much CPU and compilers are really efficient (remember that all transcoders are native compiled application)
          I know, but as said if you stress the CPU with some other process running on the same machine it will get tricky.

          btw, I did in fact spend the time to convert those python scripts that prompted me to change LMS to notranscoding into an ELF binary which reduced its runtime from 40+ seconds to below 1 (using two http calls at minimum). That is the difference between running code that is interpreted versus code that is compiled. I'll bet you that if I were to rewrite LMS and turn it into a binary I can make it show its web GUI within a second after startup as well (currently takes 10-15 seconds for the Apache frontend to stop returning a HTTP-500).

          Comment


            #20
            LMS 8.1.1 (and above) break radiostreaming on SB Radio

            > interpreted versus code that is compiled. I'll bet you that if I were to
            > rewrite LMS and turn it into a binary I can make it show its web GUI
            > within a second after startup as well (currently takes 10-15 seconds for
            > the Apache frontend to stop returning a HTTP-500).


            But you'll never get the months or years back you'll spend trying to
            re-implement LMS :-D. The attempts have been there. Nobody came up with
            anything remotely usable.
            Michael

            "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
            (LMS: Settings/Information)

            Comment


              #21
              LMS 8.1.1 (and above) break radiostreaming on SB Radio

              >> interpreted versus code that is compiled. I'll bet you that if I were to
              >> rewrite LMS and turn it into a binary I can make it show its web GUI
              >> within a second after startup as well (currently takes 10-15 seconds for
              >> the Apache frontend to stop returning a HTTP-500).

              >
              > But you'll never get the months or years back you'll spend trying to
              > re-implement LMS :-D. The attempts have been there. Nobody came up with
              > anything remotely usable.


              Oh, and all the electric power you'll use working day and night. You'll
              never compensate this using an underpowered device to run the code
              instead of a Pi which wouldn't consume any more energy today...
              Michael

              "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
              (LMS: Settings/Information)

              Comment


                #22
                I think as a dev the product of time_to_develop * runtime_ressources * app_complexity is a sort of constant. You just need to figure out what matters for you. I’m able now to create by my own things that would have taken a lifetime when I started my career. But it comes with a price. Language is one of the trade offs. As I did a lot of assembly, then C/C++ and then Perl (and Python to a lesser extend) I feel that difference very well.
                LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

                Comment


                  #23
                  Originally posted by philippe_44 View Post
                  I think as a dev the product of time_to_develop * runtime_ressources * app_complexity is a sort of constant. You just need to figure out what matters for you. I’m able now to create by my own things that would have taken a lifetime when I started my career. But it comes with a price. Language is one of the trade offs. As I did a lot of assembly, then C/C++ and then Perl (and Python to a lesser extend) I feel that difference very well.
                  As a database specialist I can actually state that it is very easy for me to spot whether a client application is based on RADD or old fashioned coding. I appreciate your stance but the reality of course is that most of the code produced today may look cool but in terms of effectiveness doesn't come anywhere near the quality that programmers created 30-40 years ago and in several cases still actively develop on today even though of course they had to go graphic and switch from Basic to VB, from Pascal to Delphi, from C to VC and on to C#. In my experience there are two types of people here: the first are managers that like to have everything as quick and as cheap as possible, the second are the employees that actually need to work with these applications and their frustration is typically at least equally as high as the manager's satisfaction.

                  Comment


                    #24
                    Originally posted by mherger View Post
                    Oh, and all the electric power you'll use working day and night. You'll
                    never compensate this using an underpowered device to run the code
                    instead of a Pi which wouldn't consume any more energy today...
                    A Pi is just as crippled as the device I use even though it may not seem as obvious because on paper the processing power of the armv7 exceeds that of the amv5te. Newer doesn't by definition mean better.

                    Oh and obviously this is just a background server. It doesn't even have any graphic interface that you can connect a screen to. And as stated it runs a lot more than just LMS and does not get corrupted by an SD card turning unwritable so I'll choose this over a Pi any time.

                    Comment


                      #25
                      LMS 8.1.1 (and above) break radiostreaming on SB Radio

                      > Oh and obviously this is just a background server. It doesn't even have
                      > any graphic interface that you can connect a screen to. And as stated it
                      > runs a lot more than just LMS and does not get corrupted by an SD card
                      > turning unwritable so I'll choose this over a Pi any time.


                      Your choice. But you seem to suffer real problems with your choice,
                      asking for help about them, while SD card corruption and "Pi is no
                      better" are purely assumptions. Moving from an ARMv5 based NAS to a Pi3B
                      was like night and day. And that Pi has been running flawlessly on the
                      same SD card since January 2017.
                      Michael

                      "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                      (LMS: Settings/Information)

                      Comment


                        #26
                        Originally posted by mherger View Post
                        Your choice. But you seem to suffer real problems with your choice,
                        asking for help about them, while SD card corruption and "Pi is no
                        better" are purely assumptions. Moving from an ARMv5 based NAS to a Pi3B
                        was like night and day. And that Pi has been running flawlessly on the
                        same SD card since January 2017.
                        I don't see where my choice of platform comes into this bug report. All SB devices are perfectly capable of handling various types of compressed streams as offered through MySqueezebox. From my point of view it is a strange choice with installing a local LMS to disregard that functionality in the player and concentrate all of the processing power associated with decompression onto a single machine that unlike the players needs to be always on. Keeping the CPU load distributed means I can safely run my home automation system on the same machine as LMS while with transcoding centralized I would have to move that to a second machine to avoid a possible struggle over CPU time.

                        PS How long ago was it that you rebooted that Pi? Typical reports about SD card failure state that data turns out to be missing after a reboot. That is because memory cards and USB sticks usually do not report write failures that are caused by a memory location having become fixed and so whatever you think is written on it may in reality only exist in disk cache.

                        Comment


                          #27
                          An additional note:

                          I actually misidentified this bug. It is not related or even restricted to SB Radio. The reason for this false identification is that I did not have the same station selected on all of my SBs.

                          Comment


                            #28
                            LMS 8.1.1 (and above) break radiostreaming on SB Radio

                            > PS How long ago was it that you rebooted that Pi?

                            up 1 day, 21:35
                            Michael

                            "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                            (LMS: Settings/Information)

                            Comment


                              #29
                              LMS 8.1.1 (and above) break radiostreaming on SB Radio

                              Could you please try the latest 8.3.1 nightly build? Philippe kindly
                              provided a patch which would hopefully fix this.
                              Michael

                              "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
                              (LMS: Settings/Information)

                              Comment


                                #30
                                Originally posted by mherger View Post
                                Could you please try the latest 8.3.1 nightly build? Philippe kindly
                                provided a patch which would hopefully fix this.
                                Slightly different from the one that was proposed earlier and that I added to my Gentoo build, but yes this works as well.

                                Verified with 8.2.0 - not ready for 8.3.x yet.

                                Comment

                                Working...
                                X