{"action":"created","issue":{"url":"https://api.github.com/repos/mixxxdj/mixxx/issues/665","labels_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/665/labels{/name}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/665/comments","events_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/665/events","html_url":"https://github.com/mixxxdj/mixxx/pull/665","id":98524390,"number":665,"title":"Fix Shoutcast live sending not to break stream","user":{"login":"illuusio","id":1902756,"avatar_url":"https://avatars.githubusercontent.com/u/1902756?v=3","gravatar_id":"","url":"https://api.github.com/users/illuusio","html_url":"https://github.com/illuusio","followers_url":"https://api.github.com/users/illuusio/followers","following_url":"https://api.github.com/users/illuusio/following{/other_user}","gists_url":"https://api.github.com/users/illuusio/gists{/gist_id}","starred_url":"https://api.github.com/users/illuusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illuusio/subscriptions","organizations_url":"https://api.github.com/users/illuusio/orgs","repos_url":"https://api.github.com/users/illuusio/repos","events_url":"https://api.github.com/users/illuusio/events{/privacy}","received_events_url":"https://api.github.com/users/illuusio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":35,"created_at":"2015-08-01T09:39:01Z","updated_at":"2015-08-31T21:38:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/665","html_url":"https://github.com/mixxxdj/mixxx/pull/665","diff_url":"https://github.com/mixxxdj/mixxx/pull/665.diff","patch_url":"https://github.com/mixxxdj/mixxx/pull/665.patch"},"body":"Shoutcast streams are breaking heavily on Mixxx 1.12 beta (launchpad bug #1277274). Mainly the problem is that Mixxx is not using shout_sync() (and output can't block) function and this the reason why it gets out of the sync.\r\nThis one creates new thread inside Shoutcast engine that handles writing things from cache and so there is not big changes needed to Mixxx engine."},"comment":{"url":"https://api.github.com/repos/mixxxdj/mixxx/issues/comments/136508802","html_url":"https://github.com/mixxxdj/mixxx/pull/665#issuecomment-136508802","issue_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/665","id":136508802,"user":{"login":"daschuer","id":1777442,"avatar_url":"https://avatars.githubusercontent.com/u/1777442?v=3","gravatar_id":"","url":"https://api.github.com/users/daschuer","html_url":"https://github.com/daschuer","followers_url":"https://api.github.com/users/daschuer/followers","following_url":"https://api.github.com/users/daschuer/following{/other_user}","gists_url":"https://api.github.com/users/daschuer/gists{/gist_id}","starred_url":"https://api.github.com/users/daschuer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daschuer/subscriptions","organizations_url":"https://api.github.com/users/daschuer/orgs","repos_url":"https://api.github.com/users/daschuer/repos","events_url":"https://api.github.com/users/daschuer/events{/privacy}","received_events_url":"https://api.github.com/users/daschuer/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T21:38:15Z","updated_at":"2015-08-31T21:38:15Z","body":"> We can adjust that. Original implementation had 20 packets buffer (about 5 secs) after pushing them to server. \r\n\r\nWe have to distinguish between the buffer, used for delayed framed from the Mixxx engine and Buffer that is used in case of network issues. In the latest version we collect \r\n180 ms raw sample chunks that are transfered to shoutcast in EngineNetworkStream. The buffer can hold up to 743 ms, until it starts dropping frames. The buffer is filled if the shoutcast thread is delayed for any reason. It might be blocked during the the shout_send call since we shoutcast defaults to shout_set_nonblocking = 0; \r\n\r\nCurrently in such a case old samples are dropped and might loose sync and break the stream. \r\nTo avoid this we may increase the EngineNetworkStream buffer size, or we may enable the \r\nshout_set_nonblocking = 1 which enables libshout's own dynamic cache using \"shout_queue_data()\" / \"send_queue()\" in case transmitting is not possible.\r\n\r\nI do not know witch is best. The EngineNetworkStream buffer is a preallocated buffer, holding uncompressed samples, which will finally overflow in the worst case. \r\nThe cache inside libshout is dynamically growing up to infinity which will finally crash Mixxx if all memory is used. \r\n\r\nSo it looks like we need a limit somehow and an error handling, that stops the stream and restarts it after the network connection is back. Or does libshout already have it? \r\n\r\n  \r\n\r\n"}}