No right channel sound on Creative Xtreme Audio (CA0106) in Ubuntu 14.04-16.04

Bug #1497666 reported by Luke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After a fresh install of Ubuntu 14.04, 15.04, 15.10 and on the liveCD, There is no sound on right channel. But it works perfectly in Win 7/10. It also worked perfectly on Ubuntu 12.04 My sound card is Creative Xtreme Audio (PCI CA0106).

In the forum, many users also have experienced this bug with the incorrect default alsamixer settings.

http://ubuntuforums.org/showthread.php?t=2217724

Here are my alsa-info.sh results.

http://www.alsa-project.org/db/?f=e3ae99437c3d283b35cac7c33ace996bedf43a16

Revision history for this message
Raymond (superquad-vortex2) wrote :

post pulseaudio verbose log

those control names are not defined in pulseaudio conf

imple mixer control 'Analog Front',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 207 [81%] [0.00dB] [on]
  Front Right: Playback 207 [81%] [0.00dB] [on]
Simple mixer control 'Analog Rear',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 207 [81%] [0.00dB] [on]
  Front Right: Playback 207 [81%] [0.00dB] [on]
Simple mixer control 'Analog Side',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 205 [80%] [-0.50dB] [on]
  Front Right: Playback 205 [80%] [-0.50dB] [on]

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths

Changed in alsa-driver (Ubuntu):
status: New → Incomplete
Revision history for this message
Raymond (superquad-vortex2) wrote :

control.5 {
  iface MIXER
  name 'Analog Front Playback Volume'
  value.0 207
  value.1 207
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 255'
   dbmin -9999999
   dbmax 1200
   dbvalue.0 0
   dbvalue.1 0
  }
 }
 control.6 {
  iface MIXER
  name 'Analog Rear Playback Volume'
  value.0 207
  value.1 207
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 255'
   dbmin -9999999
   dbmax 1200
   dbvalue.0 0
   dbvalue.1 0
  }
 }
 control.7 {
  iface MIXER
  name 'Analog Center/LFE Playback Volume'
  value.0 207
  value.1 207
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 255'
   dbmin -9999999
   dbmax 1200
   dbvalue.0 0
   dbvalue.1 0
  }
 }
 control.8 {
  iface MIXER
  name 'Analog Side Playback Volume'
  value.0 205
  value.1 205
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 255'
   dbmin -9999999
   dbmax 1200
   dbvalue.0 -50
   dbvalue.1 -50
  }
 }

dB min is -99999.99 which is equialemnt to mute

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/include/sound/tlv.h

#define TLV_DB_GAIN_MUTE -9999999

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=include/control.h;hb=HEAD

 /** Mute state */
 #define SND_CTL_TLV_DB_GAIN_MUTE -9999999

https://bugs.freedesktop.org/enter_bug.cgi?product=PulseAudio

 you have to open pulseaudio bug report if pulseaudio dB min is less than -99999.99

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

https://launchpadlibrarian.net/176224196/AlsaInfo.txt

control.34 {
  iface MIXER
  name 'Analog Front Playback Switch'
  value true
  comment {
   access 'read write'
   type BOOLEAN
   count 1
  }
 }
 control.35 {
  iface MIXER
  name 'Analog Rear Playback Switch'
  value true
  comment {
   access 'read write'
   type BOOLEAN
   count 1
  }
 }
 control.36 {
  iface MIXER
  name 'Analog Center/LFE Playback Switch'
  value true
  comment {
   access 'read write'
   type BOOLEAN
   count 1
  }
 }
 control.37 {
  iface MIXER
  name 'Analog Side Playback Switch'
  value true
  comment {
   access 'read write'
   type BOOLEAN
   count 1
  }
 }

https://wiki.ubuntu.com/PulseAudio/Log

seem playback switches are not stereo

Revision history for this message
Luke (lukebenes) wrote :

attached the result of:
# echo autospawn = no >> ~/.config/pulse/client.conf
# sudo killall pulseaudio
# LANG=C pulseaudio -vvvv --log-time=1 > ~/pulseverbose.log 2>&1

Is there anything else I can do to help?

Revision history for this message
Luke (lukebenes) wrote :

 you have to open pulseaudio bug report if pulseaudio dB min is less than -99999.99

Is this the problem here:
(Analog Input), direction=2, priority=80, probed=yes, supported=yes, has_mute=no, has_volume=yes, has_dB=yes, min_volume=0, max_volume=255, min_dB=-100000, max_dB=24

Revision history for this message
Raymond (superquad-vortex2) wrote :

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 255
  Mono: Playback 202 [79%] [-13.25dB] [on]

pulseaudio only use the above volume control and ignore those"Analog xxx Playback Volume"

you need to change the driver or add "[Element Analog xxx] to pulseaudio conf file

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-output.conf

304| 0.000) D: [pulseaudio] alsa-mixer.c: Path analog-output (Analog Output), direction=1, priority=99, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=255, min_dB=-100000, max_dB=0
( 0.304| 0.000) D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
( 0.304| 0.000) D: [pulseaudio] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no

Revision history for this message
Raymond (superquad-vortex2) wrote :

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/ca0106/ca0106_mixer.c

you need to remove "Analog" from those "Analog xxx Playback Volume"

