schollz / musicsaur

Music synchronization from your browser.
https://radio.schollz.com/
MIT License
281 stars 17 forks source link

Raspberry Pi + Tornado having trouble with big files #21

Closed schollz closed 8 years ago

schollz commented 8 years ago
 Browser:  135.4352569580078
Server: 130.27554166666667
Diff: -5159.715291341144
runningDiff: -189361.96406873068
Seeking to: -59.08642240206402

The problem is serving large files from tornado. I didn't realize that file access in Python file access is blocking. So Raspberry Pis are seeking, grabbing the next part of the data and its taking forever because Tornado is feeding them back with high latency, which throws off the sync. I fixed the Tornado problem by just holding the current audio file in memory and feeding that. I also fixed the Raspberry Pi problem by giving the option to pause the file to backtrack (which is easier than seeking on large files).