I can't run ffplay because of errors of SDL_OpenAudio. Is anyone meet this problem?
SDL_OpenAudio (2 channels, 44100 Hz): WASAPI can't initialize audio client
SDL_OpenAudio (1 channels, 44100 Hz): WASAPI can't initialize audio client
I can't run ffplay because of errors of SDL_OpenAudio
-
- Posts: 6
- Joined: Sun Jun 12, 2016 1:50 am
Re: I can't run ffplay because of errors of SDL_OpenAudio
yes, I got this too. Same codes was compiled under fedora or ubuntu can work.
-
- Posts: 6
- Joined: Sun Jun 12, 2016 1:50 am
Re: I can't run ffplay because of errors of SDL_OpenAudio
set environment SDL_AUDIODRIVER can resolve this problem, it seems like SDL2 can not work on WASAPI.
Under windows 7, directsound and winmm both solved.
https://stackoverflow.com/questions/468 ... 4-binaries
Under windows 7, directsound and winmm both solved.
https://stackoverflow.com/questions/468 ... 4-binaries
-
- Posts: 6
- Joined: Sun Jun 12, 2016 1:50 am
Re: I can't run ffplay because of errors of SDL_OpenAudio
I find a new method to resolve this problem, the ffplay not call CoInitialize according to error message. So, add code to call CoInitialize, ffplay can work. And the same time, I checked SDL2's source code, the WASAPI module doesn't set member ProvidesOwnCallbackThread, so SDL2 should call CoInitialize before open audio device. But no idea why ffplay gives us this error message.
here is my modification look like.
#ifdef _WIN32
#include <windows.h>
#endif
static int audio_open(void *opaque, int64_t wanted_channel_layout, int wanted_nb_channels, int wanted_sample_rate, struct AudioParams *audio_hw_params)
{
......
#ifdef _WIN32
CoInitialize(NULL);
#endif
while (!(audio_dev = SDL_OpenAudioDevice(NULL, 0, &wanted_spec, &spec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE))) {
......
}
here is my modification look like.
#ifdef _WIN32
#include <windows.h>
#endif
static int audio_open(void *opaque, int64_t wanted_channel_layout, int wanted_nb_channels, int wanted_sample_rate, struct AudioParams *audio_hw_params)
{
......
#ifdef _WIN32
CoInitialize(NULL);
#endif
while (!(audio_dev = SDL_OpenAudioDevice(NULL, 0, &wanted_spec, &spec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE))) {
......
}
Re: I can't run ffplay because of errors of SDL_OpenAudio
Monitoring libsdl and ffmpeg buglists for status.
https://trac.ffmpeg.org/ticket/6891
https://bugzilla.libsdl.org/show_bug.cgi?id=4066
https://trac.ffmpeg.org/ticket/6891
https://bugzilla.libsdl.org/show_bug.cgi?id=4066
-
- Posts: 2
- Joined: Thu Jan 17, 2019 3:26 pm
Re: I can't run ffplay because of errors of SDL_OpenAudio
add code to call CoInitialize, ffplay can work. And the same time, I checked SDL2's source code, the WASAPI module doesn't set member ProvidesOwnCallbackThread, so SDL2 should call CoInitialize before open audio device. But no idea why ffplay gives us this error message.jackyxinli wrote: ↑Mon Nov 27, 2017 7:47 amset environment SDL_AUDIODRIVER can resolve this problem, it seems like SDL2 can not work on WASAPI.
Under windows 7, directsound and winmm both solved.
https://stackoverflow.com/questions/468 ... 4-binaries
'