Connect USB Mic to Home Assistant OS

Hi there, I’m quite new to HA and trying to build some neat Smart Home possibilites for my small flat. Currently I’m trying to get rhasspy up and running.
For this I need a microphone. So I purchased a cheap USB mic to do the trick, before I’m willing to invest more money on a better one.

I’m using Home Assistant OS inside a Proxmox VM, running on a NUC. Problem is, that if I pass thorugh the USB mic to HassOS the VM instantly dies. This is no HassOS issue, it is a Proxmox (kvm) issue. I got around this by using USB-Redirect (USB Redirector for Linux - USB over IP - USB over Network - Incentives Pro). At least for other VMs apart from Home Assistant OS, as there’s no way to deploy the USB-Redirect client onto HassOS through the bash.

My question is how to proceed next:

  • Is there an existing Addon, which I just was to stupid to find with the search?
  • Should I write a new Addon?
  • Should I ditch USB-Redirect, because there is a better solution to my problem?
  • Should I run Rhasspy in an own Container/VM?

Thanks for your help!

Greetings,
Cluster

Let me explain my setup: Im using Manjaro Linux on my old Hardware (Intel Core I5-8000 with 16GB RAM) running home assistant supervised install. Rhasspy runs as a docker container, not as Home Assistant addon. At the Host OS, i use pulseaudio and ledfx (a software to stream audio reactive lightshows to WLED devices) with my USB mics. I load pulseaudio modules module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1 and module-native-protocol-tcp port = 34567 auth-ip-acl=172.17.0.2. The latter module opens a tcp socket over the port 34567 for the ip of my rhasspy docker container, which has the EV PULSE_SERVER = 192.168.2.34:34567 which is the IP of my server and the port from the loaded module. Also the folders /home/tenn0/.config/rhasspy/profiles, /home/tenn0/.config/pulse/cookie, /run/user/$uid/pulse and /run/user/1000/pulse/native are bound to /profiles, /root/.config/pulse/cookie, /run/user/$uid/pulse and /run/user/1000/pulse/native repectively. Then using pavucontrol i can set the right microphone to the application like the big mic for rhasspy and the tiny one for ledfx or both applications on one mic.

I dont know if proxmox has pulseaudio or any other sound support at host level to apply a solution like i have. Writing an own addon with usb-redirector and rhasspy would be also a possible way. But all these solutions are just workarounds, a proper way would fix the usb passthrough on proxmox.

Hi tenn0,

thanks for your very detailed description of your system. What you are doing sounds very exciting to me, as you are using ledfx, which I had in mind to maybe replace my Hue Entertainment in the future. But I guess that part is not that unrealistic ones I got Rhasspy running (there should be a ledfx addon already for HassOS).
Unfortunately Proxmox seems not to support pulseaudio. Regarding your proposed path to fix the usb passthrough on Proxmox seems a bit too challanging for me, as I saw issues to this topic as early as 2012.

I’ll look into writing an addon, if it is not too time consuming. :wink:

Docker seems not to be happy if a USB device pops up inside a container, which is needed by another container. At least I’m not good enough with Docker to make this magic happen :frowning:

I finally solved the problem by passing through the whole PCI interface (USB Controller) via IOMMU to my Home Assistent OS Guest VM.

Unfortunately the microphone’s volume level is way too low.