add audio support, trying to manage MSD device

This commit is contained in:
Artem
2024-11-03 11:44:40 +01:00
parent 68ba48a3a2
commit 1b60f43df1
22 changed files with 1059 additions and 263 deletions

View File

@@ -4,6 +4,7 @@ import (
"io"
"os"
"os/exec"
"rkkvm/config"
"sync"
log "github.com/sirupsen/logrus"
@@ -25,7 +26,7 @@ type ExtProcess struct {
func Init(path string, args []string) *ExtProcess {
return &ExtProcess{
args: args,
path: path,
path: config.RootFS + path,
}
}
@@ -41,7 +42,7 @@ func (u *ExtProcess) Start() {
u.stopChan = make(chan struct{})
u.finished = make(chan struct{})
log.Debug("Starting external process...")
log.Debugf("Starting external process: %s %v", u.path, u.args)
u.cmd = exec.Command(u.path, u.args...)
u.cmd.Stdout = os.Stdout
u.cmd.Stderr = os.Stderr
@@ -99,8 +100,6 @@ func (u *ExtProcess) Stop() {
log.Errorf("Failed to close stdin: %v", err)
}
log.Info("waiting for finish")
select {
case <-u.finished:
log.Info("stopped as expected")