build_pollfd() trying to access u->pcm_handle at sink_process_msg() at module loading step.
But, sometimes the device wasn't open yet. (e.g factory reset, power on, ...)
Therefore, null access to u->pcm_handle causes crash.
I think device need to be opened prior to starting sink's message handler.
[Version] 5.0.61
[Profile] Common
[Issue Type] Bug fix
Signed-off-by: KimJeongYeon <jeongyeon.kim@samsung.com>
Change-Id: I060319c261176bb46f7b1c0804322d4d8c491071
Name: pulseaudio-modules-tizen
Summary: Pulseaudio modules for Tizen
-Version: 5.0.60
+Version: 5.0.61
Release: 0
Group: Multimedia/Audio
License: LGPL-2.1+
u->sink->update_requested_latency = sink_update_requested_latency_cb;
u->sink->userdata = u;
+ if (pa_hal_interface_pcm_open(u->hal_interface,
+ (void **)&u->pcm_handle,
+ DIRECTION_OUT,
+ &u->sink->sample_spec,
+ u->frag_size / pa_frame_size(&u->sink->sample_spec),
+ u->nfrags)) {
+ pa_log_error("Error opening PCM device");
+ goto fail;
+ }
+
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
- unsuspend(u);
-
u->block_usec = BLOCK_USEC;
u->timestamp = 0ULL;
u->timestamp_written = 0ULL;
u->source->update_requested_latency = source_update_requested_latency_cb;
u->source->userdata = u;
+ if (pa_hal_interface_pcm_open(u->hal_interface,
+ (void **)&u->pcm_handle,
+ DIRECTION_IN,
+ &u->source->sample_spec,
+ u->frag_size / pa_frame_size(&u->source->sample_spec),
+ u->nfrags)) {
+ pa_log_error("Error opening PCM device");
+ goto fail;
+ }
+
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
- unsuspend(u);
-
u->block_usec = BLOCK_USEC;
u->latency_time = u->block_usec;
u->timestamp = 0ULL;