Skip to contentSkip to conversation

Invalid PCM pointer with CMI8738 and pcm.c buffer underuns

DISCUSSION andoru 3 participants 7 messages Mar 26, 2014 – Mar 28, 2014 2 messages not in the archive

lore
Share & tools
lore

andoru

author
#0 lore raw

I've previously posted under ALSA's user mailing list so to avoid the clutter, the details about what's happening is here:
http://article.gmane.org/gmane.linux.alsa.user/38258
http://article.gmane.org/gmane.linux.alsa.user/38260

There was no debug info under /proc/asound/card0/ so nothing to give from there unless you guys need something specific.

Output of alsa-debug.sh:
http://www.alsa-project.org/db/?f=26187faadd47f3626029ba667cb004e74695f2b2

aplay returns:
________________________________________________________________________

$ aplay -vv 03\ paris\ match-\ Bikeride.wav
Playing WAVE '03 paris match- Bikeride.wav' : Signed 16 bit Little Endian,
Rate 44100 Hz, Stereo
Plug PCM: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 4096
  period_size  : 1024
  period_time  : 23219
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 4096
  stop_threshold   : 4096
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Hardware PCM card 0 'C-Media CMI8738' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 4096
  period_size  : 1024
  period_time  : 23219
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1073741824
  silence_threshold: 0
  silence_size : 1073741824
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0
#+                                                 | 00%
_____________________________________________________________________
#3 lore raw
In reply to a message not in the archive
Quoted 11 lines

I've previously posted under ALSA's user mailing list so to avoid the clutter, the details about what's happening is here:
http://article.gmane.org/gmane.linux.alsa.user/38258
http://article.gmane.org/gmane.linux.alsa.user/38260

There was no debug info under /proc/asound/card0/ so nothing to give from there unless you guys need something specific.

Output of alsa-debug.sh:
http://www.alsa-project.org/db/?f=26187faadd47f3626029ba667cb004e74695f2b2

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/cmipci.c?id=1c583063a5c769fe2ec604752e383972c69e6d9b

Seem cannot read valid value from register within three trials

state.CMI8738 {
control.1 {
iface PCM
device 2
name 'Playback Channel Map'
value.0 0
value.1 0
value.2 0
value.3 0
value.4 0
value.5 0
comment {
access read
type INTEGER
count 6
range '0 - 36'
}
}

Seem bug in adding channel map to iec958 instead of analog

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/cmipci.c?id=f49921b894ec338696e47d985acc09df3cddbfd1

pcm.!default {
type plug
slave.pcm "dmixer"
}

You need asym plugin for playback and capture when overwrite pcm.default

author
#4 lore raw
Quoted 8 lines

Seem cannot read valid value from register within three trials

state.CMI8738 {
control.1 {

[...]

Seem bug in adding channel map to iec958 instead of analog

What does that mean? What should I do with those patches? Should I apply them and try to compile the latest ALSA version?

Quoted 8 lines

pcm.!default {
type plug
slave.pcm "dmixer"
}

You need asym plugin for playback and capture when overwrite pcm.default

Should I change my /etc/asound.conf like in the examples here?
http://alsa.opensrc.org/Asym

#5 lore raw

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/cmipci.c?id=1c583063a5c769fe2ec604752e383972c69e6d9b

you have to dump the value of the register and increase the number of trials to find out whether you can get a valid value

Quoted 11 lines
Quoted 8 lines

state.CMI8738 {
control.1 {

[...]

Seem bug in adding channel map to iec958 instead of analog

What does that mean? What should I do with those patches? Should I apply them and try to compile the latest ALSA version?

the patch did not channel map to the analog device

control.1 {
iface PCM
device 2
name 'Playback Channel Map'
value.0 0
value.1 0
value.2 0
value.3 0
value.4 0
value.5 0
comment {
access read
type INTEGER
count 6
range '0 - 36'
}
}

!!Aplay/Arecord output
!!--------------------

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: CMI8738 [C-Media CMI8738], device 0: CMI8738-MC6 [C-Media PCI DAC/ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8738 [C-Media CMI8738], device 1: CMI8738-MC6 [C-Media PCI 2nd DAC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: CMI8738 [C-Media CMI8738], device 2: CMI8738-MC6 [C-Media PCI IEC958]
Subdevices: 1/1
Subdevice #0: subdevice #0

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/cmipci.c?id=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2

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

CMI8738-MC6.pcm.rear.0 {

         @args [ CARD ]
         @args.CARD {
                type string
         }
         type hw
         card $CARD
         device 1
}

device 0 seem emulate sb16 , you need to ask the author how this driver support multi-channels

seem device 1 is used for multi-channels playback and device 2 is used for iec958

Quoted 8 lines
Quoted 8 lines

pcm.!default {
type plug
slave.pcm "dmixer"
}

Quoted 6 lines
Quoted 2 lines

You need asym plugin for playback and capture when overwrite pcm.default

Should I change my /etc/asound.conf like in the examples here?
http://alsa.opensrc.org/Asym

yes, you need define both playback and capture if you overwrite pcm.default
since dmix does not support capture

#6 lore raw
Quoted 4 lines · Raymond Yau

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/cmipci.c?id=1c583063a5c769fe2ec604752e383972c69e6d9b

you have to dump the value of the register and increase the number of trials to find out whether you can get a valid value

As shown in the bug, the register fails continuously; this is not a transient failure that could be worked around like in that commit.

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Seem bug in adding channel map to iec958 instead of analog

What does that mean?

Nothing relevant to this problem.

Quoted 1 line
Quoted 1 line

What should I do with those patches?

Nothing.

Regards,
Clemens

author
#7 lore raw
Quoted 2 lines

yes, you need define both playback and capture if you overwrite pcm.default since dmix does not support capture

I'm less concerned with the capture part of this card as I record audio through the mic of the webcam anyway. But having added that, it hasn't solved my previous problem with not being able to hear sounds from multiple sources, and also I can't use alsamixer now.

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

Seem bug in adding channel map to iec958 instead of analog

What does that mean?

Nothing relevant to this problem.

Quoted 1 line
Quoted 1 line

What should I do with those patches?

Nothing.

So I guess that means there aren't really any solutions to my bug? What happens next? (sorry for all the annoying questions)

#8 lore raw
Quoted 1 line · andoru

So I guess that means there aren't really any solutions to my bug?

It sounds like a hardware error. You will have to replace the card.

Regards,
Clemens