언어 설정

Menu
Sites
Language
Hard crash (process aborted) calling AudioPlayback.Unprepare

I'm using the Tizen low-level audio capabilities and everything works fine, except that I get a process crash when I try to Unprepare my AudioPlayback

This is the code (again it works fine, apart from the crashiness when I Unprepare):

        playback.Prepare();
        var finishedNormally = await tcs.Task;
        Log.D("Unpreparing");
        _audioPlaybacks[channel].Unprepare();
        Log.D("Unprepared");

 

This is the log:

I/AudioIOUtil( 5535): AudioIOUtil.cs: ThrowIfError(29) > No error.
I/POWER_MANAGER( 2247): core.c: proc_condition_lock(1491) > [S_LCDOFF] locked by  2664 with 2000 ms
I/AudioIOUtil( 5535): AudioIOUtil.cs: ThrowIfError(29) > No error.
I/PULSEAUDIO( 2264): alsa-sink.c: mmap_write(705) > ALSA-SINK(mmap) : Wrote 1920 bytes (of possible 1920 bytes), total(303360)
I/AudioIOUtil( 5535): AudioIOUtil.cs: ThrowIfError(29) > No error.
I/AudioIOUtil( 5535): AudioIOUtil.cs: ThrowIfError(29) > No error.
D/viac    ( 5535): 19:07:37 []  TizenAudioPlayerImpl PlayPcm Unpreparing
W/TIZEN_N_AUDIO_IO( 5535): cpp_audio_io.cpp: cpp_audio_out_unprepare(1352) > handle:[0xee6051e0]
I/TIZEN_N_AUDIO_IO( 5535): CAudioIO.cpp: unprepare(414) > unprepare ----->
I/TIZEN_N_AUDIO_IO( 5535): CPulseAudioClient.cpp: finalize(454) >
E/PULSEAUDIO( 5535): thread-mainloop.c: pa_threaded_mainloop_stop(160) > Assertion '!in_worker(m)' failed at pulse/thread-mainloop.c:160, function pa_threaded_mainloop_stop(). Aborting.
I/DOTNET_LAUNCHER( 5535): onSigabrt called

Anyone using low-level audio where Unprepare works for them?

Responses

1 댓글
Damian Mehers

Looking at the PulseAudio source I got a clue and tried calling Unprepare within a Task:


        playback.Prepare();
        if(DebugLog) Log.D("Prepared");
        var finishedNormally = await tcs.Task;
        if (DebugLog) Log.D($"TCS set .. finished normally {finishedNormally}");
        var audioPlayback = _audioPlaybacks[channel];
        await Task.Run(() => {
          try {
            Log.D("Unpreparing");
            audioPlayback.Unprepare();
            Log.D("Unprepared");
          } catch (Exception ex) {
            Log.E(ex);
          }
        });
        _audioPlaybacks[channel] = null;
        return finishedNormally;
 

Not so crashy.