Skip to contentSkip to conversation

Invalid PCM pointer with CMI8738 and pcm.c buffer underuns

DISCUSSION andoru 2 participants 4 messages Apr 10, 2014 – Apr 12, 2014

lore
Share & tools
lore

andoru

author
#0 lore raw

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

Quoted 9 lines

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

Okay, I not compiled my own kernel with CONFIG_SND_PCM_XRUN_DEBUG, CONFIG_SND_VERBOSE_PROCFS, CONFIG_SND_DEBUG all enabled in the kernel configuration, I have an xrun_debug file, but it doesn't seem to list anything, then I also tried with cat instead of echo, and just a 0 showed up:

___________________________________________________________________

$ echo 11 > /proc/asound/card0/pcm0p/xrun_debug
bash: /proc/asound/card0/pcm0p/xrun_debug: Permission denied
# echo 11 > /proc/asound/card0/pcm0p/xrun_debug
bash: /proc/asound/card0/pcm0p/xrun_debug: Permission denied
$ cat /proc/asound/card0/pcm0p/xrun_debug
0
___________________________________________________________________
#1 lore raw
Quoted 2 lines

Continued from here:

http://article.gmane.org/gmane.linux.alsa.devel/121575

Quoted 6 lines
Quoted 6 lines

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

Quoted 9 lines
Quoted 4 lines

audio process timing from scheduler)
# And to check the values from driver

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

Okay, I not compiled my own kernel with CONFIG_SND_PCM_XRUN_DEBUG, CONFIG_SND_VERBOSE_PROCFS, CONFIG_SND_DEBUG all enabled in the kernel configuration, I have an xrun_debug file, but it doesn't seem to list anything, then I also tried with cat instead of echo, and just a 0 showed

up:

Quoted 10 lines

___________________________________________________________________

$ echo 11 > /proc/asound/card0/pcm0p/xrun_debug
bash: /proc/asound/card0/pcm0p/xrun_debug: Permission denied
# echo 11 > /proc/asound/card0/pcm0p/xrun_debug
bash: /proc/asound/card0/pcm0p/xrun_debug: Permission denied
$ cat /proc/asound/card0/pcm0p/xrun_debug
0

You need root privilege to debug

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

Check the system log , you should find the hwptr change at 10ms interval if vlc use period time of 10ms

Try different period time/size to verify that the hardware really support any arbitrary period time/size requested by the application ?

author
#2 lore raw
Quoted 4 lines

You need root privilege to debug

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

___________________________________________________________

$ sudo echo 11 > /proc/asound/card0/pcm0p/xrun_debug
___________________________________________________________

implies:
___________________________________________________________

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

So I did have root priviledges when I executed that command, and it still gives me a Permission denied error.

I tried the command under root and it accepted the command but didn't print anything after issuing the command. So I guess it worked?

Quoted 2 lines

Check the system log , you should find the hwptr change at 10ms interval if vlc use period time of 10ms

Again, what system log? Be a little bit more specific please.

Quoted 2 lines

Try different period time/size to verify that the hardware really support any arbitrary period time/size requested by the application ?

VLC doesn't have any options or terminal parameters to be able to change the period as you mention.

author
#3 lore raw
In reply to Raymond Yau

Okay, nevermind, the OS froze as I've tried to change the level on the PCM channel, so I rebooted and tried to look for anything that might have left a trace for what has happened, and I think I found what you were looking for:
http://pastebin.com/YfP61KBk

It was under /var/log/messages.0 (same things also under /var/log/syslog for some weird reason)
I haven't been able to see what caused the freezing.

Also found this, not sure if it's useful:
_______________________________________________________________________

Apr 12 23:30:50 flying-topsoil kernel: [18087.771787]  [<c12b3777>] ?
dump_stack+0xa/0x13
Apr 12 23:30:50 flying-topsoil kernel: [18087.771813]  [<f819d839>] ?
xrun+0x9a/0xb2 [snd_pcm]
Apr 12 23:30:50 flying-topsoil kernel: [18087.771824]  [<c104e65d>] ?
ktime_get_ts+0x30/0x77
Apr 12 23:30:50 flying-topsoil kernel: [18087.771838]  [<f819e43c>] ?
snd_pcm_update_hw_ptr0+0x91/0x744 [snd_pcm]
Apr 12 23:30:50 flying-topsoil kernel: [18087.771847]  [<c103bca3>] ?
hrtimer_start_range_ns+0x20/0x25
Apr 12 23:30:50 flying-topsoil kernel: [18087.771853]  [<c103b9c2>] ?
hrtimer_try_to_cancel+0x4a/0x51
Apr 12 23:30:50 flying-topsoil kernel: [18087.771864]  [<f8198cbb>] ?
snd_pcm_hwsync+0x30/0x46 [snd_pcm]
Apr 12 23:30:50 flying-topsoil kernel: [18087.771874]  [<f819ab7b>] ?

snd_pcm_common_ioctl1+0x5c/0xa0f [snd_pcm]
_______________________________________________________________________