Discussion:
[pulseaudio-discuss] Problems with ASUS Xonar D2X & PulseAudio card detection.
Hakan Bayındır
2018-10-01 13:20:19 UTC
Permalink
Hello All,

I'm using Debian Testing with KDE desktop, and having problem with
PulseAudio's sound card detection.

The system I'm using has three sound sinks (or cards if you wish):
- nVidia GTX680's sound output over DisplayPort.
- Intel's on board HD audio.
- ASUS Xonar D2X on PCIe (CMedia CM8788) [Preferred & default card].

All of the cards are well supported under Linux, ALSA and PulseAudio,
however PulseAudio is sometimes do not detecting my soundcard and revert
to one of the other cards as it pleases. The problem started with a
kernel update (I don't remember the exact version). What I've diagnosed
is as follows:
- Card is always operational. Present in lspci, initialized correctly
(D2X has hard relays as mute switches and I hear the distinctive CLACK
sound when the card is initialized).
- ALSA always detecting and calling the card settings from persistence
as it should, I verified with ALSA mixer.
- Deleting PulseAudio settings and restarting daemon generally has no help.
- When card is not detected it's completely absent from PulseAudio's
configuration and configuration database.
- I sometimes need to shutdown and restart the PC two to three times to
get the sound card back.
- It's more likely occur if I log-on to my PC late (press the power
button, get a cup of tea, drink some, wander off and login).
- There's no terse/warning/error logs anywhere. Everything is working as
it should on paper, so I cannot debug the problem.

Did anyone experience anything like this? I have the ability to debug
and patch the code if necessary, and if someone can at least show me the
right place for discussing this stuff I'd be grateful.

Thanks in advance,

Best regards,

Hakan
Hakan Bayındır
2018-10-01 12:23:39 UTC
Permalink
Hello All,

I'm using Debian Testing with KDE desktop, and having problem with
PulseAudio's sound card detection.

The system I'm using has three sound sinks (or cards if you wish):
- nVidia GTX680's sound output over DisplayPort.
- Intel's on board HD audio.
- ASUS Xonar D2X on PCIe (CMedia CM8788) [Preferred & default card].

All of the cards are well supported under Linux, ALSA and PulseAudio,
however PulseAudio is sometimes do not detecting my soundcard and revert
to one of the other cards as it pleases. The problem started with a
kernel update (I don't remember the exact version). What I've diagnosed
is as follows:
- Card is always operational. Present in lspci, initialized correctly
(D2X has hard relays as mute switches and I hear the distinctive CLACK
sound when the card is initialized).
- ALSA always detecting and calling the card settings from persistence
as it should, I verified with ALSA mixer.
- Deleting PulseAudio settings and restarting daemon generally has no help.
- When card is not detected it's completely absent from PulseAudio's
configuration and configuration database.
- I sometimes need to shutdown and restart the PC two to three times to
get the sound card back.
- It's more likely occur if I log-on to my PC late (press the power
button, get a cup of tea, drink some, wander off and login).
- There's no terse/warning/error logs anywhere. Everything is working as
it should on paper, so I cannot debug the problem.

Did anyone experience anything like this? I have the ability to debug
and patch the code if necessary, and if someone can at least show me the
right place for discussing this stuff I'd be grateful.

Thanks in advance,

Best regards,

