Skip to content

Add negotiated microphone streaming support#1

Open
logabell wants to merge 3 commits intoClassicOldSong:masterfrom
logabell:codex/mic-common-c
Open

Add negotiated microphone streaming support#1
logabell wants to merge 3 commits intoClassicOldSong:masterfrom
logabell:codex/mic-common-c

Conversation

@logabell
Copy link
Copy Markdown

Summary

Ports the microphone transport changes from logabell/moonlight-common-c-mic into Artemis' moonlight-common-c base so Android clients can negotiate, encrypt, encode, and send microphone audio to Apollo-compatible hosts.

This is intended to pair with ClassicOldSong/Apollo#1428.

Changes

  • add STREAM_CONFIGURATION.enableMic
  • add ENCFLG_MICROPHONE
  • add LiSendMicrophoneOpusDataEx()
  • add LiIsMicrophoneStreamActive() and LiIsMicrophoneEncryptionEnabled()
  • add RTSP/SDP negotiation for microphone stream setup
  • enable host-requested microphone encryption
  • send timed microphone packets with in-band FEC
  • preserve Artemis-specific control stream additions while porting the microphone path

Source

Ported from these mic commits in my fork:

Working fork branch:

Validation

This branch is exercised by the companion Android client branch and test build:

extern uint32_t EncryptionFeaturesRequested;
extern uint32_t EncryptionFeaturesEnabled;

#define MIC_PACKET_MAGIC 0x12345678
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The magic is too generic
Please do not use AI to generate random numbers, they tend to fall in several fixed options.

EncryptionFeaturesEnabled = 0;

hostSupportsMic = strstr(response.payload, "a=rtpmap:96 opus/48000/1") != NULL ||
strstr(response.payload, "a=rtpmap:96 opus/48000/2") != NULL;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can user craft an input like this? Like from hostname configuration or something else?

@ClassicOldSong
Copy link
Copy Markdown
Owner

Hey, not sure if you have seen this, there's some review comments added, may you please take a look?

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.

2 participants