Hi @numbqq ,
Update from my end while debugging further in this issue,
Observation I found is when first time I play hw_ptr and buf_pos are not updating, afterwards every time while in working condition hw_prt and buf_pos are updating and hence we are hearing audio.
Not working ALSA procfs : hw_ptr value not changed
root@Khadas:~# cat /proc/asound/card0/pcm0p/sub0/status
state: RUNNING
owner_pid : 3496
trigger_time: 152.595785417
tstamp : 0.000000000
delay : 24000
avail : 0
avail_max : 18000
-----
hw_ptr : 0
appl_ptr : 24000
root@Khadas:~#
root@Khadas:~#
Working ALSA procfs : hw_ptr value changed
root@Khadas:~# cat /proc/asound/card0/pcm0p/sub0/status
state: RUNNING
owner_pid : 3506
trigger_time: 170.011932980
tstamp : 0.000000000
delay : 20992
avail : 3008
avail_max : 18000
-----
hw_ptr : 147136
appl_ptr : 168128
root@Khadas:~#
Not working PCM buffer state: buffer position not changed
root@Khadas:~# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 22/22 #P:4
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
aplay-3446 [000] .... 133.288815: hwptr: pcmC0D0p/sub0: POS: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 133.400128: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 133.518584: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 133.637332: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 133.754263: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 133.872737: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 133.991484: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 134.109668: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 134.227154: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 135.527792: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 135.645010: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3447 [001] .... 135.763193: hwptr: pcmC0D0p/sub0: IRQ: pos=0, old=0, base=0, period=6000, buf=24000
working PCM buffer state: Buffer position changed
root@Khadas:~# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 47/47 #P:4
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
aplay-3572 [002] .... 291.848182: hwptr: pcmC0D0p/sub0: POS: pos=128, old=0, base=0, period=6000, buf=24000
irq/26-ff660000-3573 [002] .... 291.966122: hwptr: pcmC0D0p/sub0: IRQ: pos=6144, old=128, base=0, period=6000, buf=24000
aplay-3572 [002] .... 291.966205: hwptr: pcmC0D0p/sub0: POS: pos=6144, old=6144, base=0, period=6000, buf=24000
irq/26-ff660000-3573 [002] .... 292.084911: hwptr: pcmC0D0p/sub0: IRQ: pos=12160, old=6144, base=0, period=6000, buf=24000
aplay-3572 [002] .... 292.084981: hwptr: pcmC0D0p/sub0: POS: pos=12160, old=12160, base=0, period=6000, buf=24000
irq/26-ff660000-3573 [002] .... 292.203330: hwptr: pcmC0D0p/sub0: IRQ: pos=18176, old=12160, base=0, period=6000, buf=24000
Currently I am looking at
sound/soc/amlogic/auge/tdm.c
file for further debug.
Please advice if the track is wrong here.
Thanking you in anticipation.