static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = {
 CA_VOLUME("Analog Front Playback Volume",
    CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2),
        CA_VOLUME("Analog Rear Playback Volume",
    CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2),
 CA_VOLUME("Analog Center/LFE Playback Volume",
    CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2),
        CA_VOLUME("Analog Side Playback Volume",
    CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME2),

Revision history for this message
Raymond (superquad-vortex2) wrote :

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/CA0106.conf;hb=HEAD

there are locks associated with playback controls of iec958 device

but pulseaudio try to open iec958 capture device

.000) D: [pulseaudio] alsa-util.c: Managed to open iec958:0
( 0.352| 0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 340 ms
( 0.352| 0.000) I: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
( 0.352| 0.000) I: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
( 0.352| 0.000) I: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
( 0.352| 0.000) I: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
( 0.352| 0.000) D: [pulseaudio] alsa-util.c: Set neither period nor buffer size.
( 0.352| 0.000) I: [pulseaudio] (alsa-lib)setup.c: Cannot lock ctl elem
( 0.352| 0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed: Device or resource busy

hooks.0 {
  type ctl_elems
  hook_args [
   {
    name "IEC958 Front Playback Volume"
    index 0
    lock true
    preserve true
    value [ 207 207 ] # Puts 0x30303030 in the Volume register. 0xff - 0x30 = 0xcf = 207
   }
   {
    name "IEC958 Playback Switch"
    lock true
    preserve true
    value 1
   }
   {
    interface PCM
    name "IEC958 Playback Default"
    index 1
    lock true
    preserve true
    optional true
    value [ $AES0 $AES1 $AES2 $AES3 ]
   }
   {
    # for compatibility with older drivers
    name "IEC958 Playback Default"
    index 1
    lock true
    preserve true
    optional true
    value [ $AES0 $AES1 $AES2 $AES3 ]
   }
  ]

Luke (lukebenes)
Changed in alsa-driver (Ubuntu):
status: Incomplete → New
Revision history for this message
Raymond (superquad-vortex2) wrote :

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/profile-sets/default.conf

[Mapping iec958-stereo]
device-strings = iec958:%f
channel-map = left,right
-paths-input = iec958-stereo-input
paths-output = iec958-stereo-output
priority = 5

Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :
Revision history for this message
Raymond (superquad-vortex2) wrote :

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/alsa-mixer.c

seem pulseaudio only control left channel when it only use the virtual master playback volume control

in function element_set_volume, it check the element has left and right channel

static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, bool deferred_volume, bool write_to_hw) {

    snd_mixer_selem_id_t *sid;
    pa_cvolume rv;
    snd_mixer_elem_t *me;
    snd_mixer_selem_channel_id_t c;
    pa_channel_position_mask_t mask = 0;
    unsigned k;

    pa_assert(m);
    pa_assert(e);
    pa_assert(cm);
    pa_assert(v);
    pa_assert(pa_cvolume_compatible_with_channel_map(v, cm));

    SELEM_INIT(sid, e->alsa_name);
    if (!(me = snd_mixer_find_selem(m, sid))) {
        pa_log_warn("Element %s seems to have disappeared.", e->alsa_name);
        return -1;
    }

    pa_cvolume_mute(&rv, cm->channels);

    for (c = 0; c <= SND_MIXER_SCHN_LAST; c++) {
        int r;
        pa_volume_t f = PA_VOLUME_MUTED;
        bool found = false;

        for (k = 0; k < cm->channels; k++)
            if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) {
                found = true;
                if (v->values[k] > f)
                    f = v->values[k];
            }

        if (!found) {
            /* Hmm, so this channel does not exist in the volume
             * struct, so let's bind it to the overall max of the
             * volume. */
            f = pa_cvolume_max(v);
        }

        if (e->has_dB) {
            long value = to_alsa_dB(f);
            int rounding;

            if (e->volume_limit >= 0 && value > (e->max_dB * 100))
                value = e->max_dB * 100;

            if (e->direction == PA_ALSA_DIRECTION_OUTPUT) {
                /* If we call set_playback_volume() without checking first
                 * if the channel is available, ALSA behaves very
                 * strangely and doesn't fail the call */
                if (snd_mixer_selem_has_playback_channel(me, c)) {

Changed in alsa-driver (Ubuntu):
status: New → Incomplete
Revision history for this message
Luke (lukebenes) wrote :

Raymond,
You set status: New → Incomplete
but I'm not sure exactly what you need from me or want me to do. I'd love t get this issue fixed for everyone, just tell me what you want.

Revision history for this message
Luke (lukebenes) wrote :

Raymond,

Filed a bug upstream: https://bugs.freedesktop.org/show_bug.cgi?id=92690

Is there anything else I should add? Thank you so much for your help!

Revision history for this message
Raymond (superquad-vortex2) wrote :

https://bugzilla.kernel.org/enter_bug.cgi?product=Drivers

alsa sound

those ctl lock error can be solved by using type asym for playback and capture of iec958, only playback iec958 need those locks

Revision history for this message
Luke (lukebenes) wrote :

Verified fixed with a clean install of Ubuntu 16.10.

$ uname -a
Linux luke-PowerEdge-T105 4.4.0-9136-generic #55-Ubuntu SMP Fri Aug 26 05:58:34 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Raymond,
Thank you so much for all your help on this issue!

Changed in alsa-driver (Ubuntu):
status: Incomplete → Fix Released
summary: No right channel sound on Creative Xtreme Audio (CA0106) in Ubuntu
- 14.04-15.10
+ 14.04-16.04
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.