zeroexcuses
-
I understand the argument of “erlang has it’s roots in telephony, of course erlang/elixir is a great fit for this”
-
I understand that voice chat is “basically just a router for udp packets, and elixir has great libraries for those”
-
For whatever reason, looking at old threads, I am not finding a good simple example:
Question: Is there any example of using erlang/elixir to build a simple voice chat server (I don’t care if the client is desktop software or browser/rtc), I’m just looking for something where erlang/elixir itself does the ‘heavy lifting’ (rather than offloading the work to some other server).
Thanks!
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
RudManusachi
My understanding of such project is: elixir/erlang is a great fit of “orchestration”.. connecting people, setting the pipeline of encoding/decoding/streaming via web/etc. But underneath those encoder/decoder are still delegated to some low level libs.
Though, please note, that I’m not an expert in the the subject and all my experience for realtime audio/video chat is limited by one project where it’s done via WebRTC and Elixir/Phoenix server was just authorizing and connection people.
I think you might be interested in Membrane Framework. Looks like they provide with plugins to use audio codecs and there is a repo with some demos.
zeroexcuses
Do you have any intuition on why this is? Given that audio is relatively “low bandwidth”, surely the problem is not copying bytes around efficiently. Is there some expensive step with encoding/mixing/decoding that Erlang/Elixir is not well suited for?
RudManusachi
My vague memories from “signal processing” class remind me that those algorithms usually require lots of numerical calculations. Simply saying - if digital audio is represented as a list of numbers - any conversion of it would require some kind of number crunching which is not the strongest side of the BEAM.
(I wonder if Elixir Nx might change that in the future, though right now it’s more focusing on ML problems.. also there is a library pelemay that could probably help (?))
dimitarvp
Not sure there’s any perfectly justified reason but at least my thinking would be that the BEAM has GC pauses (albeit very short and are per-process which should limit their impact) that can affect latency – which would be a deal-breaker in audio streaming. And as @RudManusachi said, number crunching isn’t the BEAM’s strongest suit so future scaling might suffer.
If you expect no more than 20 people streaming audio at any given time and have done due measurements then Elixir might be a perfect choice. But there are multiple stories I’ve read in blogs about a lot of binaries moved around which eventually made the BEAM’s GC slower.
But from my side I’d opt for an Elixir orchestrator and a Rust implementation beneath just to be sure if the app scales it will still work without lagging.
All that being said, maybe it pays off to ping the creators of Membrane? → Membrane - a new framework for multimedia processing
mat-hek
Agreed
Playing with media is not as simple as you’d expect, unfortunately
We’re building WebRTC SFU server, that handles both audio and video. We made it work, but It’s still experimental and extensively developed.
That’s mostly true, though Elixir is very convenient for handling protocols and containers too, because of its good support for binaries and bitstrings. Heavy, numerical computations are indeed delegated to low-level, mostly C libraries, but since it’s done via simple NIFs or C nodes, it doesn’t involve
If you deal with latencies around 2ms, then it may be a problem - haven’t tested. But for usual media streaming it’s good enough. People even write streaming apps in Go, that has stop-the-world GC - that one happens to be problematic though, AFAIK.
We didn’t have time for big optimizations of Membrane yet, neither we used it with OTP 24 JIT. Anyway, it’ll probably never be as fast as if we used Rust or C. Membrane focuses rather on reliability, scalability and maintainability.
zeroexcuses
@mat-hek : Thanks for the detailed and insightful reply.
Can you please verify that Membrane also supports client->server instead of just p2p chat? For example, if we are doing something like Minecraft/AmongUs proximity chat, we want the server to be able to take the audio streams, take the user’s location into account, and remix it.
If it is not too much trouble, could you guide us through “journey of 1ms of sound data?” ? Suppose person A is talking to person B with client-server (not p2p), I can get us started with
Could you walk us through those intermediate steps (possibly which parts of the membrane codebase it hits?)
Thanks!
mat-hek
It’s an SFU server
You can easily find a lot of information about WebRTC on the net, for example at https://webrtchacks.com/. In short, it goes like that:
zeroexcuses
@mat-hek : Thank you for the detailed response. I went through the SFU link. Is the main difference between MCU vs SFU as follows:
MCU = server receives all incoming streams, decodes them, laysout streams on a ‘virtual screen’, re-encodes virtual screen
SFU = server does not modify any incoming stream; just re-routes it to destination
?
zeroexcuses
If my above understanding of MCU / SFU is correct, than what you described above – Membrane doing encoding / decoding – means that, atleast for audio, Membrane also supports MCU right ?
mat-hek
That’s true, in the case of audio the MCU would mix the audio together and send one mixed stream to each participant
Our server is SFU only, at least for now, so it doesn’t do reencoding, it only repacks/re-muxes streams. However, it should be totally possible to build an MCU with Endpoint Bins and other Membrane plugins - for audio, we should even have all the needed plugins available - though some are experimental.