summaryrefslogtreecommitdiff
path: root/src/modules
Commit message (Collapse)AuthorAgeFilesLines
* stream-interaction: Fix crash in case of invalid argument for volumeSangchul Lee2016-04-201-1/+1
| | | | | | | In case of invalid argument for volume, the crash occurs in pa_stream_interaction_done(). pa_xnew() is replaced with pa_xnew0() to fix it. Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
* role-ducking: Add support for ducking groupSangchul Lee2016-04-202-87/+212
| | | | | | | | | | | | | | | | | | | Now, trigger_roles, ducking_roles and volume can be divided into several groups by slash. That means each group can be affected by its own volume policy. If we need to apply ducking volume level differently that is triggered from each trigger role(s), this feature would be useful for this purpose. For example, let's assume that tts should take music and video's volume down to 40% whereas voice_recognition should take those and tts's volume down to 20%. In this case, the configuration can be written as below. trigger_roles=tts/voice_recognition ducking_roles=music,video/music,video,tts volume=40%/20% If one of ducking role is affected by more than two trigger roles simultaneously, volume of the ducking role will be applied by method of multiplication. And it works in the same way as before without any slash. Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
* alsa-mixer: Support for Creative SoundBlaster Omni Surround 5.1 USB sound ↵Nazar Mokrynskyi2016-04-193-15/+10
| | | | | | | | | card with latest firmware `Mic` is now detected as `Mic-In/Mic Array` (there are 2 microphones physically, nice to se this being understood). `Line` is now detected as `Line In`. Removed all output modes except officially supported stereo, 5.1 and stereo S/PDIF. Also microphone/line in now might be used simultaneously with either output mode, yay!
* rtp: Do all receive side rate calculations in sink-input domainArun Raghavan2016-04-021-8/+10
| | | | | | | The code was mixing sink and sink input domain rate updates, and that only works if the rate of the RTP stream is the same as the rate of the sink. This changes all the calcuations to be on the sink-input rate, since that's the rate we are trying to guess (and resample for).
* pstream: Support memfd blocks transportAhmed S. Darwish2016-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have the necessary infrastructure to memexport and mempimport a memfd memblock, extend that support higher up in the chain with pstreams. A PA endpoint can now _transparently_ send a memfd memblock to the other end by simply calling pa_pstream_send_memblock() – provided the block's memfd pool was earlier registered with the pstream. If the pipe does not support memfd transfers, we fall back to sending the block's full data instead of just its reference. ** Further details: A single pstream connection usually transfers blocks from multiple pools including the server's srbchannel mempool, the client's audio data mempool, and the server's global core mempool. If these mempools are memfd-backed, we now require registering them with the pstream before sending any blocks they cover. This is done to minimize fd passing overhead and avoid fd leaks. Moreover, to support all these pools without hard-coding their number or nature in the Pulse communication protocol itself, a new REGISTER_MEMFD_SHMID command is introduced. That command can be sent _anytime_ during the pstream's lifetime and is used for creating on demand SHM ID to memfd mappings. Suggested-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
* stream-interaction: interact if a stream starts corkedGeorg Chini2016-03-211-13/+19
| | | | | | This patch deals with the case that applications start new streams corked. In case of module-role-cork it will only mute the stream because corking is removed later by the application.
* role-ducking: use the common code in stream-interaction.cGeorg Chini2016-03-211-274/+3
|
* stream-interaction: add ducking functionalityGeorg Chini2016-03-211-13/+43
|
* stream-interaction: Bugfix for improper uncorking behavior with global=1Georg Chini2016-03-181-1/+17
| | | | | | | This patch is based on a recent patch for module-role-ducking from Sangchul Lee which fixes incorrect behavior when global is set to 1. Original commit can be found here: https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=d049c2941e6aef5ff33bcd0b4adece12289302b7
* filter-apply: fix typo "what" -> "want"Tanu Kaskinen2016-03-171-1/+1
|
* role-cork: more cosmetic changes, changed debug outputGeorg Chini2016-03-161-23/+21
| | | | | Change names of shall_interact() and is_trigger_stream() because the names look like the functions return a boolean. Simpler debugging output.
* role-cork: prepare merge with role-ducking: replace "cork" with "interact" ↵Georg Chini2016-03-153-45/+45
| | | | | | where appropriate Again, interact includes cork and duck.
* role-cork: prepare merge with role-ducking: move most code to ↵Georg Chini2016-03-143-336/+399
| | | | | | stream-interaction.c Filename suggested by Tanu, as it includes both, cork and duck.
* role-cork: remove corking on module exitGeorg Chini2016-03-131-12/+46
| | | | | While module-role-ducking removes the attenuation when the module exits, module-role-cork does not remove the corking. Added a function for that.
* role-cork: allow cork of all non-trigger streams using cork_roles=any_roleGeorg Chini2016-03-121-2/+4
| | | | | There might be situations where you want to cork all streams that are not trigger streams. Use cork_roles=any_role to implement this.
* role-cork: React to mute/cork of trigger streams and to proplist changesGeorg Chini2016-03-111-11/+62
| | | | | | When a trigger stream changes mute or cork state, the cork streams should react to this. The same applies if a stream changes its role to or from the trigger role.
* role-cork: Don't ignore streams without media.roleGeorg Chini2016-03-101-6/+2
| | | | | | When corking do not ignore streams without media.role. Instead treat them as if media.role="no_role", so that you can specify "no_role" as trigger or cork role.
* card-restore: save the database when shutting downTanu Kaskinen2016-03-081-1/+3
| | | | | | | | If u->save_time_event is non-NULL when the module is being unloaded, it means that there are some changes to the database that haven't yet been flushed to the disk. Acked-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: refactor element_probe and fix >2 channel bugDavid Henningsson2016-03-081-230/+206
| | | | | | | | | | | | | By refactoring volume probing into its own function, we can reduce indentation a lot. Also, if an error occurs during the volume probe, that volume element is now always skipped (instead of taking down the entire path with it). Also, a bug for elements with more than two channels is fixed, as previously, the volume parsing code was continuing, potentially referencing somewhere outside the array (which has max two channels). Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* switch-on-port-available: Switch from HDMI to analog; but not the other way ↵David Henningsson2016-02-261-3/+3
| | | | | | | | | | | | | | | around If you have headphones plugged in and plug in HDMI; you want sound to stay on headphones. If you have HDMI plugged in and you plug in headphones; you want sound to switch to headphones. Hence we need to take priority into account as well when determining whether to switch to a new profile or not. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=93903 Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* echo-cancel: Convert AGC API to deal with pa_volume_tArun Raghavan2016-02-253-25/+23
| | | | | | | | | | | It is expected that the underlying AGC mechanism will likely provide a single volume for the source rather than a per-channel volume. Dealing with per-channel volumes just adds complexity with regards to the actual volume setting (depending on whether volume sharing is enabled or not, we would set the volume on the source output of the virtual source, and their sample specs may be different). Using a single volume allows us to sidestep this problem entirely.
* echo-cancel: Add beamforming support in the webrtc cancellerArun Raghavan2016-02-251-3/+148
|
* echo-cancel: Remove pa_ prefix on private functionsArun Raghavan2016-02-252-8/+8
|
* echo-cancel: Update a copyright noticeArun Raghavan2016-02-251-1/+2
|
* echo-cancel: Use webrtc's deinterleaved APIArun Raghavan2016-02-253-25/+30
| | | | | | This is required to have unequal channel counts on capture in and out streams, which is needed for beamforming to work. The deinterleaved API only works with floating point samples.
* echo-cancel: webrtc canceller supports different in/out channel countsArun Raghavan2016-02-252-7/+9
| | | | Needed for upcoming beamforming code.
* echo-cancel: Improve webrtc canceller error handling a bitArun Raghavan2016-02-251-4/+8
|
* echo-cancel: Fix webrtc canceller when rec channels != play channelsArun Raghavan2016-02-252-14/+14
| | | | | | The calculations around how many samples were sent to the canceller engine was not updated when we started supporting different channel counts for playback and capture.
* echo-cancel: Make webrtc AGC start volume a modargArun Raghavan2016-02-251-3/+16
| | | | Allows for tuning based on the target hardware.
* echo-cancel: Use anonymous unions for echo canceller paramsArun Raghavan2016-02-255-70/+71
| | | | Makes this part of the code just a little less verbose.
* echo-cancel: Add a modarg toggle for VAD in the webrtc cancellerArun Raghavan2016-02-251-2/+11
|
* echo-cancel: Allow enabling of the webrtc experimental AGC mechanismArun Raghavan2016-02-251-1/+11
|
* echo-cancel: Start capture at a sane volume if we're doing webrtc AGCArun Raghavan2016-02-252-1/+14
| | | | | This is required to make sure the capture output has sufficient energy for the AGC to do its job.
* echo-cancel: Deal with volume limit breakage in webrtc AGCArun Raghavan2016-02-251-4/+21
| | | | | | The AGC code no longer seems to honour the analog volume limits we set, and internally uses 0-255 as the volume range. So we switch to use that (keeping the old API usage as is in case this gets fixed upstream).
* echo-cancel: Allow enabling tracing output from the webrtc cancellerArun Raghavan2016-02-252-1/+41
|
* echo-cancel: Mark private function as staticArun Raghavan2016-02-251-3/+3
|
* echo-cancel: Add a modarg to use sink/source master format and specArun Raghavan2016-02-251-7/+26
| | | | | | | | | | | | This allows us to inherit the sample spec parameters from the sink and source master (rather than forcing 32 kHz / mono). It is still possible to override some of the parameters for the source side with modargs. My original testing showed that these parameters provided a decent perf/quality trade-off on lower end hardware (which I no longer have access to). I figure it makes sense to continue with that for now, and in the future this can be relaxed (use_master_format=yes could be the default, and resource-constrained systems can disable it).
* echo-cancel: Express restrictions correctly on webrtc AEC stream configArun Raghavan2016-02-251-8/+27
| | | | | | | | | | In the refactoring, I'm expressing the constraints in what I see to be a more natural way -- rec_ss expresses what we're feeding the canceller, so it makes sense to apply the constraints on what the canceller accepts there. This then propagates to the output spec. This also exposes the range of sample rates that the library actually supports (8, 16, 32 and 48 kHz).
* echo-cancel: Canceller may use different spec for playback and captureArun Raghavan2016-02-241-1/+3
| | | | | | | | | The original intention was to configure low enough parameters to keep CPU consumption down. Prior to this change, we assumed that the EC backend would override the sink parameters based on the source parameters to achieve this goal, and with this change we remove that assumption by forcing the default parameters for the sink to be low enough.
* echo-cancel: Add some bits for webrtc intelligibility enhancerTanu Kaskinen2016-02-241-2/+18
| | | | | | | | | | It's not possible to enable the intelligibility enhancer at the moment, because the feature would require modifying the audio that we play to speakers, which we don't do currently. All audio processing is done at the source side, and it's not easy to change that. This patch is based on Arun Raghavan's code, I just reordered things a bit and reworded the FIXME comment.
* echo-cancel: Allow enabling the extended filter in webrtc AECArun Raghavan2016-02-241-2/+14
| | | | | | | | | This creates a longer filter that is more complex and less sensitive to incorrect delay reporting from the hardware. There is also a delay-agnostic mode that can eventually be enabled if required. In some very quick testing, not enabling this seems to provide better results during double-talk.
* echo-cancel: Update webrtc-audio-processing usage to new APIArun Raghavan2016-02-241-25/+29
| | | | | The code now needs C++11 support to compile with the updated webrtc-audio-processing library.
* modules: Fix compiler warning comparing 0 with boolPeter Meerwald2016-02-181-1/+1
| | | | | | | | | | modules/module-stream-restore.c: In function 'clean_up_db': modules/module-stream-restore.c:2344:74: warning: comparison of constant '0' with boolean expression is always true [-Wbool-compare] pa_assert_se(entry_write(u, item->entry_name, item->entry, true) >= 0); reported by Ubuntu gcc-6 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
* role-ducking: Fix improper unducking behavior in case of operating globallySangchul Lee2016-02-181-1/+17
| | | | | | | | Fix improper unducking behavior when using this module with "global=1" argument. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=93994 Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
* coreaudio: Catch devices with more channels than we supportArun Raghavan2016-02-121-0/+10
|
* coreaudio: Dynamically allocate C string when converting from CFStringArun Raghavan2016-02-121-27/+31
|
* rescue-streams : Fix a typoJungsup Lee2016-02-021-1/+1
| | | | | | Fix a typo in log message. Signed-off-by: Jungsup Lee <jungsup4.lee@samsung.com>
* device-manager: improve logging about non-existing dataTanu Kaskinen2016-01-261-2/+4
| | | | | | | | | | | | | Previously a missing key would cause this kind of log output: D: [pulseaudio] module-device-manager.c: Database contains invalid data for key: sink:auto_null (probably pre-v1.0 data) D: [pulseaudio] module-device-manager.c: Attempting to load legacy (pre-v1.0) data for key: sink:auto_null D: [pulseaudio] module-device-manager.c: Size does not match. D: [pulseaudio] module-device-manager.c: Unable to load legacy (pre-v1.0) data for key: sink:auto_null. Ignoring. That is now replaced with D: [pulseaudio] module-device-manager.c: Database contains no data for key: sink:auto_null
* solaris: Catch up with newer APIJonathan Perkin2016-01-221-3/+9
| | | | | | | Patch upstreamed from pkgsrc by Kamil Rytarowski <n54@gmx.com>. See commit e4a7625ba884c5cce20468d75937857343751c35 for why this was originally done.
* bluetooth: Prevent aborts caused by invalid module argumentsJason Gerecke2016-01-152-3/+5
| | | | | | | | | If 'pa_modargs_new' returns a NULL, we need to be careful to not call 'pa_modargs_free' in the failure path since it requires that we pass it a non-null argument. Also updates 'module-bluetooth-policy.c:pa__init' to follow the standard "goto fail" pattern used everywhere else. Signed-off-by: Jason Gerecke <killertofu@gmail.com>