tiiuae / ghaf

TII SSRC Secure Technologies: Ghaf Framework
https://tiiuae.github.io/ghaf/
Apache License 2.0
35 stars 56 forks source link

Audio Control Application #674

Open baz2142 opened 2 months ago

baz2142 commented 2 months ago

Description of changes

This PR adds the Ghaf Audio Control Appication to be able control AppVM's audio: speakers, microphones

This application uses Ghaf Audio Control library, which might be integrated in any bar, like Waybar or Ironbar, or into Ghaf Control Panel

Checklist for things done

Testing

humaidq-tii commented 2 months ago

Just heads up: https://github.com/tiiuae/ghaf/pull/639 I can incorporate this into ironbar too.

Mic92 commented 2 months ago

Just heads up: #639 I can incorporate this into ironbar too.

You would need to rewrite this into Rust than. Does ironbar supports external modules? It seems to support process substitution: https://github.com/JakeStanger/ironbar/blob/a9d728f1911007afa1edf6aac2ca1148b4c22d6c/examples/config.json#L136

humaidq-tii commented 2 months ago

Does ironbar supports external modules?

Yes, also supports volume module: https://github.com/JakeStanger/ironbar/wiki/volume I have not tested yet.

baz2142 commented 1 month ago

If we will include C++ code in this repo, should we also enable a C/C++ formatter with treefmt. It seems to support clang-format.

Makes sense, actually. I will prepare a clang-format file

milva-unikie commented 1 month ago

Audio control app is not opening on Lenovo-X1. Clicking the icon also causes the screen to go black about 15 seconds later.

leivos-unikie commented 1 month ago
baz2142 commented 1 month ago

If we will include C++ code in this repo, should we also enable a C/C++ formatter with treefmt. It seems to support clang-format.

@humaidq-tii, I have enabled Clang Format support for treefmt and have put a .clang-format in my project

baz2142 commented 1 month ago
  • Tested Audio Control app, launches, finds audio device, can control sound level and mute/unmute for integrated speakers/3.5mm headset. Control of microphone side is disabled for now (TBD?)
  • All apps launch from the icons
  • ci-test-automation passed and performance ok

@leivos-unikie, yeah, microphone will be enabled later in different PR

josa41 commented 3 weeks ago

Although this does (mostly) work do we really need to build the control app ourselves? I tested and most audio control apps do also work just fine. I found one that is done in Rust (Not saying this is the best or even any good): https://github.com/Aurailus/Myxer

humaidq-tii commented 3 weeks ago

Although this does (mostly) work do we really need to build the control app ourselves?

I would mostly say yes if we are going to use gRPC. For now if we want to use Myxer, we need to patch it so it connects to audio-vm rather than localhost. https://github.com/Aurailus/Myxer/blob/ea53586408350e00b58c09e30864b3ec316503fb/src/pulse.rs#L171C15-L171C19

This is the same kind of change I did when testing ironbar in #639 .

mbssrc commented 3 weeks ago

I would suggest to put this application into it's own repo in the TII space?

baz2142 commented 2 weeks ago

Although this does (mostly) work do we really need to build the control app ourselves? I tested and most audio control apps do also work just fine. I found one that is done in Rust (Not saying this is the best or even any good): https://github.com/Aurailus/Myxer

We can use a lot of apps, which supports PusleAudio and PipeWire, and they will work just fine for simple audio control. But here is "but": they are not adapted for Ghaf and not flexible:

I made the design of the app the way, that we can easily change protocol, UI and so on