test name

check-runtime-pm-status

classification

base

description

If device type is playback or both, check runtime power management status after starting and stopping an aplay process

commands to run (per PCM_PLAYBACK/BOTH)

[terminal 1] $ aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero
[terminal 2] $ ps ax | grep "aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero"
! 18898 pts/0    S+     0:00 aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero
! 18914 pts/1    S+     0:00 grep --color=auto aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero
    ****18898 is the pid of our aplay process in terminal 1****
[terminal 2] $ cat "/sys/bus/pci/devices/0000:`lspci | grep -i audio | cut -d ' ' -f 1`/power/runtime_status"
! active
[terminal 2] $ kill -9 18898
    ****should see aplay process end in terminal 1****
    ****wait at least 2s for suspend idle delay****
[terminal 2] $ cat "/sys/bus/pci/devices/0000:`lspci | grep -i audio | cut -d ' ' -f 1`/power/runtime_status"
! suspended
            

Example: expected PASS result for APL with PCM512X codec (Per PCM, loops 3 times) from test suite logs

2019-08-07 11:59:18 UTC [REM_COMMAND]: Runtime status check: cat /sys/bus/pci/devices/0000:00:0e.0/power/runtime_status
2019-08-07 11:59:18 UTC [REM_INFO]: Iteration 1 of 3 for Port5
2019-08-07 11:59:18 UTC [REM_COMMAND]: aplay start: aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero -q
2019-08-07 11:59:18 UTC [REM_COMMAND]: sleep 0.5
2019-08-07 11:59:19 UTC [REM_INFO]: runtime status: active
2019-08-07 11:59:19 UTC [REM_COMMAND]: kill process: kill -9 17638
2019-08-07 11:59:19 UTC [REM_INFO]: aplay end
2019-08-07 11:59:19 UTC [REM_COMMAND]: sleep 5
2019-08-07 11:59:24 UTC [REM_INFO]: runtime status: suspended
2019-08-07 11:59:24 UTC [REM_INFO]: Iteration 2 of 3 for Port5
2019-08-07 11:59:24 UTC [REM_COMMAND]: aplay start: aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero -q
2019-08-07 11:59:24 UTC [REM_COMMAND]: sleep 0.5
2019-08-07 11:59:24 UTC [REM_INFO]: runtime status: active
2019-08-07 11:59:24 UTC [REM_COMMAND]: kill process: kill -9 17663
2019-08-07 11:59:24 UTC [REM_INFO]: aplay end
2019-08-07 11:59:24 UTC [REM_COMMAND]: sleep 5
2019-08-07 11:59:29 UTC [REM_INFO]: runtime status: suspended
2019-08-07 11:59:29 UTC [REM_INFO]: Iteration 3 of 3 for Port5
2019-08-07 11:59:29 UTC [REM_COMMAND]: aplay start: aplay -D hw:0,0 -r 48000 -c 2 -f s16_le /dev/zero -q
2019-08-07 11:59:29 UTC [REM_COMMAND]: sleep 0.5
2019-08-07 11:59:30 UTC [REM_INFO]: runtime status: active
2019-08-07 11:59:30 UTC [REM_COMMAND]: kill process: kill -9 17688
2019-08-07 11:59:30 UTC [REM_INFO]: aplay end
2019-08-07 11:59:30 UTC [REM_COMMAND]: sleep 5
2019-08-07 11:59:35 UTC [REM_INFO]: runtime status: suspended
2019-08-07 11:59:35 UTC [REM_INFO]: Case PASSED via PCM: Port5