Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: [Solved][Pulse] Switch audio output by script

  1. #11
    Join Date
    Jun 2007
    Beans
    14,788

    Re: [Solved][Pulse] Switch audio output by script

    Hmm. Maybe there's something at the driver level controlling that. Can you give alsainfo? https://wiki.ubuntu.com/Audio/AlsaInfo

  2. #12
    Join Date
    May 2012
    Beans
    57

    Re: [Solved][Pulse] Switch audio output by script


  3. #13
    Join Date
    Jun 2007
    Beans
    14,788

    Re: [Solved][Pulse] Switch audio output by script

    Does this command turn off the Digital Output?
    Code:
    amixer set 'IEC958 Output',0 'Playback' 'off'
    If so, you could incorporate it into the script
    Code:
    #!/bin/sh
    
    analog="`pactl list cards | grep attivo | grep analog`"
    if [ "$analog" ]
    then
     pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:iec958-stereo
     amixer set 'IEC958 Output',0 'Playback' 'on'
    else
     pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo
     amixer set 'IEC958 Output',0 'Playback' 'off'
    fi

  4. #14
    Join Date
    May 2012
    Beans
    57

    Re: [Solved][Pulse] Switch audio output by script

    Many thanks.
    For the whole month of August I'll be outdoors so I'm going to check on September.
    Good holidays

  5. #15
    Join Date
    May 2012
    Beans
    57

    Re: [Solved][Pulse] Switch audio output by script

    It worked like a charm. Thanks for everything. I felt one more time Ubuntu community is still the best!

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •