Difference between revisions of "Enabling nForce4 optical SPDIF output"

From MythTV Official Wiki
Jump to: navigation, search
m (Template:Code_box, TOCright)
(Edited some steps to reflect what I had to do on my system; improved readability)
Line 6: Line 6:
 
The default values set by the alsa driver do not enable the optical output, and it is not possible to enable it using the alsamixer.
 
The default values set by the alsa driver do not enable the optical output, and it is not possible to enable it using the alsamixer.
  
A solution was found by changing the /etc/asound.state file directly.
+
A solution was found by changing the <code>/etc/asound.state</code> file directly.
  
 
'''Short howto:'''
 
'''Short howto:'''
  
# save the asound.state file below as "/etc/asound.state"
+
# Close mythfrontend if it is running.
# Enter the command "alsactl restore"<br>
+
# Save the asound.state file below as <code>/etc/asound.state</code>
::Due to differences in the alsa driver and the support circuits you might experience error messages of the following kind:<br>
+
# Enter the command <code>alsactl -f /etc/asound.state restore</code>. See "Troubleshooting" below if this command returns any errors.
:::alsactl: set_control:894: warning: name mismatch (Mic Boost (+20dB)/Mic Boost (+20dB) Capture Switch) for control #17<br>
+
# Once the <code>alsactl</code> command can be run without error, start mythfrontend. Go to '''Utilities/Setup -> Setup -> General''' and for '''Audio output device''' put '''ALSA:digital'''. However, if the next step doesn't work, you may need to enter '''ALSA:default''' instead.
:::alsactl: set_control:896: warning: index mismatch (0/0) for control #17<br>
+
# Test both surround sound output and stereo output. Try watching a standard definition or analogue TV channel (for a stereo test) and a DVD with Dolby and/or DTS surround sound (for a surround sound test).
:::alsactl: set_control:898: failed to obtain info for control #17 (Operation not permitted)
+
 
::This means that on your hardware, the name of control #17 is not "Mic Boost (+20dB)" but instead "Mic Boost (+20dB) Capture Switch".
+
== Troubleshooting ==
::To fix this problem, edit the /etc/asound.state file and change the name of control to the correct name.
+
Due to differences in the ALSA driver and the support circuits you might experience error messages of the following kind:<br>
:3. Fix any problems in the asound.state file as described above.<br>
+
<pre>
:4. Test your setup by playing an audio file while using the optical output. The optical output should now be able to output regular stereo and surround depending on your audio source.
+
alsactl: set_control:894: warning: name mismatch (Mic Boost (+20dB)/Mic Boost (+20dB) Capture Switch) for control #17
 +
alsactl: set_control:896: warning: index mismatch (0/0) for control #17
 +
alsactl: set_control:898: failed to obtain info for control #17 (Operation not permitted)
 +
</pre>
 +
 
 +
This means that on your hardware, the name of control #17 is not "Mic Boost (+20dB)" but instead "Mic Boost (+20dB) Capture Switch". To fix this problem, edit the <code>/etc/asound.state</code> file and change the name of control to the correct name.
 +
 
 +
You may also receive an error of the form
 +
 
 +
<pre>alsactl: set_control:1273: failed to obtain info for control #17 (No such file or directory)</pre>
 +
 
 +
This is less helpful, as you will need to find the correct name for the control using a program such as <code>alsamixer</code>, which should hopefully be quite simple to figure out.
 +
 
 +
The last error you may receive is
 +
<pre>No state is present for card CX8811</pre>
 +
 
 +
This refers to another sound card or sound hardware on a TV tuner card in the system. If you're not using that card for your sound output (and if you are, then this page is of no use to you!), then this message can be safely ignored.
  
 
== /etc/asound.state File ==
 
== /etc/asound.state File ==
 
 
Save the following file as '''/etc/asound.state'''
 
Save the following file as '''/etc/asound.state'''
 
{{Code box|/etc/asound.state|
 
{{Code box|/etc/asound.state|
Line 409: Line 424:
 
</nowiki></pre>
 
</nowiki></pre>
 
}}
 
}}
 
== MythTV Setup ==
 
 
Now, once the file is saved start/restart mythfrontend.
 
 
Go to '''Utilities/Setup -> Setup -> General''' and for '''Audio output device''' put '''ALSA:digital'''.
 
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]
 
[[Category:asoundrc]]
 
[[Category:asoundrc]]

Revision as of 15:47, 4 December 2008

Background

Many users with Nvidia4 based motherboards have problems enabling the optical audio output from their motherboard in Linux. The default values set by the alsa driver do not enable the optical output, and it is not possible to enable it using the alsamixer.

A solution was found by changing the /etc/asound.state file directly.

Short howto:

  1. Close mythfrontend if it is running.
  2. Save the asound.state file below as /etc/asound.state
  3. Enter the command alsactl -f /etc/asound.state restore. See "Troubleshooting" below if this command returns any errors.
  4. Once the alsactl command can be run without error, start mythfrontend. Go to Utilities/Setup -> Setup -> General and for Audio output device put ALSA:digital. However, if the next step doesn't work, you may need to enter ALSA:default instead.
  5. Test both surround sound output and stereo output. Try watching a standard definition or analogue TV channel (for a stereo test) and a DVD with Dolby and/or DTS surround sound (for a surround sound test).

Troubleshooting

