Score:0

SDL2 can not initialize sound driver

pt flag

|Distributor ID:|Ubuntu| |Description:|Ubuntu 21.04| |Release:|21.04| |Codename:|hirsute|

I tried to initialize the sound driver but it didn't work. Here's the code:

std::cout << SDL_GetNumAudioDrivers() << std::endl;

for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
  const char* driver_name = SDL_GetAudioDriver(i);
  if (SDL_AudioInit(driver_name)) {
    printf(“Audio driver failed to initialize: %s\n”, driver_name);
  continue;
  }else{
    printf(“Audio driver initialize success: %s\n”, driver_name);
//break;
  }
  SDL_AudioQuit();
}

gave the conclusion:

3
Audio driver failed to initialize: dsp
Audio driver initialize success: disk
Audio driver initialize success: dummy

First, it's strange that SDL2 doesn't see pulseaudio. Secondly, even with successful initialization of the dummy and disk drivers, I do not hear any sounds.

have any idea why this is happening?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.