In my team, we develop UI to our Embedded Linux system (kernel version 4.19) using SDL (version 1.2). The board we run on is Amlogic A113X.
When we try to load SDL_mixer on our "regular" Ubuntu machines, everything works beautifully, on the board SDL_mixer fails to load.
SDL_mixer is wrapped within a AudioPlayer
class which uses PIMPL to make the SDL dependency hidden in a cpp file.
relevant code:
void AudioPlayerImpl::throw_sdl_exception(const char* method_name){
auto error_message = std::string("AudioPlayerImpl::") + method_name + ", " + SDL_GetError();
throw std::runtime_error(error_message);
}
AudioPlayerImpl::AudioPlayerImpl() :
m_audio_context(nullptr),
m_working(true),
m_stop_music_requested(false){
const auto code = ::Mix_Init(MIX_INIT_MP3);
if (code & MIX_INIT_MP3 != MIX_INIT_MP3) {
throw_sdl_exception("AudioPlayerImpl");
}
if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096) != 0) {
throw_sdl_exception("AudioPlayerImpl");
}
m_audio_worker = std::thread([this]{
work_loop();
});
}
error:
AudioPlayerImpl::AudioPlayerImpl, Mixer not built with MP3 support
Auditional info:
Both ALSA and mpg123 exists in /usr/lib
Any direction what to do next? as far as I know, libmpg123 is the dependency SDL uses to play mp3, and that dependency is in the right place.