Comment 17 for bug 1364647

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

We can fix this in the network indicator to have it query the current audio device and add the internal speaker if it is not current. This should allow us to play the alarm tone on both. per diwic

1) pa_context_get_server_info and then pa_server_info->default_sink_name gives you the sink
2) then call pa_context_get_sink_info_by_name for that sink and see if pa_sink_info->active_port is set
3) if so use active_port->name (and active_port->description for a human-readable name)
4) if not, just use sink->name and sink->description

change active port to "output-speaker" for the card named "droid_card.primary" Or to both if possible, there is also a "output-speaker+wired_headphone" port

There is existing code that is similar for the dialer to set the port and a QML wrapper