Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add PCM interface tests #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smelamud
Copy link

@smelamud smelamud commented Nov 1, 2023

Add tests for various features of the PCM interface. The goal is to maximize coverage of the corresponding kernel code. The tests use a loopback device and require snd-aloop kernel module to be loaded.

Add tests for various features of the PCM interface. The goal is to
maximize coverage of the corresponding kernel code. The tests use a
loopback device and require snd-aloop kernel module to be loaded.
@smelamud
Copy link
Author

smelamud commented Nov 1, 2023

@perexg Can you please review?

Copy link
Member

@perexg perexg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is test for the Loopback driver, so it may make sense to rename the main source file from pcm.c to pcm-loopback.c or so. Or create a more universal code which allows to pass the card number/name by user.

Possible improvement (maybe for future update): Add a time check for the I/O operations using the system clock.

#include <stdio.h>
#include <alsa/asoundlib.h>

/* XXX this variable definition does not belong in a header file */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably change XXX to FIX .

static char opcmdev[10], ipcmdev[10];

static int find_card(int *card_index) {
int index = -1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use one intention style for the whole code. Check also whitespaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants