Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware concurrency #98

Closed
TheMasterRoot opened this issue Aug 10, 2020 · 3 comments
Closed

Hardware concurrency #98

TheMasterRoot opened this issue Aug 10, 2020 · 3 comments

Comments

@TheMasterRoot
Copy link

id like to use the rhasspy at same time tha im using a softphone to make voice commands and call a api that will control the call in the asterisk.
but when rhasspy is running i cant use the sound or microfone in my computer.
how to solve it ?

@synesthesiam
Copy link
Contributor

The Docker image uses ALSA and /dev/snd directly, which will block other applications unfortunately. PulseAudio is the solution to this, but I haven't been able to use it inside Docker without hard-coding a UID.

One way around this is to use GStreamer for audio input instead. You can then stream the audio in from outside the container using gst-launch-1.0 which will use PulseAudio properly when you select autoaudiosrc like the example in docs.

@ash-vd
Copy link

ash-vd commented Aug 14, 2020

I created 2 virtual devices, 1 for Rhasspy and 1 for Snapcast in /etc/asound.conf. I then passed the config to the docker using docker-compose.yaml. In Rhasspy you can select your Rhasspy device as the playing device (using aplay).

rhasspy:
    image: rhasspy/rhasspy:latest
    volumes:
      - ./rhasspy/profiles:/profiles
      - /etc/asound.conf:/etc/asound.conf
    devices:
      - /dev/snd:/dev/snd
    ports:
      - "12101:12101"
    ipc: host
    command: --profile nl --user-profiles /profiles
pcm.mix {
    type dmix
    ipc_key 55555
    ipc_perm 0666
    slave {
        pcm "hw:1,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 48000
        format S24_3LE
    }
    bindings {
        0 0
        1 1
    }
}


pcm.snapcast {
    type plug
    slave.pcm "snapcast_vol"
}


pcm.snapcast_vol {
    type softvol
    slave.pcm "mix"
    control {
        name "Snapcast"
        card 0
    }
}


pcm.rhasspy {
    type plug
    slave.pcm "rhasspy_vol"
}


pcm.rhasspy_vol {
    type softvol
    slave.pcm "mix"
    control {
        name "Rhasspy"
        card 0
    }
}

@TheMasterRoot
Copy link
Author

TheMasterRoot commented Aug 14, 2020 via email

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

No branches or pull requests

3 participants