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

Websocket support for harbor #90

Merged
merged 38 commits into from
Jul 27, 2013
Merged

Websocket support for harbor #90

merged 38 commits into from
Jul 27, 2013

Conversation

smimram
Copy link
Member

@smimram smimram commented Jul 4, 2013

No description provided.

@@ -42,8 +46,9 @@ object (self)
~log ~kind ~overfull:(`Drop_old max_ticks) `Undefined)
~empty_on_abort:false ~bufferize as generated

(** POSIX sucks.. *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POSIX doesn't suck anymore? :-)

@toots
Copy link
Member

toots commented Jul 4, 2013

Excellent, thanks! It looks cool, I'll take it from there and cleanup/split harbor code and finish the protocol.

@mcfiredrill
Copy link
Contributor

Does this work with the server and lame.html in the test directory? I added a harbor input on port 9000, switched the port number in lame.html,t started the httpserver and hit the record button. Looked like the browser was writing to the websocket a little bit, then stops. Looking at the liquidsoap logs, liquidsoap didn't get a new habor connection. 😕

@toots
Copy link
Member

toots commented Jul 10, 2013

Hi @mcfiredrill! I think you did the right tests. However, this is still pretty much work in progress for now (hence the WIP in the PR title above). Sam did a great job at laying down the initial work but we still need to cleanup and generalize it. I plan on getting back to this ASAP.

@mcfiredrill
Copy link
Contributor

Cool! Looking forward to it. Wish I could help out in some way but there's not much I can do with my nonexistant ocaml skills heh...

@smimram
Copy link
Member Author

smimram commented Jul 18, 2013

@mcfiredrill the test is now properly working! Only raw data can be sent for now though.

@smimram
Copy link
Member Author

smimram commented Jul 18, 2013

Actually, lame mp3 encoding is working too now!

module Generator = Generator.From_audio_video
module Buffered = Decoder.Buffered(Generator)

(* TODO: we don't want a file decoder, do we? *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no! :-)

@toots
Copy link
Member

toots commented Jul 19, 2013

Looking good! I'll have a final pass on it this week end, write the docs for the protocol and BAM!, merge!

@mcfiredrill
Copy link
Contributor

Awesome! 👍 👍 👍 👍 👍 👍

@mcfiredrill
Copy link
Contributor

Eh sorry, didn't read the README. I'll read that and be back....

@mcfiredrill
Copy link
Contributor

I got it to work, mostly. It wouldn't work with any mount name other than 'mount'. The sound was pretty choppy for some reason. But anyway, amazing work! I'll keep trying it out...

@smimram
Copy link
Member Author

smimram commented Jul 19, 2013

Thanks for testing!

Concerning the mount point you have to change it both in the server websocket.liq and the client lame.html.

The reason why it is choppy I guess is that mp3 encoding is done in javascript, which is quite cpu intensive... Let's hope that some native support will be added in future HTML5 audio API. You could also try raw.html which should be much more decent cpu-wise (but sends much more data...)

@toots
Copy link
Member

toots commented Jul 19, 2013

As Sam says, this all depends on technologies that are still being
implemented. The bottleneck for now is that firefox doesn't seem to
implement the required audio APIs (yet) but implements asm.js while
Chrome has the audio API but no support for asm.js

asm.js is mozilla's restricted javascript subset, which can be
compiled and run as remarkably fast speeds. I've done some testing
with our libshine for mp3 encoding and it was quite encouraging:
https://github.com/savonet/shine/tree/master/js

Let's hope that firefox implements audio APIs soon, that would make it
a great candidate for a browser-base source client!

Romain

toots added a commit that referenced this pull request Jul 27, 2013
Websocket support for harbor
@toots toots merged commit 5f7e3f1 into master Jul 27, 2013
@toots toots deleted the websockets branch July 27, 2013 18:59
@jdbuys jdbuys mentioned this pull request Aug 30, 2022
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

Successfully merging this pull request may close these issues.

3 participants