#include "alsa_input.h"
#include <alsa/error.h>
+#include <alsa/global.h>
+#include <alsa/pcm.h>
#include <assert.h>
+#include <chrono>
#include <errno.h>
+#include <pthread.h>
#include <stdio.h>
-#include <unistd.h>
+#include <thread>
#include <cstdint>
#include "alsa_pool.h"
#include "bmusb/bmusb.h"
-#include "shared/timebase.h"
using namespace std;
using namespace std::chrono;
void ALSAInput::capture_thread_func()
{
+ if (!done_init) {
+ char thread_name[16];
+ snprintf(thread_name, sizeof(thread_name), "ALSA_C_%d", internal_dev_index);
+ pthread_setname_np(pthread_self(), thread_name);
+
+ done_init = true;
+ }
+
parent_pool->set_card_state(internal_dev_index, ALSAPool::Device::State::STARTING);
// If the device hasn't been opened already, we need to do so