You are not logged in.
I recently bought a usb amp/dac, and I would like to easily switch between using my default speakers (onboard audio) and the usb amp/dac.
I'm using PulseAudio and found out that I can switch between sinks and move audio streams with the utility "pactl". However, I cannot move audio streams that are not playing (e.g. a paused YouTube clip), which results in that some applications use my onboard audio and some the usb amp/dac. Very annoying.
The odd thing is that when I tried changing the active soundcard in gnome control center, every application uses the new settings - regardless if the audio stream was active or not! What does the sound settings of gnome control center do to achieve this?
This is what I'm currently doing:
#!/bin/bash
[...parsing and stuff...]
pactl set-default-sink "$selected_sink_value"
[...some controls and volume adjustments...]
pactl list short sink-inputs | while read stream; do
stream_id=$(echo $stream | cut '-d ' -f1)
echo "Moving stream id $stream_id"
pactl move-sink-input "$stream_id" "$selected_sink_value"
doneLast edited by Grima (2013-11-17 19:12:07)
Offline
Pavucontrol gives the same functionality as the Gnome software. It is a DE agnostic solution as well.
Offline
Pavucontrol gives the same functionality as the Gnome software. It is a DE agnostic solution as well.
Oops! I forgot to add that I wish to use CLI application(s) to achieve this. I want to automate this; that's why I'm experimenting with pactl.
Offline
Finally found a solution to this problem a few days ago (by accident too!).
The reason why the sound settings of gnome-control-panel works is that it modifies PulseAudio's "stream-restore database". I don't know how one would do that by hand, but it sounds complex. Instead, I edited /etc/pulse/default.pa and added "restore_device=false" to the line loading "module-stream-restore". Now every single audio stream plays via the default sink, even if I use pactl.
Thought I might as well post a solution since there seems to be many people asking the same thing. Maybe this'll help someone?
Offline