Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Simple broadcast setup w/ foobar2000 & liquidsoap? (Read 7996 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Simple broadcast setup w/ foobar2000 & liquidsoap?

Hi everyone,
I am trying to set-up simple solution for broadcasting into liquidsoap with the possibility to mix microphone input into the stream.
Back in the old days, I'd set-up analog console and feedback the audio with output from mic preamp, but I had to sell my mixing console some time ago and so it'd have to be done in software.

I managed to do the following chain:
foobar2000 (source) > HiFiVBCable > liquidsoap > icecast (on remote server)

but there's no possibility to monitor the stream (latency-free) or mix microphone input.
I have tried various setup involving REAPER and ASIO4ALL, but couldn't get the desired result.

Any idea what else (besides getting an analog console) to try?

Environment used
Windows 7 x64
Behringer UCA204HD
Audiotechnica AT2035
and software mentioned above


Thanks for any input
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #1
Anyone?
Could perhaps JACK for Windows help?
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #2
Maybe something like mixxx, but I imagine player is format limited and not sure how replaygain is implemented. It is a fun software otherwise. P.s. hardware would still need more channels than stereo for listening / prelisening purposes I imagine (for example to prelisen next track).
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #3
Don't need something fancy, I usually know all the tracks by heart, so no prelisten necessary  :D
I used to do this in the past
Sound Source > Behringer 1002B = Sound Source (2ch) + Mic (phantom powered) > Out1 - headphones, Out2 feedback to line-in
Shoutcast DSP capture from Line-In, title update from tempfile
Done - zero monitoring latency and easy control.

If possible I'd prefer to stay with foobar, due to its Opus support and by being fairly lightweight and straightforward.
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #4
According to page it supports opus as well. https://www.mixxx.org/features/ (it is light enough to play/automix 5 hours of music from extremely old underpowered atom laptop without hickups < tested). More importantly you can patch output in several ways https://transfer.sh/8kvRY/2017-07-13-110238_1173x712_scrot-fs8.png (not sure what is possible with foobar). Perhaps it is possible to use it as a mixer only, patching foobar output to some input..., so:

Code: [Select]
mic +--------------------+
                         |
                         v
foobar +------------>  mixxx +------------> streaming master
                         +
                         |
                         v
                      listening master
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #5
Did you  see VoiceMeeter by the same people who make vbcable? And they have other tools too.

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #6
Thanks for suggestions - Voicemeeter Banana seems like the solution that might work best - still the latency is a bit too high for my liking.
I have dug up an old Thinkpad X60 with Windows XP which still has Stereo Mix feedback - although kmixer is, well, what it is, it runs native 48kHz, perfect for Opus. So I'll use UMC204HD as a mic preamp and feed the signal to laptop's line in to be mixed with audio out from foobar and capture through Stereo Mix in LS.

Now to venture into unknown territory and cross-compile LS with Opus 1.2.1...that might take some effort.
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #7
I was looking at compiling updated Windows binaries with Opus 1.2.1 and got nowhere. It's above my pay-grade.

I ended up using external encoders on Windows. But it messed up my tags when using Opus. However the tags work if I use qaac (Apple's AAC)

BTW, comparing the resulting Opus quality upgrade: it was worth it. In particular when testing at low bit rates like 32kbps. Now if only I can get those tags working again.

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #8
I could not get tag update working on any Opus combined with Icecast.
First I blamed butt, then LS, but supposedly the problem is elsewhere: https://sourceforge.net/p/butt/bugs/10/

LS has rather poor support on Windows, forget about updating titles from a file.
Still, it's the most powerful broadcasting tool, as it seamlessly integrates Opus and Ogg-FLAC - formats I care about :)
Too bad the tagging issue comes with it...

I'll post the binary if I could finish the Opus 1.2.1 integration into liquidsoap 1.1.1 for native Windows build
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #9
You're right about the tags, they weren't ever working with Opus here either. Not with the built-in nor external encoder.

I have various tests streams. Maybe I had seen the ogg/vorbis one and got confused.

I've yet to try LiquidSoap on linux. Maybe "Ubuntu Bash for Windows 10" is an option.



Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #11
I could not get tag update working on any Opus combined with Icecast.

If you want to ditch LS try foo_streamer
https://hydrogenaud.io/index.php/topic,66452.msg914807.html#msg914807
Tag update working on opus with Icecast 2.4.3.


I have run into fundamental issue - how do I open its interface?
Can't find any trigger in foobar's settings
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #12
From foobar2000's main menu .
View > Streaming Client

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #13
Thanks! That works really well, and supports both Opus VBR and FLAC.
How do I mix it with mic input though?
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain


Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #15
I'm losing track of how the chain would look like.
So streamer would encode using ffmpeg which would multiplex mic input with streamer output and send it to opusenc?
Code: [Select]


streamer -----------> ffmpeg ------------> opusenc ----------> streamer -----------> icecast
                        /|\
                         |
                  mic input


My apologies, I never muxed with ffmpeg.

Also there's another little issue - when playback stops, the stream is disconnected, as opposed to mksafe in LS.
“Never argue with stupid people, they will drag you down to their level and then beat you with experience.” -- M. Twain

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #16
The chain would be like that.

Encoder Settings:



ffmpeg command:
Code: [Select]
-loglevel quiet -i - -f dshow -i audio="Line 1 (Virtual Audio Cable)" -filter_complex "[0][1] amix [a];[a] volume=volume=2 [b]" -map "[b]" -f wav -

Replace "Line 1 (Virtual Audio Cable)" with your mic input device.
To find available run

Code: [Select]
ffmpeg -list_devices true -f dshow -i dummy

In foobar2000's DSP settings add a resampler and resample to 48000.

Yes the stream will stop when playback stops.
Maybe you could use LS for the main stream (mksafe)  and relay foo_streamer with input(http) when its available .

Code: [Select]
foo_streamer = mksafe(input.http("http://localhost:8000/stream_opus"))

output.icecast(%opus,fallible=false,host = "localhost", port = 8000,password = "hackme", mount = "stream.opus_main",foo_streamer)

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #17
You're right about the tags, they weren't ever working with Opus here either. Not with the built-in nor external encoder.

I have various tests streams. Maybe I had seen the ogg/vorbis one and got confused.

I've yet to try LiquidSoap on linux. Maybe "Ubuntu Bash for Windows 10" is an option.

Actually, IDK what I did but I retried again and the built-in encoder has working metadata when viewing the stream on foobar2000. I think I tested too quickly last time.

Still at a no go when using the external encoder options with opusenc.exe

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #18
Now to venture into unknown territory and cross-compile LS with Opus 1.2.1...that might take some effort.

What is your progress on this? I've tried myself and gave up. When I finally got all the dependencies, then I got an error which seems to indicated my version of ocaml is too old. But that's what ubuntu/debian have available. I would have had to go additional steps to update that.

Also I was seeing some errors (warnings?) about a mingw gcc compiler missing. And installed that apt package. But then I started getting errors as if my lame dev library was missing, which I already had covered before. That's when I gave up, cause I really don't know what I'm doing.

The External Encoder approach seems like a more feasible approach. Except for the song names not passing thru.

I can note two things:
1) song metadata on liquidsoap/icecast works with OTHER external encoders, I used qaac in my testing.
2) If you use the metadata options on opusenc.exe to hard code ONE artist/song combo, then It will show on liquidsoap/icecast. But of course it will never update when songs change.

