Lines Matching +full:compound +full:- +full:device
1 // SPDX-License-Identifier: GPL-2.0
9 // every PCM device it can find. This may conflict with other system
21 #include "alsa-local.h"
38 int device;
71 if (tstamp->tv_nsec > now.tv_nsec) {
72 diff.tv_sec = now.tv_sec - tstamp->tv_sec - 1;
73 diff.tv_nsec = (now.tv_nsec + 1000000000L) - tstamp->tv_nsec;
75 diff.tv_sec = now.tv_sec - tstamp->tv_sec;
76 diff.tv_nsec = now.tv_nsec - tstamp->tv_nsec;
92 return -1;
96 static void missing_device(int card, int device, int subdevice, snd_pcm_stream_t stream)
100 for (pcm_data = pcm_list; pcm_data != NULL; pcm_data = pcm_data->next) {
101 if (pcm_data->card != card)
103 if (pcm_data->device != device)
105 if (pcm_data->subdevice != subdevice)
107 if (pcm_data->stream != stream)
114 pcm_data->card = card;
115 pcm_data->device = device;
116 pcm_data->subdevice = subdevice;
117 pcm_data->stream = stream;
118 pcm_data->next = pcm_missing;
127 int device, subdevice;
134 device = device_from_id(node1);
135 if (device < 0)
145 missing_device(card, device, subdevice, SND_PCM_STREAM_PLAYBACK);
147 missing_device(card, device, subdevice, SND_PCM_STREAM_CAPTURE);
166 card = -1;
193 err = snd_ctl_card_info_malloc(&card_data->info);
198 err = snd_ctl_card_info(handle, card_data->info);
200 card_data->name = snd_ctl_card_info_get_id(card_data->info);
201 if (!card_data->name)
207 if (!card_data->name)
208 card_data->name = "Unknown";
210 ksft_print_msg("Card %d/%s - %s (%s)\n", card,
211 card_data->name, card_name, card_longname);
215 card_data->card = card;
216 card_data->next = card_list;
219 dev = -1;
238 if (err == -ENOENT)
244 ksft_print_msg("%s.0 - %s\n", card_data->name,
258 pcm_data->card = card;
259 pcm_data->device = dev;
260 pcm_data->subdevice = subdev;
261 pcm_data->card_name = card_data->name;
262 pcm_data->stream = stream;
263 pcm_data->pcm_config = conf_get_subtree(card_config, key, NULL);
264 pcm_data->next = pcm_list;
324 ksft_print_msg("%s.%s.%s.%d.%d.%s - %s\n",
326 data->card_name, data->device, data->subdevice,
327 snd_pcm_stream_name(data->stream),
350 sprintf(name, "hw:%d,%d,%d", data->card, data->device, data->subdevice);
351 err = snd_pcm_open(&handle, name, data->stream, 0);
373 i = -1;
382 ksft_print_msg("%s.%s.%d.%d.%s.%s format %s -> %s\n",
384 data->card_name, data->device, data->subdevice,
385 snd_pcm_stream_name(data->stream),
439 if (data->stream == SND_PCM_STREAM_PLAYBACK) {
462 data->card_name, data->device, data->subdevice,
463 snd_pcm_stream_name(data->stream),
475 if (data->stream == SND_PCM_STREAM_PLAYBACK) {
504 if (ms < duration_ms - margin_ms || ms > duration_ms + margin_ms) {
523 data->card_name, data->device,
524 data->subdevice,
525 snd_pcm_stream_name(data->stream));
534 data->card_name, data->device,
535 data->subdevice,
536 snd_pcm_stream_name(data->stream));
540 data->card_name, data->device,
541 data->subdevice,
542 snd_pcm_stream_name(data->stream));
585 for (pcm = pcm_list; pcm != NULL; pcm = pcm->next) {
586 if (pcm->card != card->card)
590 run_time_tests(pcm, TEST_CLASS_SYSTEM, pcm->pcm_config);
608 global_config = conf_load_from_file("pcm-test.conf");
611 ksft_exit_fail_msg("default pcm test configuration (pcm compound) is missing\n");
617 for (conf = conf_cards; conf; conf = conf->next)
618 if (conf->card < 0)
623 for (pcm = pcm_list; pcm != NULL; pcm = pcm->next) {
625 cfg = pcm->pcm_config;
636 for (conf = conf_cards; conf; conf = conf->next)
637 if (conf->card < 0)
639 conf->filename, conf->config_id);
641 for (pcm = pcm_missing; pcm != NULL; pcm = pcm->next) {
643 pcm->card_name, pcm->device, pcm->subdevice,
644 snd_pcm_stream_name(pcm->stream));
647 for (card = card_list; card != NULL; card = card->next) {
648 ret = pthread_create(&card->thread, NULL, card_thread, card);
651 card->card, ret,
656 for (card = card_list; card != NULL; card = card->next) {
657 ret = pthread_join(card->thread, &thread_ret);
660 card->card, ret,