b-fitzpatrick / cpiped

Captures an audio stream and outputs to a pipe with buffering and silence detection
GNU General Public License v3.0
71 stars 13 forks source link

Minor Skips when sending through forked-daapd #1

Closed rccoe closed 7 years ago

rccoe commented 7 years ago

Thanks for this, found this in a raspberrypi forum, and successfully set it up with forked-daapd. However, the music tends to skip every 10 seconds or so, did you encounter this? And how did you fix it?

Also, I am unable to set the buffer above 0.5, only below down to about .095 works

b-fitzpatrick commented 7 years ago

This program exists to allow for timing mismatches between an inexpensive analog-to-digital converter (USB sound card) and the PC. Depending on which is faster, the contents of the buffer will either grow or shrink, and when the buffer runs out, the sound will skip. If it's full, it will discard samples, and if it's empty, it will insert silence. So, the larger the buffer, the longer the interval between skips, but the more severe the skip.

A 0.5s buffer was enough for my equipment to keep skips 10's of minutes apart, but I have no idea how much equipment timing varies.

I found and corrected the error that prevented a buffer larger than 0.5 seconds. I was missing a zero in the line that checks the buffer argument. I no longer use this, so I haven't tested the change. Please report back if you try it.

rccoe commented 7 years ago

Got it, thanks for clarifying. The extra zero fixes it and 5 seconds gives me a much longer time between skips. Problem solved!

On Sat, Jan 21, 2017 at 18:02 b-fitzpatrick notifications@github.com wrote:

This program exists to allow for timing mismatches between an inexpensive analog-to-digital converter (USB sound card) and the PC. Depending on which is faster, the contents of the buffer will either grow or shrink, and when the buffer runs out, the sound will skip. If it's full, it will discard samples, and if it's empty, it will insert silence. So, the larger the buffer, the longer the interval between skips, but the more severe the skip.

A 0.5s buffer was enough for my equipment to keep skips 10's of minutes apart, but I have no idea how much equipment timing varies.

I found and corrected the error that prevented a buffer larger than 0.5 seconds. I was missing a zero in the line that checks the buffer argument. I no longer use this, so I haven't tested the change. Please report back if you try it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/b-fitzpatrick/cpiped/issues/1#issuecomment-274277484, or mute the thread https://github.com/notifications/unsubscribe-auth/ABxPDzDaKzLoDyWhjDIMvyecIiGyD5j0ks5rUkglgaJpZM4LqGB0 .

b-fitzpatrick commented 7 years ago

Great!