Skip to contentSkip to conversation

Invalid PCM pointer with CMI8738 and pcm.c buffer underuns

DISCUSSION andoru 2 participants 5 messages Apr 4, 2014 – Apr 5, 2014

lore
Share & tools
lore

andoru

author
#0 lore raw

Continued from here: http://article.gmane.org/gmane.linux.alsa.devel/121379

After a few days now I finally got VLC to log everything that happens, and finally the bug reappeared, and unlike previously thought, it happens when I watch a video as well.
But unfortunately VLC didn't give anything specific that happened at the time, just some vague ALSA errors about broken pipes (at line 394) :
http://pastebin.com/NgZiG9yX

At the time I added the video to VLC's queue I was doing something in the background (which I don't remember now unfortunately), but this has happened even when listening to something without doing anything in the background, and not having any background-running apps except Transmission.

Also interestingly lately I've heard a few crackles/pops when listening to stuff, followed by a second or so of silence then back to normal when I would run CPU intensive stuff. At those points I thought the bug would be invoked again, but it didn't happen so.

I still have the crackling problem, not able to change the PCM channel volume and screeching on audio that has clipped portions or very high frequency waves.

Can anyone give me any instructions on what I could do to further diagnose this problem?
And more importantly, as I stated in the linked post above, how could I shut down the sound daemon/server/whatever so I could bring back the OS to stability without restarting.

#1 lore raw

2014-04-05 0:15 GMT+08:00 andoru <[email protected]>:

Quoted 17 lines

Continued from here:
http://article.gmane.org/gmane.linux.alsa.devel/121379

After a few days now I finally got VLC to log everything that happens, and finally the bug reappeared, and unlike previously thought, it happens when I
watch a video as well.
But unfortunately VLC didn't give anything specific that happened at the time, just some vague ALSA errors about broken pipes (at line 394) :
http://pastebin.com/NgZiG9yX

At the time I added the video to VLC's queue I was doing something in the background (which I don't remember now unfortunately), but this has happened
even when listening to something without doing anything in the background, and not having any background-running apps except Transmission.

Quoted 10 lines

Also interestingly lately I've heard a few crackles/pops when listening to stuff, followed by a second or so of silence then back to normal when I would run CPU intensive stuff. At those points I thought the bug would be invoked again, but it didn't happen so.

I still have the crackling problem, not able to change the PCM channel volume and screeching on audio that has clipped portions or very high frequency waves.

alsa debug: final HW setup:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: 40000
PERIOD_SIZE: 1764
PERIOD_BYTES: 7056
PERIODS: (9 10)
BUFFER_TIME: (371519 371520)
BUFFER_SIZE: 16384
BUFFER_BYTES: 65536

does the hardware really support (16384/1764) 9.27 periods ?

does the error occur in the last period ?

Quoted 8 lines

Can anyone give me any instructions on what I could do to further diagnose this problem?
And more importantly, as I stated in the linked post above, how could I shut
down the sound daemon/server/whatever so I could bring back the OS to stability without restarting.

Do the clippping occur with oss emulation which use power of 2 period size

or

add

snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS)

author
#2 lore raw
Quoted 4 lines · Raymond Yau <superquad.vortex2 <at> gmail.com> writes:

does the hardware really support (16384/1764)
9.27 periods?
does the error occur in the last period ?

I have no idea, how do I find out? What last period?

Quoted 9 lines

Do the clippping occur with oss emulation which use power of 2 period size

or

add

snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS)

Add that line where? I'm not sure if I'm using oss emulation.
_______________________________________________________________________

#3 lore raw
Quoted 6 lines
Quoted 4 lines

does the hardware really support (16384/1764)
9.27 periods?
does the error occur in the last period ?

I have no idea, how do I find out? What last period?

http://www.alsa-project.org/main/index.php/XRUN_Debug

# Enable basic debugging and dump stack, check hardware pointer on the period update
# Usefull to just see, if PCM stream is stopped for a reason (usually wrong audio process timing from scheduler)
# And to check the values from driver

echo 11 > /proc/asound/card0/pcm0p/xrun_debug

Check the system log whether the hwptr position are correct in first nine periods and xrun occur on 10th period since the buffer contain 9.27 periods when running vlc?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/CMIPCI.txt

cat /proc/asound/card0/cmipci

What is the model of your sound card ?

Does it support 4 and 6 channels in windows ?

author
#4 lore raw
Quoted 9 lines · Raymond Yau <superquad.vortex2 <at> gmail.com> writes:

http://www.alsa-project.org/main/index.php/XRUN_Debug

# Enable basic debugging and dump stack, check hardware pointer on the period update
# Usefull to just see, if PCM stream is stopped for a reason (usually wrong audio process timing from scheduler)
# And to check the values from driver

echo 11 > /proc/asound/card0/pcm0p/xrun_debug

Argh, seems the kernel I'm using doesn't have the debug options. Any other ways around this?

Quoted 3 lines

Check the system log whether the hwptr position are correct in first nine periods and xrun occur on 10th period since the buffer contain 9.27 periods when running vlc?

Which system log? Or maybe this is related to the above? I can't find anything in any file under /var/log/ that contains anything you're talking about.

Quoted 1 line

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation

Quoted 5 lines

/sound/alsa/CMIPCI.txt

cat /proc/asound/card0/cmipci

What is the model of your sound card ?

____________________________________________________

$ cat /proc/asound/card0/cmipci
C-Media CMI8738 (model 55) at 0xe000, irq 18

00: 02 00 01 00
04: d0 0d 00 00
08: 83 00 09 00
0c: 00 00 01 0a
10: c0 00 00 00
14: 00 60 c0 00
18: 00 01 80 0e
1c: 00 00 ee ee
20: 10 40 f9 00
24: 8f ff ff 06
90: 20 09 00 00
____________________________________________________

Quoted 1 line

Does it support 4 and 6 channels in windows ?

6 channels. I don't use more than 2 channels anyway.