tart
tart copied to clipboard
Pass in Microphone
Hi,
It seems it's not possible to pass through the microphone (or any audio input) to the VM (tried with sonoma-base only) The Audio Output seems to work fine.
Although #161 seems to point at the fact that it is indeed supported, am I doing something wrong ?
VMs should use whatever is set as output/input in your preferences on the host. Do you have the microphone selected there?
I see what you mean, but it doesn't seem to work for some reason, am on an M1 macbook air, here you can see the host config (you can see my voice being picked up by the mic):
And here sonoma-base's config using tart (no voice being picked up):
I just tried to reproduce and it seems I'm able both to record and output voice inside a VM. I'm using both Sonoma host and guest. Note that guest will always show "Built-in" input/output even though it's donna use what is specified on the host.
Mh, a few questions:
- Is there some kind of variable I can input to force an audio input to be used ?
- Is there a verbose mode so I can track and see if any error appears ?
- I use sonoma-base, does it have any influence here ?
- Host is using sonoma 14.1.1, any issue with that ?
BTW are you running a suspendable VM by any chance? Suspendable VMs don't support audio:
https://github.com/cirruslabs/tart/blob/1a3b862631fe576c62ad2adc023f7971b3f8605f/Sources/tart/VM.swift#L298-L306
Otherwise the default VZHostAudioInputStreamSource
and VZHostAudioOutputStreamSink
are used.
I run the regular tart run sonoma-base
cmd in zsh, also the sound output works fine
edit: updated to sonoma 14.4.1, still got the issue, so not related to that.
https://developer.apple.com/documentation/virtualization/audio says:
If your app can configure an audio input device, you must set an NSMicrophoneUsageDescription message in your app’s Info.plist. The system uses this description when asking the user’s permission to enable microphone access. If this message isn’t set or the key isn’t present, the system denies microphone access to your app.
So it seems that we need to ask for a permission first to make the microphone work.
Very interesting !
- Any way to do this manually ? So I can play with it until you release an update
- Why does it work for @fkorotkov ?
Or could it be that I need to give mic permission to the terminal ? Trying this asap
edit: it worked ! giving permissions to the terminal in settings :)
Although I don't think that's a good practice long term