Hakan
Andrey Semashev
2018-10-22 14:36:27 UTC
Permalink
Post by Hakan Bayındır
Hello All,
I'm using Debian Testing with KDE desktop, and having problem with
PulseAudio's sound card detection.
- nVidia GTX680's sound output over DisplayPort.
- Intel's on board HD audio.
- ASUS Xonar D2X on PCIe (CMedia CM8788) [Preferred & default card].
All of the cards are well supported under Linux, ALSA and PulseAudio,
however PulseAudio is sometimes do not detecting my soundcard and revert
to one of the other cards as it pleases. The problem started with a
kernel update (I don't remember the exact version). What I've diagnosed
- Card is always operational. Present in lspci, initialized correctly
(D2X has hard relays as mute switches and I hear the distinctive CLACK
sound when the card is initialized).
- ALSA always detecting and calling the card settings from persistence
as it should, I verified with ALSA mixer.
- Deleting PulseAudio settings and restarting daemon generally has no help.
- When card is not detected it's completely absent from PulseAudio's
configuration and configuration database.
- I sometimes need to shutdown and restart the PC two to three times to
get the sound card back.
- It's more likely occur if I log-on to my PC late (press the power
button, get a cup of tea, drink some, wander off and login).
- There's no terse/warning/error logs anywhere. Everything is working as
it should on paper, so I cannot debug the problem.
Did anyone experience anything like this? I have the ability to debug
and patch the code if necessary, and if someone can at least show me the
right place for discussing this stuff I'd be grateful.
I'm having the same problem on Kubuntu 18.10, PulseAudio 12.2. `pactl
list cards` does not list D2X but it is clearly present in `aplay -L`
and `alsa-info` output.

Were you able to resolve or debug the problem?
Russell Treleaven
2018-10-22 14:45:14 UTC
Permalink
make a safety copy of /etc/pulse/default.pa
edit the file to comment out the following lines like this

#load-module module-udev-detect
#load-module module-detect

add the following lines immediately following the ones you commented out

load-module module-alsa-sink device=hw:<your_card>,<sink_index>
sink_properties="your_sink"
load-module module-alsa-source device=hw:<your_card>,<source_index>
source_properties="your_source"

You can discover the value for <your_card>, <sink_index> and <source_index>
via `aplay -l` and `arecord -l`

restart pulseaudio
`pulseaudio -k`

verify it worked
`pactl list sinks`
`pactl list sources`

Not a fix but it is a workaround
Post by Hakan Bayındır
Hello All,
I'm using Debian Testing with KDE desktop, and having problem with
PulseAudio's sound card detection.
- nVidia GTX680's sound output over DisplayPort.
- Intel's on board HD audio.
- ASUS Xonar D2X on PCIe (CMedia CM8788) [Preferred & default card].
All of the cards are well supported under Linux, ALSA and PulseAudio,
however PulseAudio is sometimes do not detecting my soundcard and revert
to one of the other cards as it pleases. The problem started with a
kernel update (I don't remember the exact version). What I've diagnosed
- Card is always operational. Present in lspci, initialized correctly
(D2X has hard relays as mute switches and I hear the distinctive CLACK
sound when the card is initialized).
- ALSA always detecting and calling the card settings from persistence
as it should, I verified with ALSA mixer.
- Deleting PulseAudio settings and restarting daemon generally has no help.
- When card is not detected it's completely absent from PulseAudio's
configuration and configuration database.
- I sometimes need to shutdown and restart the PC two to three times to
get the sound card back.
- It's more likely occur if I log-on to my PC late (press the power
button, get a cup of tea, drink some, wander off and login).
- There's no terse/warning/error logs anywhere. Everything is working as
it should on paper, so I cannot debug the problem.
Did anyone experience anything like this? I have the ability to debug
and patch the code if necessary, and if someone can at least show me the
right place for discussing this stuff I'd be grateful.
I'm having the same problem on Kubuntu 18.10, PulseAudio 12.2. `pactl list
cards` does not list D2X but it is clearly present in `aplay -L` and
`alsa-info` output.
Were you able to resolve or debug the problem?
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
--
Sincerely,

Russell Treleaven
sip:***@sip.bunnykick.ca;transport=tcp
Andrey Semashev
2018-10-22 15:37:11 UTC
Permalink
make a safety copy of /etc/pulse/default.pa <http://default.pa>
edit the file to comment out the following lines like this
#load-module module-udev-detect
#load-module module-detect
add the following lines immediately following the ones you commented out
load-module module-alsa-sink device=hw:<your_card>,<sink_index>
sink_properties="your_sink"
load-module module-alsa-source device=hw:<your_card>,<source_index>
source_properties="your_source"
You can discover the value for <your_card>, <sink_index> and
<source_index> via `aplay -l` and `arecord -l`
restart pulseaudio
`pulseaudio -k`
verify it worked
`pactl list sinks`
`pactl list sources`
Not a fix but it is a workaround
Thanks, but it doesn't really work for me. `aplay -l` shows:

card 0: D2X [Xonar D2X], device 0: Multichannel [Multichannel]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: D2X [Xonar D2X], device 1: Digital [Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0

so the D2X (analog output) should be "hw:0,0", right? Adding this line:

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

does not add a D2X sink to `pactl list sinks`. Adding this line:

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

does add D2X *digital* ouptut sink. So PulseAudio has a specific problem
with multichannel (5.1) analog output for some reason.
Russell Treleaven
2018-10-22 15:51:06 UTC
Permalink
Cool you have gained some insight.
I would define your sink as hw:D2X,<sink_index> as the card number can
change but the name won't.
make a safety copy of ~/.asoundrc and make the file contain only this line.

defaults.namehint.extended on

The please post the output of `aplay -L` and `amixer -cD2X contents`.
You may be able to disable 5.1 and get the analog sink to work.
Post by Andrey Semashev
make a safety copy of /etc/pulse/default.pa <http://default.pa>
edit the file to comment out the following lines like this
#load-module module-udev-detect
#load-module module-detect
add the following lines immediately following the ones you commented out
load-module module-alsa-sink device=hw:<your_card>,<sink_index>
sink_properties="your_sink"
load-module module-alsa-source device=hw:<your_card>,<source_index>
source_properties="your_source"
You can discover the value for <your_card>, <sink_index> and
<source_index> via `aplay -l` and `arecord -l`
restart pulseaudio
`pulseaudio -k`
verify it worked
`pactl list sinks`
`pactl list sources`
Not a fix but it is a workaround
card 0: D2X [Xonar D2X], device 0: Multichannel [Multichannel]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: D2X [Xonar D2X], device 1: Digital [Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0
load-module module-alsa-sink device=hw:0,0
load-module module-alsa-sink device=hw:0,1
does add D2X *digital* ouptut sink. So PulseAudio has a specific problem
with multichannel (5.1) analog output for some reason.
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
--
Sincerely,

Russell Treleaven
sip:***@sip.bunnykick.ca;transport=tcp
Andrey Semashev
2018-10-22 16:12:18 UTC
Permalink
Post by Russell Treleaven
Cool you have gained some insight.
I would define your sink as hw:D2X,<sink_index> as the card number can
change but the name won't.
Ok. Just for the sake of testing, it also didn't add the sink to PA.
Post by Russell Treleaven
make a safety copy of ~/.asoundrc and make the file contain only this line.
defaults.namehint.extended on
Ok. I didn't have that file.
Post by Russell Treleaven
The please post the output of `aplay -L` and `amixer -cD2X contents`.
$ aplay -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=D2X
Xonar D2X, Multichannel
Default Audio Device
front:CARD=D2X,DEV=0
Xonar D2X, Multichannel
Front speakers
surround21:CARD=D2X,DEV=0
Xonar D2X, Multichannel
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=D2X,DEV=0
Xonar D2X, Multichannel
4.0 Surround output to Front and Rear speakers
surround41:CARD=D2X,DEV=0
Xonar D2X, Multichannel
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=D2X,DEV=0
Xonar D2X, Multichannel
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=D2X,DEV=0
Xonar D2X, Multichannel
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=D2X,DEV=0
Xonar D2X, Multichannel
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=D2X,DEV=0
Xonar D2X, Multichannel
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=D2X,DEV=0
Xonar D2X, Multichannel
Direct sample mixing device
dmix:CARD=D2X,DEV=1
Xonar D2X, Digital
Direct sample mixing device
dsnoop:CARD=D2X,DEV=0
Xonar D2X, Multichannel
Direct sample snooping device
dsnoop:CARD=D2X,DEV=1
Xonar D2X, Digital
Direct sample snooping device
hw:CARD=D2X,DEV=0
Xonar D2X, Multichannel
Direct hardware device without any conversions
hw:CARD=D2X,DEV=1
Xonar D2X, Digital
Direct hardware device without any conversions
plughw:CARD=D2X,DEV=0
Xonar D2X, Multichannel
Hardware device with all software conversions
plughw:CARD=D2X,DEV=1
Xonar D2X, Digital
Hardware device with all software conversions
sysdefault:CARD=PCH
HDA Intel PCH, ALC892 Analog
Default Audio Device
front:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
Front speakers
surround21:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=PCH,DEV=0
HDA Intel PCH, HDMI 0
HDMI Audio Output
dmix:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
Direct sample mixing device
dmix:CARD=PCH,DEV=1
HDA Intel PCH, ALC892 Digital
Direct sample mixing device
dmix:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
Direct sample snooping device
dsnoop:CARD=PCH,DEV=1
HDA Intel PCH, ALC892 Digital
Direct sample snooping device
dsnoop:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct sample snooping device
hw:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
Direct hardware device without any conversions
hw:CARD=PCH,DEV=1
HDA Intel PCH, ALC892 Digital
Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
HDA Intel PCH, ALC892 Analog
Hardware device with all software conversions
plughw:CARD=PCH,DEV=1
HDA Intel PCH, ALC892 Digital
Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
HDA Intel PCH, HDMI 0
Hardware device with all software conversions

$ amixer -cD2X contents
numid=2,iface=MIXER,name='Master Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw---R--,values=8,min=135,max=255,step=0
: values=215,215,215,215,215,215,215,215
| dBscale-min=-60.00dB,step=0.50dB,mute=0
numid=19,iface=MIXER,name='Line Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=21,iface=MIXER,name='CD Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=20,iface=MIXER,name='CD Capture Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
: values=23,23
| dBscale-min=-34.50dB,step=1.50dB,mute=0
numid=18,iface=MIXER,name='Mic Boost (+20dB)'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=17,iface=MIXER,name='Mic Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=16,iface=MIXER,name='Mic Capture Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=31,step=0
: values=31
| dBscale-min=-34.50dB,step=1.50dB,mute=0
numid=23,iface=MIXER,name='Aux Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=22,iface=MIXER,name='Aux Capture Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
: values=0,0
| dBscale-min=-34.50dB,step=1.50dB,mute=0
numid=24,iface=MIXER,name='Analog Loopback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=10,iface=MIXER,name='IEC958 Loopback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=11,iface=MIXER,name='IEC958 Validity Check Capture Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=4,iface=MIXER,name='IEC958 Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=12,iface=MIXER,name='Analog Input Monitor Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=13,iface=MIXER,name='Analog Input Monitor Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=1,step=0
: values=1
| dBscale-min=-6.00dB,step=6.00dB,mute=0
numid=25,iface=MIXER,name='DAC Filter Playback Enum'
; type=ENUMERATED,access=rw------,values=1,items=2
; Item #0 'Sharp Roll-off'
; Item #1 'Slow Roll-off'
: values=0
numid=14,iface=MIXER,name='Digital Input Monitor Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=15,iface=MIXER,name='Digital Input Monitor Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=1,step=0
: values=1
| dBscale-min=-6.00dB,step=6.00dB,mute=0
numid=3,iface=MIXER,name='Stereo Upmixing'
; type=ENUMERATED,access=rw------,values=1,items=3
; Item #0 'Front'
; Item #1 'Front+Surround'
; Item #2 'Front+Surround+Back'
: values=1
numid=9,iface=PCM,name='IEC958 Capture Default',device=1
; type=IEC958,access=r-------,values=1
: values=[AES0=0x00 AES1=0x00 AES2=0x00 AES3=0x00]
numid=8,iface=PCM,name='IEC958 Capture Mask',device=1
; type=IEC958,access=r-------,values=1
: values=[AES0=0xff AES1=0xff AES2=0xff AES3=0xff]
numid=6,iface=PCM,name='IEC958 Playback Con Mask',device=1
; type=IEC958,access=r-------,values=1
: values=[AES0=0x3e AES1=0xff AES2=0x00 AES3=0x00]
numid=5,iface=PCM,name='IEC958 Playback Default',device=1
; type=IEC958,access=rw------,values=1
: values=[AES0=0x04 AES1=0x82 AES2=0x00 AES3=0x00]
Post by Russell Treleaven
You may be able to disable 5.1 and get the analog sink to work.
Only I do want the 5.1 analog output.
Russell Treleaven
2018-10-22 16:15:52 UTC
Permalink
Post by Andrey Semashev
Only I do want the 5.1 analog output.
Maybe your PCH card supports 5.1.
--
Sincerely,

Russell Treleaven
sip:***@sip.bunnykick.ca;transport=tcp
Andrey Semashev
2018-10-22 16:21:01 UTC
Permalink
Post by Andrey Semashev
Only I do want the 5.1 analog output.
Maybe your PCH card supports 5.1.
Maybe it does, but I really want the D2X card to output the 5.1 signal.
The integrated audio is also used in my setup, also analog.

It used to work perfectly in Kubuntu 18.04 PulseAudio 11.1, so something
was broken since then.
Russell Treleaven
2018-10-22 16:24:13 UTC
Permalink
You could do a git bisect to find the commit that breaks things and post a
bug.
https://git-scm.com/docs/git-bisect
Post by Andrey Semashev
Post by Andrey Semashev
Only I do want the 5.1 analog output.
Maybe your PCH card supports 5.1.
Maybe it does, but I really want the D2X card to output the 5.1 signal.
The integrated audio is also used in my setup, also analog.
It used to work perfectly in Kubuntu 18.04 PulseAudio 11.1, so something
was broken since then.
_______________________________________________
pulseaudio-discuss mailing list
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
--
Sincerely,

Russell Treleaven
sip:***@sip.bunnykick.ca;transport=tcp
Andrey Semashev
2018-10-23 22:51:33 UTC
Permalink
Post by Andrey Semashev
    Only I do want the 5.1 analog output.
Maybe your PCH card supports 5.1.
Maybe it does, but I really want the D2X card to output the 5.1 signal.
The integrated audio is also used in my setup, also analog.
It used to work perfectly in Kubuntu 18.04 PulseAudio 11.1, so something
was broken since then.
In case anyone else has this problem, I think I found the cause:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1799541/comments/20

In short, the timidity daemon grabbed ALSA PCM device before PulseAudio,
which caused it not being able to open the D2X device. To solve the
problem, disable or uninstall timidity and restart pulseaudio.

Loading...