owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.09k stars 234 forks source link

audio stops after 3/4 seconds #279

Closed LoloVTS closed 8 years ago

LoloVTS commented 8 years ago

Hi ejurgensen,

I'm trying to use forked-daapd on Odroid-C2 board based on armbian distrib.

Here is the behaviour I'm observing: 1/ Starting playback on Airplay speaker is okay 2/ after 4 seconds, playback stops 3/ If I try to play mp3 network stream with a remote PC it starts, but stops also after 4 seconds with following errors (from vlc):

main error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1000 ms)
main error: ES_OUT_RESET_PCR called

4/ If I try again the mp3 network stream, I get the same result as point 3 5/ After 9 minutes playback stops

Here are some log I'm getting in forked-daapd during playback:

[2016-07-29 14:47:44] [ WARN]   player: Behind the playback timer with 3 ticks, initiating catch up
[2016-07-29 14:47:44] [ SPAM]   player: Skipping read
[2016-07-29 14:47:44] [ WARN]   player: Behind the playback timer with 3 ticks, initiating catch up
[2016-07-29 14:47:44] [ SPAM]   player: Skipping read
[2016-07-29 14:47:45] [ SPAM]   player: Skipping read
[...]
[2016-07-29 14:49:49] [ WARN]   player: Behind the playback timer with 3 ticks, initiating catch up
[2016-07-29 14:49:49] [ SPAM]   player: Skipping read
[2016-07-29 14:49:49] [ SPAM]   player: Skipping read
[...]
[2016-07-29 14:50:18] [ WARN]   ffmpeg: incomplete frame
[2016-07-29 14:50:18] [DEBUG]    xcode: Couldn't decode packet
[2016-07-29 14:50:18] [ WARN]    xcode: Could not read frame: Connection reset by peer
[2016-07-29 14:50:18] [DEBUG]    xcode: Could not read packet, will flush decoders
[2016-07-29 14:50:18] [DEBUG]    xcode: Flushing output stream #0 encoder
[2016-07-29 14:50:18] [DEBUG]   player: New file
[2016-07-29 14:50:18] [  LOG]   player: Error reading source 7

I tried with different formats (http mp3/local flac/pipe using avconv) with the same result.

If you have some advices where to look for debugging?

Regards,

Loic

ejurgensen commented 8 years ago

A few questions: What version of forked-daapd? The log output appears to be from a http stream - could you attach the log from a normal file, and with just regular Airplay?

LoloVTS commented 8 years ago

I've updated from today master branch.

Find attached logs for a mp3 file playback.

forked-daapd.log.txt

I did another test: when trying to output to a shairplay based device, instead of only few second playing, the file is playing but at a slower rate. The 4:24 long song lasts 5:28.

Regards

ejurgensen commented 8 years ago

Could be an issue with the system clock resolution? If the resolution is longer than 7981859 ns then this might happen. Forked-daapd tries to detect the system resolution, but it is not always reliable.

Here is an experiment you could try: Remove line 3996 in player.c ("#if defined...") and the "endif" on line 4002. Then test if it makes a difference. Please take care to actually test with the modified binary! You could add a little log message or something to make sure of that.

LoloVTS commented 8 years ago

Awsome, this is working fine with the modification!