kumquat-buildroot/support/testing/tests/package/sample_python_pyalsa.py
Julien Olivain 8c074e73b0 support/testing: add test for python-pyalsa
This is a simple test importing pyalsa, showing alsa library version and
attempting to list cards.

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-07-28 23:12:28 +02:00

13 lines
410 B
Python

#! /usr/bin/env python3
from pyalsa import alsacard
print('asoundlibVersion:', alsacard.asoundlib_version())
print('cardLoad:', alsacard.card_load(0))
print('cardList:', alsacard.card_list())
print('deviceNameHint for all cards:')
print(alsacard.device_name_hint(-1, "pcm"))
for card in alsacard.card_list():
print('deviceNameHint for card #%i:' % card)
print(alsacard.device_name_hint(card, "pcm"))