Continuing directly from my previous post, I have received my RockPi 4b in the mail and, using the exact same methods outlined before, have set it up for OTG and iSCSI.
To automate these steps, I created a simple script that initiates the device and starts the mass storage module, and put it into
#!/bin/bash -ex iscsiadm -m discovery -t st -p SERVER-IP iscsiadm -m node --targetname "TARGET-NAME" --portal "SERVER-IP:3260" --login /sbin/modprobe g_mass_storage file=/dev/sdX stall=0
I then added the following rule to
root to have the script run at startup.
@reboot bash -x /root/piscsi.sh >> /root/piscsi.log 2>&1
The RockPi was a little finicky at first, requiring me to load and unload the mass storage module, or plug and unplug the USB cable from my computer. The root cause of this was a poor quality cable, so I ordered a better one in a shorter run.
Once connected via a USB 3.0 cable to my computer,
dmesg spits out the following message indicating that it is connected.
[ 16.301952] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 [ 16.301961] g_mass_storage gadget: userspace failed to provide iSerialNumber [ 16.301968] g_mass_storage gadget: g_mass_storage ready [ 17.420163] g_mass_storage gadget: super-speed config #1: Linux File-Backed Storage
You can also check the following UDC class files to ensure it is recognizing the maximum and current speed as
root@rockpi:~# cat /sys/class/udc/fe800000.dwc3/maximum_speedsuper-speed root@rockpi:~# cat /sys/class/udc/fe800000.dwc3/current_speedsuper-speed
dmesg or the previous command indicates that you have connected with
high-speed then ensure that you are using a USB 3.0 port on the host device, and that the cable you are using it rated for SuperSpeed.
Connecting as Extended Storage
Once I confirmed the device was working, I connected it to my PlayStation 4. The process for doing this is well documented on the Sony website, but I will briefly outline the steps.
Go to Settings -> Devices -> USB Storage Devices
You should see the Mass Storage Gadget. Select and format it for use as extended storage in the subsequent menu.
Once you have done so, a new “Extended Storage” option will appear. You can now start moving or installing games to the extended storage location.
Fortunately, the Blackmagic Disk Speed Test offered more promising results this time around. Previously I was limited by the USB 2.0 connection and capped out well under 40 MB/s.
As you can see, the performance this time around is much faster. The read performance is much better than write, mostly a result of having a read-only SSD cache on my NAS. This is fine for my application because the PlayStation will mostly be reading from disk when performance matters (e.g. starting a game, or loading a level), and writing to disk only when installing games. As a caveat to the extended storage solution on the PlayStation 4, only game data will be stored. All other data including game saves, capture media, etc. will be store on the internal drive. Again, this is fine for my application because these are typically low performance reads and writes.
To test the PlayStation performance, I used a notably slow game to load, Red Dead Redemption 2. First I started with the internal HDD which had times of 2:42, 2:26, and 2:23. Next I moved the game to the piSCSI and reran the test, which had times of 5:08, 1:54, and 1:39.
The first time loading from the NAS is exceptionally slow compared to the subsequent times because the SSD cache on my NAS had not yet been populated. The following tests use the full capabilities of the system, and yielded much better performance than the stock internal HDD in the PlayStation 4 Pro.
I believe one of the reasons the spinning disks in the NAS were so much slower during the initial test was because the game is performing many small random reads on the disk. When checking the Synology resource monitor, the read speeds were around 5 MB/s, indicating that the disks may have been performing a lot of seeks.
At the time of writing this, I have been using my piSCSI on my PlayStation 4 for a couple of weeks. It has been very reliable, only requiring intervention when power was lost. The load times for my most played games is noticeably quicker, but there is an initial cost. I have also increased the LUN to 2TB, giving me a combined 3TB for my console.