curl/GnuTLS error in podcasts

Need help with MPD?
Post Reply
pajaro
Posts: 4
Joined: October 22nd, 2018, 12:18 pm

curl/GnuTLS error in podcasts

Post by pajaro » October 22nd, 2018, 2:27 pm

Hi.

After using MPD to listen to podcasts for a long time, a few days ago I started having random cuts in some of the podcasts. I always get logs like this:

Oct 21 19:44 : db: No such song: https://prisa-es.mc.tritondigital.com/O ... @><@><@>La Vida Moderna | Quemando rueda<@><@>1998<@>0<@>0<@>0<@>podcasts
Oct 21 19:44 : curl: curl failed: SSL connection timeout
Oct 21 19:44 : player: played "https://prisa-es.mc.tritondigital.com/O ... @><@><@>La Vida Moderna | Quemando rueda<@><@>1998<@>0<@>0<@>0<@>podcasts"
Oct 21 19:55 : curl: curl failed: GnuTLS recv error (-9): A TLS packet with unexpected length was received.
Oct 21 19:55 : player: played "https://prisa-es.mc.tritondigital.com/O ... @><@><@>La Vida Moderna | Quemando rueda<@><@>1998<@>0<@>0<@>0<@>podcasts"


Sorry for the long titles... You can subscribe to that podcast with:

http://fapi-top.prisasd.com/podcast/pla ... odcast.xml

In Spanish, btw. Sometimes the error takes longer, sometimes shorter. But it always happens after a few minutes.

A few google searches told me that there might be some protocol issue here. Some servers send a packet to finish a stream, some don't. And some implementations care about this, and some don't. I might be wrong, of course. But the point is that this seems to be server related. I have no problem with podcasts from other servers. But there is no contact where I can report this.

I have tried to use a longer buffer, like this:

audio_buffer_size "131071"

so I observe that, after the curl/GnuTLS error, I still get a few minutes of sound. But that's the longer buffer size I can configure.

I have also tried disabling the curl plugin, but then I can't play the stream. The ffmpeg plugin doesn't seem to help.

mpv can play the streams, just with "mpv http://...". Just to tell that the server doesn't always fail so, from the admin point of view, perhaps "this is not a bug but a feature".

I am using Debian stable, with the following packages:

root@cacharrito:/var/log/mpd# dpkg -l | grep mpd
ii libmpd1 0.20.0-2~deb9u1 i386 High-level client library for accessing Music Player Daemon
ii libmpdclient2 2.9-1 i386 client library for the Music Player Daemon
ii mpd 0.19.21-1 i386 Music Player Daemon

I have also tried Debian testing (mpd 0.20.21) with the same result. Unstable still have the same versions.

I could recompile to get a bigger buffer (if I knew how to...) or I could compile the latest source, as the changelog show some curl fixes. But only if I know that there is a chance it could work. As you know, mixing compiled software and packages can be troublesome.

thanks a lot for your support

max
Forum team
Posts: 884
Joined: January 15th, 2013, 3:43 pm

Re: curl/GnuTLS error in podcasts

Post by max » October 22nd, 2018, 2:35 pm

Do not mess with buffer settings. They don't help, all you do is create problems.

The server is extremely slow. It takes 15 seconds to connect (even with mpv), but MPD's patience expires after 10 seconds and it gives up. That's the problem.

pajaro
Posts: 4
Joined: October 22nd, 2018, 12:18 pm

Re: curl/GnuTLS error in podcasts

Post by pajaro » October 22nd, 2018, 3:00 pm

Thanks for the quick reply.

Is there any solution to this? By making the buffer bigger I was trying to give MPD more patience, but it just delays the same result.

Checking old logs, I already had the same problem long ago, but eventually, it would always work again. Now it doesn't so I am trying things.
Any idea is welcome.

max
Forum team
Posts: 884
Joined: January 15th, 2013, 3:43 pm

Re: curl/GnuTLS error in podcasts

Post by max » October 22nd, 2018, 5:54 pm

Changing the buffer size doesn't have anything to do with this problem. All instructions on the net telling you to change buffer sizes are wrong.

No, the MPD timeout isn't configurable; you'd need to edit the source code to change it. However, this constant 15s delay seems like a heavy misconfiguration on the radio station. Maybe you should tell them.

pajaro
Posts: 4
Joined: October 22nd, 2018, 12:18 pm

Re: curl/GnuTLS error in podcasts

Post by pajaro » October 23rd, 2018, 8:36 am

I couldn't find where I can report this, but I'll try again. These 15 seconds, do you see it in some log? Or is it just a value you know? I'd like to make a good report.

About the timeout, I'll try to recompile. I have downloaded the debian source package and found the curl headers file. But the only reference to a timeout is 10 ms, so I'm not sure I should change it.

max
Forum team
Posts: 884
Joined: January 15th, 2013, 3:43 pm

Re: curl/GnuTLS error in podcasts

Post by max » October 23rd, 2018, 9:04 am

This is how you can see the delay:

Code: Select all

time curl -v --location -i https://prisa-es.mc.tritondigital.com/OH__MY_LOL_LA_VIDA_MODERNA_CADENASER_544_P/media/2018/10/17/001RD010000005237255.mp3
Here it shows at the end:

Code: Select all

real	0m15.539s

max
Forum team
Posts: 884
Joined: January 15th, 2013, 3:43 pm

Re: curl/GnuTLS error in podcasts

Post by max » October 23rd, 2018, 9:07 am

This is where to find the hard-coded timeout: https://github.com/MusicPlayerDaemon/MP ... st.cxx#L66

skidoo
Posts: 164
Joined: April 28th, 2013, 10:06 pm
Location: Western Germany

Re: curl/GnuTLS error in podcasts

Post by skidoo » October 24th, 2018, 12:27 pm

Not able to reproduce
real 0m0,503s (big pipe)
real 0m4.123s (generic dsl)
On the other hand... I would like to see a shorter timeout for my local streaming sources. How about a config option for curl timeout? Let say 1 to 60 seconds?

pajaro
Posts: 4
Joined: October 22nd, 2018, 12:18 pm

Re: curl/GnuTLS error in podcasts

Post by pajaro » October 24th, 2018, 5:42 pm

Well, good and bad news...

Bad news is that I recompiled several times the deb packages, both stable and testing (0.19, 0.20). I have increased the timeout with no change. I still get the gnutls error. I even tried to (ugly) solution of increasing the buffer size. I changed one #define, but the maximum value I can configure is still the same.

Sooo... reluctantly, as a last resort, I tried the git version. I don't like to mix official packages and compiled from source, but...
And the thing is that it worked flawless! (that's the good news). The error doesn't happen anymore, and the connection feels even faster. So I guess there was some bug that has been fixed. Too bad it isn't still a released version (as of today, of course). I'll try the next debian package, whatever version it is, and see if includes the fix.

thanks for the help

skidoo
Posts: 164
Joined: April 28th, 2013, 10:06 pm
Location: Western Germany

Re: curl/GnuTLS error in podcasts

Post by skidoo » October 25th, 2018, 1:13 pm

For all the new and exciting features stick with MPD master from git and be the first to report a new bug :lol:

Installing MPD into your homedir does not mess up your system. Personally, I prefer the system-wide installation. For starters, just use the compiler parameters and settings from the Debian package and everything will be fine.

Post Reply