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

Improve multi-speaker and multi-mic support #3914

Closed
3hhh opened this Issue May 20, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@3hhh

3hhh commented May 20, 2018

Qubes OS version:

3.2, 4.x

Description

Currently the support for speakers and mic is limited to the pulseaudio default device.

Speakers

Toggling output devices and ports during runtime of an AppVM requires a user to do something like that:

function setR {
local card="$1"
local port="$2"

#Examples:
#example for card change:
#pacmd set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
#pacmd move-sink-input [input index id from pacmd list-sink-inputs] alsa_output.pci-0000_00_1b.0.analog-stereo
#
#example for port change:
#pacmd set-sink-port alsa_output.pci-0000_00_1b.0.analog-stereo analog-output-speaker

#set port first to make the transition smooth
pacmd set-sink-port "$card" "$port"
if [ $? -ne 0 ] ; then
	#some error (sometimes pulse gets confused) --> restart pulseaudio and try again
	killall pulseaudio
	sleep 3
	pacmd set-sink-port "$card" "$port"
fi

#make the new card the current default for future sources
pacmd set-default-sink "$card"

#move all current sources to the new default
pacmd list-sink-inputs | sed -r -n 's/^[ ]+index: ([0-9]+)$/\1/p' | while IFS= read -r sourceId ; do
	pacmd move-sink-input $sourceId "$card"
done
}

This is only suitable for power users. In particular I didn't find any Qubes-specific tool to simplify that.

Only setting the default will only change it for newly started VMs.

Microphones

The situation is identical here. In particular Qubes only supports forwarding the pulse default microphone to an AppVM via its GUI application. Other microphones are not displayed in the GUI.

General notes:

Maybe some Qubes application to control which sound input or output device incl. port is assigned to which VM would help here. Maybe it could even be integrated in the qubes-vm-settings similar to the Devices tab.

Related issues:

#2724

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek May 20, 2018

Member

See Pulseaudio Volume Control, by default accessible as "Audio Mixer" in volume control applet. If you have multiple cards, you can choose per-VM what card should be used. And in Input Devices / Output Devices you can choose a port.

Member

marmarek commented May 20, 2018

See Pulseaudio Volume Control, by default accessible as "Audio Mixer" in volume control applet. If you have multiple cards, you can choose per-VM what card should be used. And in Input Devices / Output Devices you can choose a port.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh May 20, 2018

I had seen that, but not noticed the buttons to switch sinks & sources... -_-

Thanks a lot Marek & sorry for bringing this up then - it's apparently invalid.

3hhh commented May 20, 2018

I had seen that, but not noticed the buttons to switch sinks & sources... -_-

Thanks a lot Marek & sorry for bringing this up then - it's apparently invalid.

@3hhh 3hhh closed this May 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment