Baseflow / Baseflow/XamarinMediaManager

Multiple GET requests to IceCast server (stream url) keeps on

Open
#790 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
763
Forks
299
PR merge metrics
No merged PRs in 30d

Description

Hi, we have a working app that is used as our radio-player. It streams audio from a Icecast server and the streaming seems to be just fine.

After pushing to production and old customers turned to the new app we are seeing a lot of traffic on our Icecast server and experienced some downages due to this increase in traffic.

We figured that a single play on the app results in multiple (Up to 8) simultanious GET requests to the stream url. Besides that the URL is called twice every 20 seconds from the same IP as the device, both in foreground and background.

Needless to say this can generate quiet some traffic on the IceCast server (Especially if 1000+ tunes in at the same time). I've been debugging and checking logs in an attempt to figure if this was a problem with my implementation, but have found no evidence of this; when debugging the "Play" method is only called once, and i have no timed actions calling the stream URL. This leads me to suspect some "behind the curtain"-code.

Do any of you know about this; or experienced the same - perhaps you know of a "solution" or work-around?

**This is called ONCE when the user press the "Play" button**
```
Device.BeginInvokeOnMainThread(async () =>
{
// Play the stream.
await CrossMediaManager.Current.Play(stream.Url);
});
```

**Heres a dump of a test period**
77.68.xxx.xxx - - [27/Jan/2021:08:39:40 +0100] "GET /radio1 HTTP/1.
85.191.zzz.zzz - - [27/Jan/2021:08:39:40 +0100] "GET /radio1 HTTP/
77.68.xxx.xx - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1.
77.68.xxx.xx - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1.
77.68.ttt.tt - - [27/Jan/2021:08:39:41 +0100] "GET /radio2 H
77.68.xxx.xx - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1.
77.68.xxx.xx - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1.
80.62.sss.sss - - [27/Jan/2021:08:39:41 +0100] "GET /radio2
62.107.000.000 - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/
80.62.sss.sss - - [27/Jan/2021:08:39:41 +0100] "GET /radio2
77.68.xxx.xx - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1.
192.38.666.66 - - [27/Jan/2021:08:39:41 +0100] "GET /radio2
192.38.555.55 - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1
77.68.xxx.xx - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1.
87.56.444.444 - - [27/Jan/2021:08:39:41 +0100] "GET /radio1 HTTP/1
85.191.333.333 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
77.68.xxx.xx - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.
77.68.xxx.xx - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.
77.68.xxx.xx - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.
5.33.11.11 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.1"
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
77.68.xxx.xx - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.
77.68.xxx.xx - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
5.33.11.11 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.1"
5.33.11.11 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/1.1"
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/
62.107.000.000 - - [27/Jan/2021:08:39:42 +0100] "GET /radio1 HTTP/

**Thanks in advance!**

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the single Play call shown in the issue and compare it with the Icecast access-log entries, including foreground and background behavior. Trace CrossMediaManager.Current.Play(stream.Url) through the platform playback implementation to determine whether the extra requests originate in the library or the app. Done means a confirmed cause and a documented fix or workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
audio-video-rtc, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.