Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 17597  / 3 Years ago, sun, july 11, 2021, 12:20:53

I like to switch the sound output from Speaker to USB headphone with a Shortcut.
Is there a way to accomplish this?


More From » sound

 Answers
7

  1. Check for port names pactl list sinks (I remove non needed sinks output):



    Sink #1
    State: RUNNING
    Name: alsa_output.pci-0000_00_1b.0.analog-stereo
    Description: Built-in Audio Analog Stereo
    Driver: module-alsa-card.c
    ...
    Ports:
    analog-output-speaker: Speakers (priority: 10000, not available)
    analog-output-headphones: Headphones (priority: 9000, available)
    Active Port: analog-output-headphones
    Formats:
    pcm

  2. Set sink port using pactl set-sink-port:



     pactl set-sink-port 1 analog-output-speaker


    or



     pactl set-sink-port 1 analog-output-headphones


    If you are using a removable device (Example: USB devices), it's better to use sink name instead of id. For example:



     pactl set-sink-port alsa_output.pci-0000_00_1b.0.analog-stereo analog-output-headphones



Reference: man pactl


[#37230] Monday, July 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
strhen

Total Points: 27
Total Questions: 111
Total Answers: 103

Location: Angola
Member since Tue, Apr 25, 2023
1 Year ago
strhen questions
Sun, Jun 6, 21, 04:57, 3 Years ago
Tue, Mar 1, 22, 12:44, 2 Years ago
Wed, Jul 21, 21, 14:38, 3 Years ago
;