millicast / millicast-player-unreal-engine-plugin

Millicast Player plugin for Unreal Engine
Other
19 stars 15 forks source link

Millicast audio doesn't work on Ubuntu #74

Closed Koous61 closed 11 months ago

Koous61 commented 11 months ago

This solution works fine on Windows 10/11, we use OBS to stream audio to Millicast, but it doesn't work on Ubuntu 22.04.

Below is a code listing of how we add audio.

void AXXXStreamPanel::MillicastAddAudioTrack(UXXXAudioTrack* AudioTrack)
{
    if (IsValid(AudioTrack) && IsValid(XXXAudioActor))
    {
        AudioTrack->AddConsumer(MillicastAudioActor);
        CurrentAudioTrack = AudioTrack;
    }
    else
    {
        XXX_LOG(XXX)
    }
}

This is our log from Ubuntu 22.04

LogMillicastPlayer: Cluster Id : ams-1
LogMillicastPlayer: Verbose: Signaling state change: kStable
LogMillicastPlayer: Verbose: StartPlayout
LogMillicastPlayer: Verbose: OnTrack
LogMillicastPlayer: OnAudioTrack
LogMillicastPlayer: Verbose: OnTrack
LogMillicastPlayer: OnVideoTrack
LogMillicastPlayer: Set remote description suceeded
LogMillicastPlayer: Verbose: Create audio track object
LogMillicastPlayer: Verbose: Initialize
LogMillicastPlayer: Verbose: AddConsumer
LogMillicastPlayer: Warning: Could not add audio consumer. Object was null
LogMillicastPlayer: Verbose: Create video track object
LogMillicastPlayer: Verbose: Initialize
LogMillicastPlayer: Verbose: AddConsumer

The most interesting thing is here: LogMillicastPlayer: Warning: Could not add audio consumer. Object was null

There was an assumption that some libraries were missing, we tried to use libraries from the latest release, but this did not give any results. https://github.com/millicast/millicast-player-unreal-engine-plugin/releases/tag/1.7.0-millicast-webrtc

Our version of Millicast plugin: "VersionName": "1.7.0",

It was tested on a VM, as well as on native Ubuntu, and I couldn't get sound anywhere.

dbaldassi commented 11 months ago

the API change a bit Now, you can either call RegisterAudioComponent to register an AudioComponent you can create in your blueprint or cpp. Or you can still use the old way and add a consumer on the OnAudioTrack event, but you can't pass a MillicastAudioActor anymore, you need to use a MillicastAudioInstance in which you can set the AudioComponent of the millicats audio actor by calling InjectDependency . The thing is, InjectDependency was not callable from the blueprint, I just made a change to fix it