Control between Optical Audio output (TOSLink) and Analog Audio output

Asked by Wesley Michael

I am running Unbuntu 12.04.3 with Cinnamon 2.0.14.

My system mother board has an audio optical output (TOSLink) as well as the standard analog stereo output.

I would like to know if it is possible to direct some audio output to the digital optical output and the rest to the analog output.

What I have in mind is to be able to send the audio from Rhythmbox to the digital optical output which will go to my receiver and have all the rest of the system sounds go out to the analog stereo output which is connected to the speakers on the monitor. When I am working on the system I want to hear my music coming out of my good stereo and not the crappy speakers on the monitor. But, when an e-mail arrives, I don't want to get that sound sent to the stereo -- it can just go to the crappy speakers on the monitor.

I have tried using pavucontrol, and I can sort of get there. On the Configuration tab I can select "Digital Stereo (IEC958) Output" for the Built-in Audio, but then all the audio goes to the optical output and nothing to the analog output.

The cinnamon settings have a sound control and on that it shows both the Built-in Digital Output (S/PDIF) and Analog Output, so I know that it must be possible to distinguish between the two.

Thanks for any and all help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Wesley Michael
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

wget -O alsa-info.sh http://www.alsa-project.org/alsa-info.sh && chmod +x ./alsa-info.sh && ./alsa-info.sh --upload

Thanks

Revision history for this message
Wesley Michael (wam-zoominternet) said :
#2

wam@matrix:~$ alsa-info.sh --upload
Uploading information to www.alsa-project.org ... Done!

Your ALSA information is located at http://www.alsa-project.org/db/?f=9829cb82f1ce2e16f08d98820fbd1b7c0e4a5a25

Please inform the person helping you.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

execute this command and reboot:

sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install pavucontrol linux-sound-base alsa-base alsa-utils lightdm ubuntu-desktop linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils lightdm ubuntu-desktop linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; ubuntu-support-status; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`

Revision history for this message
Wesley Michael (wam-zoominternet) said :
#4

I ran those commands and rebooted. I don't see anything different. What should I be looking for?

Revision history for this message
Daniel Letzeisen (dtl131) said :
#5

You would just set whatever application you want to output to the desired output. For a music player like Audacious, this is relatively easy.

For Rhythmbox, you probably have to dig through gconf-editor (look at /system/gstreamer defaults) and I'm not even sure you can change just Rhythmbox to output to a different device. The best you may be able to do is set all gstreamer apps to use the digital sound, which may be okay if rbox is the only gstreamer app you use.

You can thank the Gnome devs for ripping out or hiding every option possible.

Revision history for this message
Wesley Michael (wam-zoominternet) said :
#6

Thanks for your response. I am sorry to be obtuse, but I am not following your answer.

The problem that I wanted to solve was to be able to distinguish between the Built-in Audio Digital Stereo (IEC958) Output and the Analog Stereo Output. Using the Digital Stereo Output for music and the Analog Stereo Output for everything else. I am not sure, based on the changes that I made, how I am to accomplish this.

When I look at the pavucontrol it doesn't look any different. I went through gconf-editor, but I don't see in there where I can make any audio settings.

I understand that it may not be possible, I was just hoping.

Revision history for this message
Daniel Letzeisen (dtl131) said :
#7

"When I look at the pavucontrol it doesn't look any different."
It's not supposed to look any different.

You would run gconf-editor and look at system/gstreamer/0.10/default/musicaudiosink
It should be pointing to "autoaudiosink" by default. What you would do is change it to "pulsesink device=<name>" where name is the name given to the sink by pulseaudio. To find that out, run:
pactl list sinks and look at Name field.

Revision history for this message
Wesley Michael (wam-zoominternet) said :
#8

Thanks again for taking the time. I am guessing now that it isn't possible to split between the built in digital and the built in analog unless there is a way of loading the sink for both outputs.

There are only two sinks listed in the output of the pactl command. If I have the pavucontrol configuration set to "Analog Stereo Output" the two sinks are:

matrix$ pactl list sinks | grep Name
 Name: alsa_output.pci-0000_01_00.1.hdmi-surround
 Name: alsa_output.pci-0000_00_14.2.analog-stereo

If I change the pavucontrol configuration to "Digital Stereo (IEC958) Output" I have these two sinks:

matrix$ pactl list sinks | grep Name
 Name: alsa_output.pci-0000_01_00.1.hdmi-surround
 Name: alsa_output.pci-0000_00_14.2.iec958-stereo

Is there a way of loading the alsa_output.pci-0000_00_14.2.analog-stereo and alsa_output.pci-0000_00_14.2.iec958-stereo sinks?

Revision history for this message
Wesley Michael (wam-zoominternet) said :
#9

I think I may have found it.

I ran the aplay -l command to get the list hardware devices:

matrix$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC889 Analog [ALC889 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC889 Digital [ALC889 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I then added this line to the end of the /etc/pluse/default.pa file:

load-module module-alsa-sink device=hw:0,1

After restarting pluseaudio, I now see these three sinks:

matrix$ pactl list sinks | grep Name
 Name: alsa_output.pci-0000_01_00.1.hdmi-surround
 Name: alsa_output.pci-0000_00_14.2.analog-stereo
 Name: alsa_output.hw_0_1