Skip to content

Commit

Permalink
Decouple the detail of PA loopback from C source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Jerram committed Dec 29, 2012
1 parent 3421839 commit 16c09ed
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
5 changes: 5 additions & 0 deletions devices/gta04/src/plugins/audiohardware/neo/a3/paLoopGsmToEar
@@ -0,0 +1,5 @@
#!/bin/sh
exec pactl load-module module-loopback \
source=alsa_input.platform-soc-audio.1.analog-mono \
rate=8000 \
sink=alsa_output.platform-soc-audio.0.analog-stereo.echo-cancel
5 changes: 5 additions & 0 deletions devices/gta04/src/plugins/audiohardware/neo/a3/paLoopMicToGsm
@@ -0,0 +1,5 @@
#!/bin/sh
exec pactl load-module module-loopback \
source=alsa_input.platform-soc-audio.0.analog-stereo.echo-cancel \
rate=8000 \
sink=alsa_output.platform-soc-audio.1.analog-mono
10 changes: 2 additions & 8 deletions devices/gta04/src/plugins/audiohardware/neo/neoaudioplugin.cpp
Expand Up @@ -202,16 +202,10 @@ static bool gsmVoiceStart()
if (moduleIdGsmToEar.isEmpty()) {

// Start loopback from the modem to the earpiece.
moduleIdGsmToEar =
backtick("pactl load-module module-loopback"
" source=alsa_input.platform-soc-audio.1.analog-mono rate=8000"
" sink=alsa_output.platform-soc-audio.0.analog-stereo.echo-cancel");
moduleIdGsmToEar = backtick("/opt/qtmoko/bin/paLoopGsmToEar");

// Start loopback from the microphone to the modem.
moduleIdMicToGsm =
backtick("pactl load-module module-loopback"
" source=alsa_input.platform-soc-audio.0.analog-stereo.echo-cancel"
" sink=alsa_output.platform-soc-audio.1.analog-mono rate=8000");
moduleIdMicToGsm = backtick("/opt/qtmoko/bin/paLoopMicToGsm");
}

return true;
Expand Down
7 changes: 7 additions & 0 deletions devices/gta04/src/plugins/audiohardware/neo/qbuild.pro
Expand Up @@ -23,3 +23,10 @@ confa3 [
path=/etc/alsa/a3
]
INSTALLS+=confa3

confa3scr [
hint=script
files=a3/paLoopGsmToEar a3/paLoopMicToGsm
path=/bin
]
INSTALLS+=confa3scr

0 comments on commit 16c09ed

Please sign in to comment.