Which leads me to believe that liquidsoap/icecast are in fact doing what they are supposed to and maybe opusenc.exe is missing some functionality?

Am I missing something on my opusenc.exe command line options? Or is this particualar metadata passthrough not supported?

One list thing. I did notice an option on liquidsoap called: restart_on_metadata (or restart_on_new_track, I think the documentation has an error). Anyway, that's supposed to restart the encoder each time, and hopefully I could use the metadata options on opusenc.exe to specify a new song each time. But I didn't find a way to pass those parameters without liquidsoap complaining. It either complained about quotes, or complained about something else.

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #19
Are you trying with linux or windows?

If you want windows version why don't you use the last compiled windows version?
https://sourceforge.net/projects/savonet/files/liquidsoap/1.1.1/liquidsoap-win32-1.1.1.zip/download

Opus metadata change works for me with internal with version 1.1.1.

Code: [Select]
playlist = mksafe(playlist("playlist.m3u"))

output.icecast(%opus,fallible=false,host = "localhost", port = 8000,password = "hackme", mount = "stream.opus",playlist)

If you want external , post your liq file , and whats complaining...

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #20
We are using windows. And we would like to benefit from the new improvements in Opus 1.2.1 (personally I'm looking at the music quality improvements at lower bit rates, like 32 kbps)

In any case, LS 1.1.1 is old, the latest win32 build of liquidsoap is 1.2.0 and it's on their github:
https://github.com/savonet/liquidsoap/releases/tag/1.2.0

I DO get tag support when using built-in encoder, but not with external. But I can tell the quality difference at 32kbps. If you look for differences in stereo separation and higher frequencies (full-band) you will find them right away.

Code: [Select]
output.icecast(
%opus( bitrate = 32, application = "audio", signal = "music", vbr = "constrained", complexity = 10, max_bandwidth = "full_band", stereo ),
host = ...,
mount = "32.opus",
s)

output.icecast(
%external(process = "\"C:\...\opus-tools-0.1.10-win64\opusenc.exe\" --quiet --cvbr --bitrate 32 - -", restart_on_metadata),
format = "audio/ogg",
icy_metadata = "guess",
host = ...,
mount = "external.opus",
s)

Code: [Select]
complexity = 10, max_bandwidth = "full_band", stereo

This was my attempt at matching the quality improvements of the external encoder. But I usually don't add those parameters (they should be defaults anyway?). I've also tried unconstrained vbr.

And as a test I tried the qaac encoder as an external encoder, and that passes tags just fine.

Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #21

In any case, LS 1.1.1 is old, the latest win32 build of liquidsoap is 1.2.0 and it's on their github:
https://github.com/savonet/liquidsoap/releases/tag/1.2.0


Thanks !   :-[
I didn't know they switched to github.

All I can do is confirm your observation that metadata is not passed with %external when using opusenc.exe or flac.exe.
Using the options --artist "blah" --title "blah" with the encoder will pass the metadata, only that liquidsoap doesn't allow variables in the encoder line , so no way to pass the artist , title using liquidsoap scripting .

Maybe you should create an issue on there github page.

I tried to pass the metadata with icy.update_metadata  using a script , but I found out that another bug with Icecast and opus.
Mountpoint will not accept URL updates
https://trac.xiph.org/ticket/2017



Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #22
Would you say this metadata not being passed, is a bug of opusenc.exe? (and flac.exe)

Or it belongs in the "feature request" category?


Re: Simple broadcast setup w/ foobar2000 & liquidsoap?

Reply #24
I had some luck getting the latest LiquidSoap 1.3.3 using this OCaml for Windows project:
https://fdopen.github.io/opam-repository-mingw/

But I've had a lot of problems, and still don't know how to solve some of them.

The one that is bothering me the most is that smart_crossfade and mksafe functions are not working. And I have no idea how to fix that.

And the 2nd problem on my list is getting fdkaac to work. Seems the cygwin base it uses doesn't support it, and thus opam can't get the dependencies. Seems I would again need to compile myself, and I always struggle with that.

Seems external encoders work, so I could use qaac, but it crashed when switching songs. So I have to figure that part out too.

The good news is that now I can use OPUS straight from liquidsoap without external encoders. And it seems to work find, and it handles all the song metadata like it is supposed to.