Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harbor & shoutcast protocol (v1.2.0) #337

Closed
Jontyy opened this issue Jun 3, 2016 · 9 comments
Closed

Harbor & shoutcast protocol (v1.2.0) #337

Jontyy opened this issue Jun 3, 2016 · 9 comments
Assignees

Comments

@Jontyy
Copy link

Jontyy commented Jun 3, 2016

Hi all,

I'm having issues connecting to harbor with the shoutcast protocol, icecast2 works fine. I'm seeing this in the logs:

2016/06/03 10:14:23 [harbor:4] Header: icy-url, value: http://www.rogueamoeba.com/nicecast/.
2016/06/03 10:14:23 [harbor:4] Header: icy-pub, value: 1.
2016/06/03 10:14:23 [harbor:4] Header: icy-br, value: 128.
2016/06/03 10:14:23 [harbor:4] ICY request on /.
2016/06/03 10:14:23 [harbor:4] Adding source on mountpoint "/" with type "audio/mpeg".
2016/06/03 10:14:23 [harbor:5] Relaying ICY.
2016/06/03 10:14:23 [harbor:4] Returned 500 for '/': File "tools/harbor.ml", line 369, characters 31-37: Assertion failed

I installed liquidsoap from opam with the following packages: faad fdkaac mad lame vorbis cry aacplus taglib liquidsoap.1.2.0

Here is a minimum working example for reproducing this issue:

set("log.file",true)
set("log.level",6)
set("log.stdout", true)
set("log.file.path","liquidsoap_shoutcast.log")

harbor_port = 1104

icecast_host = "127.0.0.1"
icecast_port = 8000;
icecast_password = "hackme"

def on_harbor_connect (headers) =
  list.iter (fun(h) -> log("header: #{fst(h)}: #{snd(h)}"), headers)
end

def dj_auth (u,p) =
  true
end


live_dj = audio_to_stereo(input.harbor("",id="live_dj",auth=dj_auth, port=harbor_port,buffer=15.0,max=30.0,icy=true,on_connect=on_harbor_connect))

source = mksafe(live_dj)

clock.assign_new(id="output_listen", [output.icecast(%mp3(bitrate=128),id="output_listen",
                                    mount="/live",
                                    host=icecast_host, port=icecast_port, password=icecast_password,
                                    icy_metadata="true",description="",
                                    url="",
                                    mksafe(buffer(source)))])

Thanks in advance.

@Jontyy
Copy link
Author

Jontyy commented Jun 7, 2016

Looks like this issue is isolated to my opam install, I installed v1.0.1 today on debian 7 from apt and it was working fine, I cannot use this though as aac+ was limited before fdkaac if I remember correctly?

Here is the output from v1.0.1

2016/06/07 10:31:14 [harbor:4] New client on port 1105: 192.168.33.1
2016/06/07 10:31:15 [lang:3] dj authenticated successfully
2016/06/07 10:31:15 [harbor:4] Header: icy-url, value: http://www.rogueamoeba.com/nicecast/.
2016/06/07 10:31:15 [harbor:4] Header: icy-pub, value: 1.
2016/06/07 10:31:15 [harbor:4] Header: icy-br, value: 128.
2016/06/07 10:31:15 [harbor:4] ICY request on /.
2016/06/07 10:31:15 [decoder:4] Trying method "WAV" for "audio/mpeg"...
2016/06/07 10:31:15 [decoder:4] Trying method "PCM/BASIC" for "audio/mpeg"...
2016/06/07 10:31:15 [decoder:4] Trying method "MAD" for "audio/mpeg"...
2016/06/07 10:31:15 [decoder:3] Method "MAD" accepted "audio/mpeg".
2016/06/07 10:31:15 [lang:3] header: icy-url: http://www.rogueamoeba.com/nicecast/
2016/06/07 10:31:15 [lang:3] header: icy-pub: 1
2016/06/07 10:31:15 [lang:3] header: icy-br: 128
2016/06/07 10:31:15 [lang:3] harbor connect
2016/06/07 10:31:16 [threads:3] Created thread "harbor source feeding" (2 total).
2016/06/07 10:31:16 [harbor:4] Adding source on mountpoint "/" with type "audio/mpeg".
2016/06/07 10:31:16 [live_dj:3] Decoding...
2016/06/07 10:31:16 [harbor:4] New client on port 1104: 192.168.33.1
2016/06/07 10:31:16 [harbor:4] Header: Content-Length, value: 0.
2016/06/07 10:31:16 [harbor:4] Header: User-Agent, value: Shoutcast(Mozilla).
2016/06/07 10:31:16 [harbor:4] HTTP GET request on /admin.cgi.
2016/06/07 10:31:16 [harbor:4] HTTP Arg: url, value: http://www.rogueamoeba.com/nicecast/.

Any chance anybody could help out in getting this to work on 1.2.0? I'm assuming its just a missing dependency on my system?

@SkepticalHippo
Copy link

Adding Icy to match hprotocol in harbor.camlp4 line 401 seems to fix this issue.

@toots toots closed this as completed in 35bdd80 Jun 8, 2016
@toots
Copy link
Member

toots commented Jun 8, 2016

Wow. Good find and great debugging, thanks. Looks like this one had been around since at least when chunked transfer was introduced, back in 2013.. Should be fixed in latest git now.

@Jontyy
Copy link
Author

Jontyy commented Jun 10, 2016

@toots When will this fix be available in opam?

Or what would be the recommended way to install this patch now considering we already use liquidsoap 1.2 from opam? I tried opam pin but had failed to apply patch issues "lang_builtins.patch".

Thanks in advance.

@smimram smimram reopened this Jun 14, 2016
@toots
Copy link
Member

toots commented Jun 16, 2016

I'm looking at doing a quick bug-fix release soon, there's been some important stuff pushed lately. Will get back at you asap.

@jmulvany
Copy link

It would really be a big help!

@acorkin
Copy link

acorkin commented Jun 24, 2016

@toots just wondering if there is any update for a fix in opam? It's the only thing holding us back at the moment 👍

@toots
Copy link
Member

toots commented Jun 25, 2016

Gonna try to do it soon.

@Jontyy Jontyy closed this as completed Jul 7, 2016
@Jontyy
Copy link
Author

Jontyy commented Jul 7, 2016

@toots thanks for this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants