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

output.harbor doesn't send ICY metadata #358

Closed
namikiri opened this issue Nov 1, 2016 · 6 comments
Closed

output.harbor doesn't send ICY metadata #358

namikiri opened this issue Nov 1, 2016 · 6 comments
Assignees

Comments

@namikiri
Copy link

namikiri commented Nov 1, 2016

Hello. I have a strange problem. I was using Liquidsoap/1.1.1-7.1 from Ubuntu repos and all worked fine. Recently I decided to switch to FDK-AAC which works only in 1.2.1. I've cloned git repo (liquidsoap-full), built all needed packages (including taglib) and ran my script (the same as for 1.1.1). Stream works, but no metadata is sent, although metadata is read from the files correctly (checked with map_metadata and log). There's no metadata in ICY headers even if I disable any metadata handlers like map_metadata.

What's the problem and how to fix it? No, installing an Icecast/Shoutcast server won't be a good solution for me.

@namikiri
Copy link
Author

namikiri commented Nov 2, 2016

A list of plugins, if it will be helpful for resolution of my problem.

@infectormp
Copy link

I think this was fixed in 1.2.1 version. See #337

@smimram smimram closed this as completed Nov 16, 2016
@namikiri
Copy link
Author

namikiri commented Nov 18, 2016

I'm sorry, but why did you close my issue? It does not belong to #337 issue! More than that, I said that I'm using the latest (1.2.1) version of Liquidsoap and it isn't fixed in it.
The differences are: #337 is about input.harbor, mine is about output.harbor; in #337 Icecast is used, this variant does not use Icecast and output.harbor is used instead.
Please open it back.

Minimal script to reproduce:

#!/usr/bin/liquidsoap
set("log.level", 6)
set("log.stdout", true)
set("log.file", false)

def harbor_connected (~headers,~uri,~protocol,_) =
  list.iter (fun(h) -> log("header: #{fst(h)}: #{snd(h)}"), headers)
end

# Music (tags are known to be filled)
music = mksafe(audio_to_stereo(playlist(reload=1, reload_mode="rounds", mode="randomize", "/mnt/storage/srv/audio/waveradio/witch")))

output.harbor(
#%mp3 streams are also affected
        %fdkaac(bitrate=192, samplerate=48000, channels=2, afterburner=true, aot="mpeg4_aac_lc", sbr_mode=false),
        port=8050,
        mount = "witch",
        on_connect = harbor_connected,
music)

Log (when client connects, note the Icy-MetaData header that being ignord by Liquidsoap):

2016/11/18 14:24:16 [harbor:4] New client on port 8050: 10.10.50.2
2016/11/18 14:24:16 [harbor:4] Header: Icy-MetaData, value: 1.
2016/11/18 14:24:16 [harbor:4] Header: User-Agent, value: BASS/2.4.
2016/11/18 14:24:16 [harbor:4] Header: Host, value: 10.10.50.1:8050.
2016/11/18 14:24:16 [harbor:4] Header: Connection, value: Close.
2016/11/18 14:24:16 [harbor:4] Header: Cache-Control, value: no-cache.
2016/11/18 14:24:16 [harbor:4] HTTP GET request on /witch.
2016/11/18 14:24:16 [harbor:4] Found handler 'GET /witch' on port 8050.
2016/11/18 14:24:16 [witch(dot)1:4] Client 10.10.50.2:59469 connected
2016/11/18 14:24:16 [lang:3] header: Host: 10.10.50.1:8050
2016/11/18 14:24:16 [lang:3] header: User-Agent: BASS/2.4
2016/11/18 14:24:16 [lang:3] header: Cache-Control: no-cache
2016/11/18 14:24:16 [lang:3] header: Connection: Close
2016/11/18 14:24:16 [lang:3] header: Icy-MetaData: 1
2016/11/18 14:24:31 [witch(dot)1:5] Connection reset by peer in write()
2016/11/18 14:24:31 [witch(dot)1:4] Client 10.10.50.2:59469 disconnected

@smimram smimram reopened this Nov 18, 2016
@namikiri
Copy link
Author

Did a bit more detailed research.

First, added a map_metadata function to ensure that meta has been correctly read from the file by Liquidsoap:

def debug_meta (m) =
        log ("*** MEDATADA ***: Artist = #{m[\"artist\"]}; Title = #{m[\"title\"]}")
        # return with no modification
        m
end

# Music (tags are known to be filled)
music = mksafe(audio_to_stereo(playlist(reload=1, reload_mode="rounds", mode="randomize", "/mnt/storage/srv/audio/waveradio/witch")))
music = map_metadata(debug_meta, music)

Then took a look at the logs:

2016/11/18 14:49:56 [witch:3] Prepared "/mnt/storage/srv/audio/waveradio/witch/Alborosie - Guess who's (Craspore Remix).mp3" (RID 1).
2016/11/18 14:49:56 [mksafe:3] Switch to audio_to_stereo_5721 with transition.
2016/11/18 14:49:56 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:map_metadata_5725:witch(dot)1:witch(dot)1].
2016/11/18 14:49:56 [audio_to_stereo_5721:4] Activations changed: static=[mksafe:map_metadata_5725:witch(dot)1:witch(dot)1], dynamic=[mksafe:map_metadata_5725:witch(dot)1:witch(dot)1].
2016/11/18 14:49:56 [lang:3] *** MEDATADA ***: Artist = Alborosie; Title = Guess who's coming to dinner (Craspore Remix)

As we can see, metadata is on its place. Then I've sniffed some traffic between my player and Liquidsoap server. Headers are these:

GET /witch HTTP/1.1
Icy-MetaData: 1
User-Agent: BASS/2.4
Host: 10.10.50.1:8050
Connection: Close
Cache-Control: no-cache


HTTP/1.1 200 OK
Content-type: audio/aac
icy-metaint: 16000

It says icy-metaint: 16000 that means the metadata will be sent after 16000 bytes of data, but it wasn't sent at all, although I was sniffing the stream for ~30 seconds (~350 Kb of data). Search for 'craspore' didn't give me any result. That means that my player works correctly and the problem is in Liquidsoap.

@toots
Copy link
Member

toots commented Jan 9, 2017

Thanks for this detailed report. I'll be looking into it.

@toots
Copy link
Member

toots commented Jan 9, 2017

Well, that was a stupid bug.. Fixed in 06adbac, thanks for reporting!

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

4 participants