Due to differences in the ALSA driver and the support circuits you might experience error messages of the following kind:

alsactl: set_control:894: warning: name mismatch (Mic Boost (+20dB)/Mic Boost (+20dB) Capture Switch) for control #17
alsactl: set_control:896: warning: index mismatch (0/0) for control #17
alsactl: set_control:898: failed to obtain info for control #17 (Operation not permitted)

This means that on your hardware, the name of control #17 is not "Mic Boost (+20dB)" but instead "Mic Boost (+20dB) Capture Switch". To fix this problem, edit the /etc/asound.state file and change the name of control to the correct name.

You may also receive an error of the form

alsactl: set_control:1273: failed to obtain info for control #17 (No such file or directory)

This is less helpful, as you will need to find the correct name for the control using a program such as alsamixer, which should hopefully be quite simple to figure out.

The last error you may receive is

No state is present for card CX8811

This refers to another sound card or sound hardware on a TV tuner card in the system. If you're not using that card for your sound output (and if you are, then this page is of no use to you!), then this message can be safely ignored.

/etc/asound.state File

Save the following file as /etc/asound.state

Script.png /etc/asound.state

state.CK804 {
	control.1 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Master Playback Switch'
		value true
	}
	control.2 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		iface MIXER
		name 'Master Playback Volume'
		value.0 22
		value.1 22
	}
	control.3 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Center Playback Switch'
		value false
	}
	control.4 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 31'
		iface MIXER
		name 'Center Playback Volume'
		value 31
	}
	control.5 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'LFE Playback Switch'
		value true
	}
	control.6 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 31'
		iface MIXER
		name 'LFE Playback Volume'
		value 13
	}
	control.7 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Surround Playback Switch'
		value.0 false
		value.1 false
	}
	control.8 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		iface MIXER
		name 'Surround Playback Volume'
		value.0 0
		value.1 0
	}
	control.9 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Master Mono Playback Switch'
		value false
	}
	control.10 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 31'
		iface MIXER
		name 'Master Mono Playback Volume'
		value 0
	}
	control.11 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'PC Speaker Playback Switch'
		value false
	}
	control.12 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 15'
		iface MIXER
		name 'PC Speaker Playback Volume'
		value 0
	}
	control.13 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Phone Playback Switch'
		value false
	}
	control.14 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 31'
		iface MIXER
		name 'Phone Playback Volume'
		value 0
	}
	control.15 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Mic Playback Switch'
		value false
	}
	control.16 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 31'
		iface MIXER
		name 'Mic Playback Volume'
		value 0
	}
	control.17 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Mic Boost (+20dB) Capture Switch'
		value false
	}
	control.18 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Line Playback Switch'
		value false
	}
	control.19 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		iface MIXER
		name 'Line Playback Volume'
		value.0 0
		value.1 0
	}
	control.20 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'CD Playback Switch'
		value false
	}
	control.21 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		iface MIXER
		name 'CD Playback Volume'
		value.0 0
		value.1 0
	}
	control.22 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Aux Playback Switch'
		value false
	}
	control.23 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		iface MIXER
		name 'Aux Playback Volume'
		value.0 0
		value.1 0
	}
	control.24 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'PCM Playback Switch'
		value true
	}
	control.25 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		iface MIXER
		name 'PCM Playback Volume'
		value.0 22
		value.1 22
	}
	control.26 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 2
		comment.item.0 Mic
		comment.item.1 CD
		comment.item.2 Video
		comment.item.3 Aux
		comment.item.4 Line
		comment.item.5 Mix
		comment.item.6 'Mix Mono'
		comment.item.7 Phone
		iface MIXER
		name 'Capture Source'
		value.0 Mic
		value.1 Mic
	}
	control.27 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Capture Switch'
		value true
	}
	control.28 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 15'
		iface MIXER
		name 'Capture Volume'
		value.0 0
		value.1 0
	}
	control.29 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Mix
		comment.item.1 Mic
		iface MIXER
		name 'Mono Output Select'
		value Mix
	}
	control.30 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Mic1
		comment.item.1 Mic2
		iface MIXER
		name 'Mic Select Capture Switch'
		value Mic1
	}
	control.31 {
		comment.access read
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Con Mask'
		value '0fff000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.32 {
		comment.access read
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Pro Mask'
		value cf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
	}
	control.33 {
		comment.access 'read write'
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Default'
		value '0082000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.34 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Switch'
		value true
	}
	control.35 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 1
		comment.range '0 - 3'
		iface MIXER
		name 'IEC958 Playback AC97-SPSA'
		value 0
	}
	control.36 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Duplicate Front'
		value false
	}
	control.37 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Mic Front Input Switch'
		value false
	}
	control.38 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Shared
		comment.item.1 Independent
		iface MIXER
		name 'Surround Jack Mode'
		value Shared
	}
	control.39 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 '2ch'
		comment.item.1 '4ch'
		comment.item.2 '6ch'
		iface MIXER
		name 'Channel Mode'
		value '2ch'
	}
	control.40 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'IEC958 Capture Switch'
		value false
	}
	control.41 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 PCM
		comment.item.1 'Analog In'
		comment.item.2 'IEC958 In'
		iface MIXER
		name 'IEC958 Playback Source'
		value PCM
	}
	control.42 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'External Amplifier'
		value true
	}
}