Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just installed my first linux distro (SUSE 10) and the soundcard seemed to install with no problems. I have it attracted through optical cable (digital) to my Logitech 5.1 speakers. The speakers say "No Digital Data" so I assume that somewhere I have to tell Linux to output digitally instead of through analog signals. Does SUSE even support that?
I have the same setup running, SusE does support this function, actually it is ALSA that provides the support so if you are running ALSA it should work in any distribution. There are a few obstacles that you have to be aware of:
1. The digital out is treated as a separate HW device, so you need to setup a corresponding device for ALSA. (in /etc/asound.conf). This is actually quite convenient since you can listen to music through SPDIF while talking on the phone (like Skype)using your analog HW. I don't have the sample config file on hand since I am in the office right now. If you need it let me know I will post it later today.
2. I suggest to test the output using aplay. you can specify the ALSA device directly. "aplay -D dmix-digital file.wav"
3. Most likely you will hear no sound, even if the aplay command launched successfully, because i found one very strange behavior: Whenever a new application starts using the Digital Output the IEC958 switch in the mixer will get enabled, which in return will mute the sound. So you need to use alsamixer to to set this switch to mute. Alsamixer is the most reliable way of doing it during testing. KMIX seems to be buggy in this regard and does not reflect the status correctly, but once you have everything running well you can use KMIX as well. (this behavior maybe fixable with the ALSA hook plugin, though I never had enough spirit to test it)
If you want to Route all your output to SPDIF you need to make the digital device the default device for ALSA. There are a few applications, which do not support ALSA natively where a struggle to get the output routed to SPDIF, although it must be possible somehow. The Flash Plugin Sound for example I think I have managed once but could never reproduce. If someone has an idea how to do that, I would appreciate the help.
Cheers X
I use a build in sound card Nforce 2.
Here my /etc/asound.conf
# Override the default output used by ALSA.
# If you do not override the default, your default
# device is identical to the (unmixed) analog device
# shown below. If you prefer mixed and/or digital
# output, uncomment the appropriate four lines below
# (only one slave.pcm line).
pcm.!default {
type plug
## Uncomment the following to use mixed analog by default
#slave.pcm "dmix-analog"
## Uncomment the following to use unmixed digital by default
# slave.pcm "digital-hw"
## Uncomment the following to use mixed digital by default
slave.pcm "dmix-digital"
}
# Alias for analog output on the nForce2 (hw:0,0)
# - This is identical to the device named "default"--which
# always exists and refers to hw:0,0 (unless overridden)
# - Therefore, we can specify "hw:0,0", "default", or "analog"
# to access analog output on the nForce2
pcm.analog {
type plug
slave.pcm "analog-hw"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.analog {
type hw
card 0
}
# Alias for (rate-converted) mixed analog output on the
# nForce2 (hw:0,0)
# - This will accept audio input--regardless of rate--and
# convert to the rate required for the dmix plugin
# (in this case 48000Hz)
pcm.mixed-analog {
type plug
slave.pcm "dmix-analog"
}
#test fuer aoss skype scheint auch so zu helfen.
pcm.dsp0 {
type plug
slave.pcm "dmix-analog"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.mixed-analog {
type hw
card 0
}
# Alias for analog output on the BT headset (hw:1,0)
pcm.headset {
type plug
slave.pcm "headset-hw"
}
# Control device (mixer, etc.) for the BT headset
ctl.headset {
type hw
card 1
}
# Alias for (rate-converted) mixed analog output on the
# headset (hw:1,0)
pcm.mixed-headset {
type plug
slave.pcm "dmix-headset"
}
# Alias for (rate-converted) digital (S/PDIF) output on the
# nForce2 (hw:0,2)
# - This will accept audio input--regardless of rate--and
# convert to the rate required for the S/PDIF hardware
# (in this case 48000Hz)
pcm.digital {
type plug
slave.pcm "digital-hw"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.digital {
type hw
card 0
}
# Alias for mixed (rate-converted) digital (S/PDIF) output on the
# nForce2 (hw:0,2)
# - This will accept audio input--regardless of rate--and
# convert to the rate required for the S/PDIF hardware
# (in this case 48000Hz)
pcm.mixed-digital {
type plug
slave.pcm "dmix-digital"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.mixed-digital {
type hw
card 0
}
# The following devices are not useful by themselves. They
# require specific rates, channels, and formats. Therefore,
# you probably do not want to use them directly. Instead use
# of of the devices defined above.
# Alias for analog output on the nForce2 (hw:0,0)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.analog-hw {
type hw
card 0
# The default value for device is 0, so no need to specify
}
# Control device (mixer, etc.) for the nForce2 card
ctl.analog-hw {
type hw
card 0
}
# Alias for digital (S/PDIF) output on the nForce2 (hw:0,2)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.digital-hw {
type hw
card 0
device 2
}
# Control device (mixer, etc.) for the nForce2 card
ctl.digital-hw {
type hw
card 0
}
# Alias for analog output on the BT Headset (hw:1,0)
pcm.headset-hw {
type hw
card 1
device 0
}
# Control device (mixer, etc.) for the BT Headset
ctl.headset-hw {
type hw
card 1
}
# Direct software mixing plugin for analog output on
# the BT headset (hw:1,0)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.dmix-headset {
type dmix
ipc_key 2234
slave {
pcm "headset-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
# Direct software mixing plugin for analog output on
# the nForce2 (hw:0,0)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.dmix-analog {
type dmix
ipc_key 1234
slave {
pcm "analog-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
# Control device (mixer, etc.) for the nForce2 card
ctl.dmix-analog {
type hw
card 0
}
# Control device (mixer, etc.) for the BT headset
ctl.dmix-headset {
type hw
card 0
}
# Direct software mixing plugin for digital (S/PDIF) output
# on the nForce2 (hw:0,2)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.dmix-digital {
type dmix
ipc_key 1235
slave {
pcm "digital-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
# Control device (mixer, etc.) for the nForce2 card
ctl.dmix-digital {
type hw
card 0
}
I have an ASUS A7N8X Deluxe motherboard with the SoundStorm on-board sound. I am using SUSE 10.1. Since the nVIDIA driver does not work with the current kernel I am trying to get digital sound back out of my computer. I block copied your /etc/asound.conf file into my own. However, when I tried aplay here is what I got:
# ALSA portion
alias snd-card-0 snd-intel8x0
options snd-intel8x0 ac97_clock=47470
# OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
One last question. Are you using a .asoundrc file in your /home/<user> directory? If so what is in it? Thanks for your help!
I recently upgraded to 10.1 (installed from scratch due to HD crash) as well but the setup remained the same.
I copied the old /etc/asound.conf onto the new system and all run well the
/etc/modprobe.d/sound was created by yast using autodetect and setup. No manual tweaking.
Here its is:
options snd-intel8x0 enable=1 index=0
# H0_h.P9eEQRV1gX9:nForce2 AC97 Audio Controler (MCP)
alias snd-card-0 snd-intel8x0
I don't use a local .asoundrc, because I have no reason for user specific settings.
Reagarding your failure with aplay I need to guess a little, but output looks like the alsa driver has problems to access the HW. Could this be because you load other sound drivers ? From your /etc/modprobe.d/sound it looks like you are using oss drivers or emulation as well. That maybe be a conflict but I have no real expereince with this.
Have you tried aplay -D mixed analog file.wav? Just to see if at least your analog output works.
I like to provide more help, right now I don't know where to look further. If you provide some more details I will check what I can find for you.
Until Then
Cheers X (Ulf)
Additional Updates
aplay -D mixed-digital file.wav is the correct way to use since it takes also care of rate conversion.
BTW I stripped the /etc/asound.conf to minimal config. (I don't use BT Headset) Furthermore since I discovered some issue with my analog output I needed to change the ipc_key for dmix-analog. I lack the understanding why! The key seemed unique to me.
Here is the new version.
# Override the default output used by ALSA.
# If you do not override the default, your default
# device is identical to the (unmixed) analog device
# shown below. If you prefer mixed and/or digital
# output, uncomment the appropriate four lines below
# (only one slave.pcm line).
pcm.!default {
type plug
## Uncomment the following to use mixed analog by default
#slave.pcm "dmix-analog"
## Uncomment the following to use unmixed digital by default
# slave.pcm "digital-hw"
## Uncomment the following to use mixed digital by default
slave.pcm "dmix-digital"
}
# Alias for analog output on the nForce2 (hw:0,0)
# - This is identical to the device named "default"--which
# always exists and refers to hw:0,0 (unless overridden)
# - Therefore, we can specify "hw:0,0", "default", or "analog"
# to access analog output on the nForce2
pcm.analog {
type plug
slave.pcm "analog-hw"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.analog {
type hw
card 0
}
# Alias for (rate-converted) mixed analog output on the
# nForce2 (hw:0,0)
# - This will accept audio input--regardless of rate--and
# convert to the rate required for the dmix plugin
# (in this case 48000Hz)
pcm.mixed-analog {
type plug
slave.pcm "dmix-analog"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.mixed-analog {
type hw
card 0
}
# Alias for (rate-converted) digital (S/PDIF) output on the
# nForce2 (hw:0,2)
# - This will accept audio input--regardless of rate--and
# convert to the rate required for the S/PDIF hardware
# (in this case 48000Hz)
pcm.digital {
type plug
slave.pcm "digital-hw"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.digital {
type hw
card 0
}
# Alias for mixed (rate-converted) digital (S/PDIF) output on the
# nForce2 (hw:0,2)
# - This will accept audio input--regardless of rate--and
# convert to the rate required for the S/PDIF hardware
# (in this case 48000Hz)
pcm.mixed-digital {
type plug
slave.pcm "dmix-digital"
}
# Control device (mixer, etc.) for the nForce2 card
ctl.mixed-digital {
type hw
card 0
}
# The following devices are not useful by themselves. They
# require specific rates, channels, and formats. Therefore,
# you probably do not want to use them directly. Instead use
# of of the devices defined above.
# Alias for analog output on the nForce2 (hw:0,0)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.analog-hw {
type hw
card 0
# The default value for device is 0, so no need to specify
}
# Control device (mixer, etc.) for the nForce2 card
ctl.analog-hw {
type hw
card 0
}
# Alias for digital (S/PDIF) output on the nForce2 (hw:0,2)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.digital-hw {
type hw
card 0
device 2
}
# Control device (mixer, etc.) for the nForce2 card
ctl.digital-hw {
type hw
card 0
}
# Direct software mixing plugin for analog output on
# the nForce2 (hw:0,0)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.dmix-analog {
type dmix
ipc_key 1634
slave {
pcm "analog-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
# Control device (mixer, etc.) for the nForce2 card
ctl.dmix-analog {
type hw
card 0
}
# Direct software mixing plugin for digital (S/PDIF) output
# on the nForce2 (hw:0,2)
# Do not use this directly--it requires specific rate,
# channels, and format
pcm.dmix-digital {
type dmix
ipc_key 1235
slave {
pcm "digital-hw"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
# Control device (mixer, etc.) for the nForce2 card
ctl.dmix-digital {
type hw
card 0
}
It is almost exactly like yours. The only difference is on the "Subdevices: 1/1" line under "device 2". Yours says "Subdevices: 0/1" not "1/1" like mine.
Once more the output is almost identical to yours, minus the differences in motherboard manufacturers.
I tried the aplay command again and here is the output:
first the digital:
ASUS-A7N8X-Deluxe:/home/cjspinelli # aplay -D dmix-digital makinguphistory.wav
aplay: test_wavefile:731: can't play not PCM-coded WAVE-files
then the analog:
ASUS-A7N8X-Deluxe:/home/cjspinelli # aplay -D dmix-analog makinguphistory.wav
aplay: test_wavefile:731: can't play not PCM-coded WAVE-files
By the way I played the makinguphistory.wav file in XMMS and it sounded great. On another note, I wanted to let you know that I am getting some sound out of my system. I hear the boot-up sound and shut-down sound. Also, the error sounds during normal operations are coming through fine. I fact I can even get sound out of Xine when I play DVDs but it is stereo, NOT digital. I am trying to get the digital part to work. I wanted to make sure you knew where I was at in this process.
It sounded great! However, when I tried the "mixed-analog" version, aplay said it was playing but no sound came out of the speakers. Also, it says "Stereo", but I want "S/PDIF" output. Is there a way to get the S/PDIF?
One last note, I tried Xine again with a DVD (Pirates of the Caribbean) and still only get the Stereo output. Thanks for all of your help, I hope to get digital output from this motherboard again in Linux sometime soon!
Chris
Last edited by cjspinelli; 08-24-2006 at 11:27 PM.
I am a little confuised now.
>
>
>Ok I tried I different .wav file and it worked!
>
>ASUS-A7N8X-Deluxe:/home/cjspinelli # aplay -D mixed-digital CRICKET.WAV
>Playing WAVE 'CRICKET.WAV' : Unsigned 8 bit, Rate 11025 Hz, Stereo
If this works as you say, than you are alomost there. The reason why it says stereo is because aplay plays only stereo.
But can you confrim that you can hear sound using the the digital output (optical SPDIF) by this method.
If so we can work out how to setup xine to play 5.1 sound.
X,
My computer is connected to a Cambridge SoundWorks DTT3500 decoder via a coaxial cable, not an optical cable. Do I need to use an optical cable? The digital output has worked before without an optical cable.
When the Cambridge hardware detects a digital signal a little green light comes on at the bottom of the unit. Although I am hearing sound out of the speakers (the front left and front right, nothing out of the center or rear speakers), the light does not illuminate. I want the computer to send a digital signal that the Cambridge hardware will decode, (i.e, "passthrough"). This might not be possible, which is fine, because the Cambridge hardware will also take an already decoded signal and play it as well.
I do not have any anything connected to the analog outputs on the back of the computer, that is why I do not hear any sound why I try to use "mixed-analog". Bottom line: I am getting sound out through the digital channel (i.e., coxial cable), I just can not seem to get 5.1 sound, only stereo. Let me know if you have more questions.
That explains why your aplay -l shows additinalo subdevices. I don't have a coaxial jack, so no such subdevice. I use optical only.
Reagrding the passthrough. I need to double check, Whenenver I want to use passthrough I use mplayer.
It is too late today for me to check this out and document. I post it soon. Regarding xine and passthrough I need to research myself, I don't think I had this working.
Thanks for the help! Do you think I should get an optical cable? I will get one anyway, just for testing purposes. I am leaving tomorrow morning early, and will not be back until late Thursday evening, so you won't hear from me until then. Thanks again!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.