You are not logged in.
This is probably a noobish question...
My motherboard supports digital audio out via S/PDIF cable (optical), as well as standard analog audio. I have a stereo receiver that I've plugged my optical cable into.
When I go to systemsettings > Multimedia > Phonon > Audio Playback, I put the "HDA Intel S/PDIF Digital" device on top and clicked Test. I could hear the test tone (playback source is PCM).
However, if I go to play an MP3 or whatever, I have to go into the settings for each application and tell it to use that particular device. Some applications (such as Firefox) do not have obvious settings for audio playback. Is there a way to solve the problem once and for all (tell the audio system "send everything through the digital device all the time")?
(I read the relevant section of the wiki, but it is focused on getting sound out of your digital device, not making it the default.)
Any other advice or gotchas about using digital audio would also be appreciated.
Thanks!
Last edited by nathanb (2012-01-25 20:58:42)
Offline
In ALSA, you can redefine pcm.!default - see my ~/.asoundrc for example.
There is the issue of *when* a change takes effect - the app has to be restarted.
Offline
I took the monkey + typewriter approach and made it work, taking your suggestion.
For posterity:
pcm.Intel {
type hw
card Intel
}
ctl.Intel {
type hw
card Intel
}
pcm.dsp {
type plug
slave.pcm "dmix"
}
pcm.!default iec958:Intel
ctl.!default {
type hw;
card Intel;
}
defaults.pcm.rate_converter "samplerate_best"Offline
By the way, I created that entire file through the power of gross ignorance. I'm pretty sure most of it doesn't actually do anything useful.
Offline
Bah, I did a system update and rebooted and now digital out doesn't work at all!
[nathanb@nathanb-box ~] aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
front:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
Front speakers
surround40:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
HDA Intel, AD198x Digital
IEC958 (S/PDIF) Digital Audio OutputDevices don't seem to have changed...
[root@nathanb-box nathanb]# amixer | grep IEC -A 8
Simple mixer control 'IEC958',0
Capabilities: pvolume cvolume pswitch pswitch-joined cswitch cswitch-joined penum
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 39 Capture 0 - 31
Front Left: Playback 39 [100%] [0.00dB] [on] Capture 31 [100%] [12.00dB] [on]
Front Right: Playback 39 [100%] [0.00dB] [on] Capture 31 [100%] [12.00dB] [on]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Playback Source',0
Capabilities: enum
Items: 'PCM' 'ADC1' 'ADC2' 'ADC3'
Item0: 'PCM'Channels still seem to be there...
My .asoundrc looks the same as above. But just for fun, I also tried removing it and restarting alsa, with no change.
I'm testing output by going to systemsettings > Multimedia > Phonon and clicking the Test button with "HDA Intel (AD198x Digital)" selected. Nothing comes out through SPDIF, though it does play through analog (I have two separate pairs of headphones plugged in, one to the analog jack and one to a headphone amp plugged through the digital port) so I can tell which port the audio is coming from).
I've checked the hardware volume, and it appears to be in order. The amp is not reporting any audio signal on the optical port. I tried switching out the cable just to be paranoid, and still nothing. I believe this is a software problem.
Any ideas?
Offline
Also:
[nathanb@nathanb-box ~] speaker-test -c2 --device cards.pcm.iec958
speaker-test 1.0.24.2
Playback device is cards.pcm.iec958
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busyOffline
I updated again (and saw that Yet Another Kernel Upgrade was available), restarted, and sound was back again. I'm guessing it was a bug that got fixed.
Offline
Figured out what the problem actually was...(and no, as usual, Mysterious Kernel Bug wasn't the culprit).
I'm running a VM in Oracle VirtualBox. Apparently VB will grab the sound driver when a sound is played and then not release it, preventing anything else from accessing it. I solved the problem by disabling audio in VirtualBox for that VM (since I don't want the guest OS randomly deciding to play audio anyway).
I figured the problem out by reproducing it (unintentionally) then doing /etc/rc.d/alsa force-restart, which kills anything using alsa before restarting it. Lo and behold, my VM was forcibly terminated, and sound started working again.
I'll mark this thread as solved.
Offline
I would call that a bug in virtualbox, and suggest you use virtualbox's bugzilla to report it.
Offline