Announcement

Collapse
No announcement yet.

Might SSD drives remove a bottleneck?

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

    Might SSD drives remove a bottleneck?

    Sorry, this is rather off topic. I am running LMS on a Raspberry pi 3B+ as a server and it works absolutely perfectly with my relatively modest collection of around 2000 albums, allowing the two household members to listen to their own choice of music simultaneously using seperate pads as controllers. However, I also use the same equipment to stream and view from a collection of around 1000 movies ripped to mp4 from DVDs and although this works perfectly for single users, we get quite a lot of annoying buffering when we are both watching movies. I am currently messing around trying to determine whether the bottleneck is associated with the server, the wifi, disk access or the pads. The mp4 files are currently stored on a 2TB Western Digital 'elements' USB drive connected to the pi. It has occured to me to wonder, without any logic or evidence, whether using a solid state drive might remove a bottleneck. A brief look through Amazon leaves me somewhat bemused by the big differences in price between the various SSD usb drives available. I am not looking for definitive advice as I realize there are too many variables involved. I don't mind taking the risk of buying an SSD to no great advantage though would prefer not to spend £hundreds. Any thoughts from those using SSDs would be welcome though.
    Thanks, Jerry

    #2
    On a 3b+ you are not going to benefit much from switching from spinning HD to SSD. as they do not have a USB 3 port to take advantage of the speed difference between the devices.

    Comment


      #3
      I used to a usb HD with LMS, and consistently had problems when playing long tracks. I think what happened was that LMS would read the entire file into a buffer, after which it had no need to access the drive again, until it was time to start reading the next track. By that time, the drive had spun down, and there was a delay while it spun up again. Switching to a SSD solved these issues.

      I have no idea if this might apply to your video problems, but that was my experience.
      Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players (Squeezelite and Airplay bridge). Occasionally using SB Radio, Boom or Classic.

      Comment


        #4
        My files reside on a NAS with 4 HD disks in Raid 5 and I do not experience any issue with audio - even long files. LMS connects via NFS.
        The same NAS holds my ripped DVDs but I use a different device for my Plex server. If there is any kind of transcoding going on then I think a Pi any version would struggle with multiple streams.
        So no I don’t think SSD would make any significant difference.
        Jim



        VB2.4 storage QNAP TS419p (NFS)
        Living Room Joggler & Pi4/Khadas -> Onkyo TXNR686 -> Celestion F20s
        Office Joggler & Pi3 -> Denon RCD N8 -> Celestion F10s
        Dining Room SB Radio
        Bedroom (Bedside) Pi Zero+DAC ->ToppingTP21 ->AKG Headphones
        Bedroom (TV) & Bathroom SB Touch ->Denon AVR ->Mordaunt Short M10s + Kef ceiling speakers
        Guest Room Joggler > Topping Amp -> Wharfedale Modus Cubes

        Comment


          #5
          I wrote out a long response and realized I was going down a rabbit hole with many branch tunnels. So I decided to take a step back.

          It seems like your problem is either data or processor bandwidth. Can you provide a little more detail on what processor/software is acting as your video server? You mention "the same equipment" so I am wondering, is the same pi3b+ involved? Is LMS somehow involved (I thought that was removed from LMS a couple years ago). Are you using DLNS/UPNP?

          I doubt your pads are at fault. I also would not suspect the drive. But, as a simple test, you could burn a thumb drive with a couple mp4's and try two person streaming from that.

          Jim

          <edit - I had another thought - If you ripped your mp4's, try ripping a couple at a lower bitrate. I looked it up and 1080p might be ripped at 4,000-8000 kbps, where 720p at 1,200 - 4,000. I imagine vga (480x320) would be even lower. Then see how 2 videos stream simo. >
          Last edited by Redrum; 2023-02-01, 18:41. Reason: added thought on lower bitrates

          Comment


            #6
            Originally posted by RobbH View Post
            I used to a usb HD with LMS, and consistently had problems when playing long tracks. I think what happened was that LMS would read the entire file into a buffer, after which it had no need to access the drive again, until it was time to start reading the next track. By that time, the drive had spun down, and there was a delay while it spun up again. Switching to a SSD solved these issues.

            I have no idea if this might apply to your video problems, but that was my experience.
            I don't think LMS reads the entire file, unless of course the file format you use is not streamable. The main issue with USB portable drives however is that these by default are 'green' drives, aimed to power down when not in use which the internal detection mechanism may decide on as quick as ~8 seconds and that may very well be within what LMS buffers and the result of that is that it decreases the life span of the drive by literally years. That is why I was never a real fan of using a Pi for something like LMS.

            Comment


              #7
              Originally posted by gordonb3 View Post

              I don't think LMS reads the entire file....
              You are probably right about that. Do you know how far ahead it does read, if it does?
              Usually running latest beta LMS nightly on Raspberry Pi OS with virtual players (Squeezelite and Airplay bridge). Occasionally using SB Radio, Boom or Classic.

              Comment


                #8
                Originally posted by RobbH View Post

                You are probably right about that. Do you know how far ahead it does read, if it does?
                Can't say. It will be reading some number of disk sectors, ideally some power of 2 and either equal or larger than the disk block size. The amount of seconds that translates to will depend on the compression factor and can vary between successive reads. The main point here is that you really should use a NAS type drive that will not enter park between those reads and that is typically not the case with prefab portable drives. Unless of course you pay a multiple of the price for a regular USB drive to get a SSD because that doesn't have park.

                Comment


                  #9
                  Originally posted by RobbH View Post

                  You are probably right about that. Do you know how far ahead it does read, if it does?
                  I think it depends on the player and the bitrate.

                  Using the "Music Information Screen" plugin I set my SB3 to show the buffer fullness %. (top left in the shaky video below)

                  This is usually at 100% and counts down until it gets to 10 seconds from the end of the track when it shows 0%, then starts buffering the next track and reaches 100% again.

                  However if I synchronise the SB3 with my DAC32, the buffer never gets above 26% for an mp3, or 18% for a FLAC.

                  Server - LMS 8.4.0 RPi4B 4GB/NanoSound ONE case/pCP 8.1.0 - 75K library, playlists & LMS cache on Sata SSD (ntfs)

                  Lounge - DAC32 - AudioEngine B2
                  Office - RPi 3B+/HiFiBerry DAC HAT/RPi screen - Edifier D12
                  Bedroom - Echo Show 8

                  Spares - 1xSB Touch, 1xSB3, 4xRPi, AVI DM5 speakers

                  Comment


                    #10
                    Originally posted by gordonb3 View Post

                    Can't say. It will be reading some number of disk sectors, ideally some power of 2 and either equal or larger than the disk block size. The amount of seconds that translates to will depend on the compression factor and can vary between successive reads. The main point here is that you really should use a NAS type drive that will not enter park between those reads and that is typically not the case with prefab portable drives. Unless of course you pay a multiple of the price for a regular USB drive to get a SSD because that doesn't have park.
                    My WD 3.5 inch external drive sleeps after a time determined by hd-idle on a Pi. I chose 5 minutes but it wouldn't sleep at all without hd-idle. Another 2.5 inch portable WD drive seems to sleep after around 40 seconds on Windows.
                    Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
                    Bedroom: Radio
                    Bathroom: Radio

                    Comment


                      #11
                      Many thanks to responders for taking the time to answer. To be clear, the same raspberry that serves my music via LMS is serving my video but through PHP/HTML via the html video tag. No transcoding is involved I think as all my files are mp4. I really need to spend more time on this so as I can reproduce the issue consistently for testing purposes. So far it seems that the problem arises when two of us are watching the same movie on seperate pads. Thanks [email protected] for the suggestions. Yes, ripping the dvd at a lower quality does seem to fix the problem and testing from a thumb drive sounds like a good idea if I can manage to get it mounted somewhere the html can pick it up! (my linux skills are basic). I don't want to waste anyone's time with this further, I'll report back on any conclusions for the sake of completeness.

                      Thanks again
                      Jerry​

                      Comment


                        #12
                        my view is you will see an improvement due to 2 things

                        1. Spin up speed, there is none so access starts instantaneously
                        2. Disk heads. There aren't any. On a conventional disk if your accessing 2 separate things simultaneously the heads are constantly moving around between the 2 files. This may be a slow enough process to cause stream breakup.

                        Its not definitive as you may have a bottleneck elsewhere, but I run SSD for my music and it helps
                        PiCorePlayer 8.2 on Allo Digi One Signature (Lounge)
                        PiCorePlayer 8.2 with Hifiberry Digi+ Material running on PI for control (Office)
                        PiCorePlayer 8.2 with pi official touchscreen and Hifiberry DAC+(Kitchen)
                        Radio (Bedroom)
                        PiCorePlayer 8.2 with Allo BOSS DAC (Bedroom)
                        PiCorePlayer 8.2 with Hifiberry AMP+. Squeezelite=x for control (Garage)
                        PiCorePlayer 8.2 with Hifiberry AMP+(Patio 2)
                        PiCorePlayer 8.2 with Hifiberry AMP+(Patio 2)

                        LMS 8.3 on unRaid 6.11.5 Server (Seneca HDS)

                        Comment


                          #13
                          Originally posted by JerryS View Post
                          A brief look through Amazon leaves me somewhat bemused by the big differences in price between the various SSD usb drives available.
                          Beware unusually cheap terabyte USB SSD drives - often they are a scam and fake.

                          Comment


                            #14
                            Originally posted by JerryS View Post
                            Many thanks to responders for taking the time to answer. To be clear, the same raspberry that serves my music via LMS is serving my video but through PHP/HTML via the html video tag. No transcoding is involved I think as all my files are mp4. I really need to spend more time on this so as I can reproduce the issue consistently for testing purposes. So far it seems that the problem arises when two of us are watching the same movie on seperate pads. Thanks [email protected] for the suggestions. Yes, ripping the dvd at a lower quality does seem to fix the problem and testing from a thumb drive sounds like a good idea if I can manage to get it mounted somewhere the html can pick it up! (my linux skills are basic). I don't want to waste anyone's time with this further, I'll report back on any conclusions for the sake of completeness.

                            Thanks again
                            Jerry​
                            I don't think you have a storage format issue. I think you have a server and bus bandwidth issue. And I would not rule out a networking issue.

                            The bitstream on even HD audio is fairly inconsequential nowadays. Well under 5mbps.

                            Unless you are moving multiple 4 or 8K video streams, any modern SATA HDD should have no problem simultaneously streaming several HD mp4 and audio files. That is a pedestrian storage demand.

                            As others have mentioned, the older USB standard on the older Pi is probably the primary bottleneck. An SSD is not going to solve that.

                            Putting your media storage directly on the network might help delivery times, especially with video streams. Even with a faster USB bus, the data stream still has to navigate through the network interface on the Pi.

                            As you are serving wireless clients, you might also want to take a deeper look at your wireless networking. Many times, that is the real world bottleneck in these situations. If your Pi is also connected wirelessly and not via ethernet, then your bottleneck and latency issues are only going to be compounded.

                            Comment

                            Working...
                            X