Hi Colin<br><br>I changed the sample role from proplist in play_beep( ) below:<br> <br>static void play_beep(pa_core *core)<br>{<br> uint32_t idx;<br> pa_proplist *pl = pa_proplist_new ();<br> pa_proplist_sets(pl, PA_PROP_MEDIA_ROLE, "test");<br>
pa_log ("DBG: %s: %d\n", __func__, __LINE__);<br> pa_scache_play_item(core, "beep", "alsa_output.hw_0_0", PA_VOLUME_NORM, pl, &idx);<br>}<br><br><br>Here are the logs for segmentation fault:<br>
<br>D: module-augment-properties.c: Looking for .desktop file for gst-launch-0.10<br>D: memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=4, prebuf=0, minreq=1 maxrewind=0<br>D: memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432, base=4, prebuf=0, minreq=4 maxrewind=0<br>
I: sink-input.c: Created input 1 "Playback Stream" on alsa_output.hw_0_0 with sample spec s16le 2ch 44100Hz and channel map front-left,front-right<br>I: sink-input.c: media.role = "event"<br>I: sink-input.c: <a href="http://media.name">media.name</a> = "Playback Stream"<br>
I: sink-input.c: <a href="http://application.name">application.name</a> = "gst-launch-0.10"<br>I: sink-input.c: native-protocol.peer = "UNIX socket client"<br>I: sink-input.c: native-protocol.version = "16"<br>
I: sink-input.c: <a href="http://application.process.id">application.process.id</a> = "2465"<br>I: sink-input.c: application.process.user = "root"<br>I: sink-input.c: application.process.host = "(none)"<br>
I: sink-input.c: application.process.binary = "gst-launch-0.10"<br>I: sink-input.c: application.language = "C"<br>I: sink-input.c: window.x11.display = ":0"<br>I: sink-input.c: application.process.machine_id = "(none)"<br>
I: sink-input.c: <a href="http://module-stream-restore.id">module-stream-restore.id</a> = "sink-input-by-media-role:event"<br>I: protocol-native.c: Requested tlength=200.00 ms, minreq=10.00 ms<br>D: protocol-native.c: Adjust latency mode enabled, configuring sink latency to half of overall latency.<br>
D: memblockq.c: memblockq requested: maxlength=4194304, tlength=19404, base=4, prebuf=0, minreq=1764 maxrewind=0<br>D: memblockq.c: memblockq sanitized: maxlength=4194304, tlength=19404, base=4, prebuf=0, minreq=1764 maxrewind=0<br>
I: protocol-native.c: Final latency 200.00 ms = 90.00 ms + 2*10.00 ms + 90.00 ms<br>D: alsa-sink.c: Latency set to 90.00ms<br>D: alsa-sink.c: hwbuf_unused=115068<br>D: alsa-sink.c: setting avail_min=31855<br><b>D: core-subscribe.c: Dropped redundant event due to change event.<br>
E: module-cork-music-on-phone.c: DBG: play_beep: 62<br>E: core-scache.c: DBG: pa_scache_play_item: 314<br>Segmentation fault</b><br><br><br>Best Regards,<br>Himanshu<br><br><div class="gmail_quote">On Thu, Jun 9, 2011 at 1:51 AM, Colin Guthrie <span dir="ltr"><<a href="mailto:gmane@colin.guthr.ie">gmane@colin.guthr.ie</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">'Twas brillig, and Himanshu Chug at 08/06/11 12:15 did gyre and gimble:<br>
<div class="im">> Hi Colin<br>
><br>
> Further I tried to implement the BEEP logic for incoming "event" (say<br>
> sms) during "phone" call stream is active.<br>
><br>
> I tried to load and play sample cache..using pa_scache_add_file() and<br>
> pa_scache_play_item() from module-cork-music-on-phone<br>
><br>
> The sample gets loaded successfully in pa_init() module function, but<br>
> actually the problem I am facing is the media.role of sample is set to<br>
> "event" by default, ( I checked from pacmd --> list-samples) , so now my<br>
> usecase of mixing BEEP (for "event" e.g sms) with "phone" stream is<br>
> failing because the BEEP sample is set to media.role=event which gets<br>
> corked while "phone" is active , and currently for some reasons its<br>
> giving segmentation fault from pa_scache_play_item() function.<br>
><br>
> Any suggestions or alternate on how to mix the BEEP with phone stream?<br>
<br>
</div>The fifth argument to pa_scache_play_item() is a proplist. Simply create<br>
a pa_proplist and inject an entry that sets media.role to something else<br>
(e.g. phone or simply a blank string). That should override the default<br>
media.role stored with the item itself.<br>
<br>
I suspect the segv comes from some kind of loop within your module, but<br>
it's hard to say without a backtrace.<br>
<br>
HTHs<br>
<div><div></div><div class="h5"><br>
Col<br>
<br>
<br>
<br>
<br>
--<br>
<br>
Colin Guthrie<br>
gmane(at)<a href="http://colin.guthr.ie" target="_blank">colin.guthr.ie</a><br>
<a href="http://colin.guthr.ie/" target="_blank">http://colin.guthr.ie/</a><br>
<br>
Day Job:<br>
Tribalogic Limited [<a href="http://www.tribalogic.net/" target="_blank">http://www.tribalogic.net/</a>]<br>
Open Source:<br>
Mageia Contributor [<a href="http://www.mageia.org/" target="_blank">http://www.mageia.org/</a>]<br>
PulseAudio Hacker [<a href="http://www.pulseaudio.org/" target="_blank">http://www.pulseaudio.org/</a>]<br>
Trac Hacker [<a href="http://trac.edgewall.org/" target="_blank">http://trac.edgewall.org/</a>]<br>
<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</div></div></blockquote></div><br>