How to get a steady stream from my home server

I currently have 2 Raspberry Pi 2s running OSMC both with a CSL 300Mbps dongle fitted. I recently bought a new Asus wireless router with the facility for attaching a USB HDD. Instead of bot Pis having there own USB Drives as a source for media I opted to put all my media on 1 USB HDD and attach it to the router. On both Pis I have added file sources using the smb protocol, however whilst streaming media it frequently freezes.

Using my PC (wired connection to router) I have logged on to the Router services, one of which is a graphical traffic monitor. With all other WiFi devices on the network turned off I streamed/played a .mp3 file on on of the Raspberry Pis. Roughly every 20 seconds the song would pause and the traffic on the network would drop to 0 (upload and download). The song would resume in less than a second where the network traffic would also shoot back up to where it was.

The problem is made worse when i stream bigger files. The period between pauses is a lot longer but then so are the pauses themselves. I played a 2Gb .avi and it would go for 10 to 15 minutes before stopping, and when it froze it was up to 1 minute before it resumed.

Just to make sure I wasn’t getting any interference from other gadgets around the house I switched off everything that could possibly transmit ie cordless phones, baby monitor, etc.

If anybody has encountered a problem like this I would be interested in hearing your solutions. My thought was there must be some way to set the Raspberry Pi to buffer the media so that when the WiFi Dongle(?) stops receiving it will continue playing.

Thanx.

*Just to clarify the Raspberry Pis are the only devices that suffer from this problem on the network, streaming is stable to everything else.

Do you have enabled max_usb_current=1 in config.txt?
Is your power supply powerful enough?
Check throughput with iperf!

If all that doesn’t help you provide debug enabled logs.

I had the same problem with my pi2. For me max_usb_current solved part of the problem…but using NFS instead of SMB solved the rest of my problems when streaming movies.
One thing you could do is install wavemon
sudo apt-get install wavemon

Execute it with: wavemon and F10 to quit. You can see the wifi link quality your pi has with your router. Maybe all you need is to move it a bit or just turn the pi to a different angle.