From 3421839f1448f81ae04cb34063321246d31b9b43 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Thu, 6 Dec 2012 21:11:46 +0000 Subject: [PATCH] Recreate accidentally lost recording function My ALSA state rework accidentally lost recording function, e.g. as used by the Voice Notes application. This commit recreates it. I thought it might be possible for the default Media state - normally MediaSpeaker - to handle both playback and recording. But this produces a nasty feedback loop, because Pulseaudio is by default always looping the default source (i.e. the microphone) back to the default sink (i.e. the speaker). Therefore the default MediaSpeaker can't have the microphone switch open, and therefore we need a separate state, MediaRecording, to handle recording. How then, does an application such as Voice Notes get the MediaRecording state installed? My guess is that it happens automatically when any applications uses a QAudioInput, so long as all the states have their Input/Output capabilities correctly defined. --- .../audiohardware/neo/a3/MediaRecording.state | 706 ++++++++++++++++++ .../audiohardware/neo/a4/MediaRecording.state | 706 ++++++++++++++++++ .../audiohardware/neo/neoaudioplugin.cpp | 23 +- 3 files changed, 1431 insertions(+), 4 deletions(-) create mode 100644 devices/gta04/src/plugins/audiohardware/neo/a3/MediaRecording.state create mode 100644 devices/gta04/src/plugins/audiohardware/neo/a4/MediaRecording.state diff --git a/devices/gta04/src/plugins/audiohardware/neo/a3/MediaRecording.state b/devices/gta04/src/plugins/audiohardware/neo/a3/MediaRecording.state new file mode 100644 index 000000000..8a395b11b --- /dev/null +++ b/devices/gta04/src/plugins/audiohardware/neo/a3/MediaRecording.state @@ -0,0 +1,706 @@ +state.gta04 { + control.1 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Option 2 (voice/audio)' + comment.item.1 'Option 1 (audio)' + iface MIXER + name 'Codec Operation Mode' + value 'Option 1 (audio)' + } + control.2 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 63' + comment.dbmin -6300 + comment.dbmax 0 + iface MIXER + name 'DAC1 Digital Fine Playback Volume' + value.0 0 + value.1 0 + } + control.3 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 63' + comment.dbmin -6300 + comment.dbmax 0 + iface MIXER + name 'DAC2 Digital Fine Playback Volume' + value.0 0 + value.1 0 + } + control.4 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 2' + comment.dbmin 0 + comment.dbmax 1200 + iface MIXER + name 'DAC1 Digital Coarse Playback Volume' + value.0 0 + value.1 0 + } + control.5 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 2' + comment.dbmin 0 + comment.dbmax 1200 + iface MIXER + name 'DAC2 Digital Coarse Playback Volume' + value.0 0 + value.1 0 + } + control.6 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC1 Analog Playback Volume' + value.0 0 + value.1 0 + } + control.7 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC2 Analog Playback Volume' + value.0 0 + value.1 0 + } + control.8 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 2 + iface MIXER + name 'DAC1 Analog Playback Switch' + value.0 false + value.1 false + } + control.9 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 2 + iface MIXER + name 'DAC2 Analog Playback Switch' + value.0 false + value.1 false + } + control.10 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 49' + comment.dbmin -3700 + comment.dbmax 1200 + iface MIXER + name 'DAC Voice Digital Downlink Volume' + value 0 + } + control.11 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC Voice Analog Downlink Volume' + value 0 + } + control.12 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'DAC Voice Analog Downlink Switch' + value false + } + control.13 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'PreDriv Playback Volume' + value.0 0 + value.1 0 + } + control.14 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'Headset Playback Volume' + value.0 0 + value.1 0 + } + control.15 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'Carkit Playback Volume' + value.0 0 + value.1 0 + } + control.16 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 3' + comment.dbmin -600 + comment.dbmax 1200 + iface MIXER + name 'Earpiece Playback Volume' + value 0 + } + control.17 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 31' + comment.dbmin 0 + comment.dbmax 3100 + iface MIXER + name 'TX1 Digital Capture Volume' + value.0 0 + value.1 0 + } + control.18 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 31' + comment.dbmin 0 + comment.dbmax 3100 + iface MIXER + name 'TX2 Digital Capture Volume' + value.0 0 + value.1 0 + } + control.19 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 5' + comment.dbmin 0 + comment.dbmax 3000 + iface MIXER + name 'Analog Capture Volume' + value.0 5 + value.1 5 + } + control.20 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Voice high priority' + comment.item.1 'HiFi high priority' + iface MIXER + name 'AVADC Clock Priority' + value 'HiFi high priority' + } + control.21 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Voice to SoC' + comment.item.1 'Voice to twl4030' + iface MIXER + name 'Voice route' + value 'Voice to SoC' + } + control.22 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 '27/20/14 ms' + comment.item.1 '55/40/27 ms' + comment.item.2 '109/81/55 ms' + comment.item.3 '218/161/109 ms' + comment.item.4 '437/323/218 ms' + comment.item.5 '874/645/437 ms' + comment.item.6 '1748/1291/874 ms' + comment.item.7 '3495/2581/1748 ms' + iface MIXER + name 'HS ramp delay' + value '27/20/14 ms' + } + control.23 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Vibra H-bridge direction' + comment.item.1 'Audio data MSB' + iface MIXER + name 'Vibra H-bridge mode' + value 'Audio data MSB' + } + control.24 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Positive polarity' + comment.item.1 'Negative polarity' + iface MIXER + name 'Vibra H-bridge direction' + value 'Positive polarity' + } + control.25 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Not swapped' + comment.item.1 Swapped + iface MIXER + name 'Digimic LR Swap' + value 'Not swapped' + } + control.26 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Right Sub Mic Capture Switch' + value false + } + control.27 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Right AUXR Capture Switch' + value false + } + control.28 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left Main Mic Capture Switch' + value true + } + control.29 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left Headset Mic Capture Switch' + value false + } + control.30 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left AUXL Capture Switch' + value false + } + control.31 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left Carkit Mic Capture Switch' + value false + } + control.32 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Analog + comment.item.1 Digimic1 + iface MIXER + name 'TX2 Capture Route' + value Digimic1 + } + control.33 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Analog + comment.item.1 Digimic0 + iface MIXER + name 'TX1 Capture Route' + value Analog + } + control.34 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Local vibrator' + comment.item.1 Audio + iface MIXER + name 'Vibra Route' + value 'Local vibrator' + } + control.35 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 AudioL1 + comment.item.1 AudioR1 + comment.item.2 AudioL2 + comment.item.3 AudioR2 + iface MIXER + name 'Vibra Mux' + value AudioL2 + } + control.36 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HandsfreeR Switch' + value true + } + control.37 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Voice + comment.item.1 AudioR1 + comment.item.2 AudioR2 + comment.item.3 AudioL2 + iface MIXER + name 'HandsfreeR Mux' + value AudioR2 + } + control.38 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HandsfreeL Switch' + value false + } + control.39 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Voice + comment.item.1 AudioL1 + comment.item.2 AudioL2 + comment.item.3 AudioR2 + iface MIXER + name 'HandsfreeL Mux' + value AudioL2 + } + control.40 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitR Mixer Voice' + value false + } + control.41 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitR Mixer AudioR1' + value false + } + control.42 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitR Mixer AudioR2' + value false + } + control.43 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitL Mixer Voice' + value false + } + control.44 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitL Mixer AudioL1' + value false + } + control.45 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitL Mixer AudioL2' + value false + } + control.46 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetR Mixer Voice' + value false + } + control.47 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetR Mixer AudioR1' + value false + } + control.48 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetR Mixer AudioR2' + value false + } + control.49 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetL Mixer Voice' + value false + } + control.50 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetL Mixer AudioL1' + value false + } + control.51 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetL Mixer AudioL2' + value false + } + control.52 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer Voice' + value false + } + control.53 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer AudioR1' + value false + } + control.54 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer AudioR2' + value false + } + control.55 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer AudioL2' + value false + } + control.56 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer Voice' + value false + } + control.57 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer AudioL1' + value false + } + control.58 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer AudioL2' + value false + } + control.59 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer AudioR2' + value false + } + control.60 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer Voice' + value false + } + control.61 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer AudioL1' + value false + } + control.62 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer AudioL2' + value false + } + control.63 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer AudioR1' + value false + } + control.64 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 41' + comment.dbmin -5100 + comment.dbmax -1000 + iface MIXER + name 'Voice Digital Loopback Volume' + value 0 + } + control.65 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 7' + comment.dbmin -3000 + comment.dbmax 0 + iface MIXER + name 'Right Digital Loopback Volume' + value 0 + } + control.66 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 7' + comment.dbmin -3000 + comment.dbmax 0 + iface MIXER + name 'Left Digital Loopback Volume' + value 0 + } + control.67 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Voice Analog Loopback Switch' + value false + } + control.68 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Left2 Analog Loopback Switch' + value false + } + control.69 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Right2 Analog Loopback Switch' + value false + } + control.70 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Left1 Analog Loopback Switch' + value false + } + control.71 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Right1 Analog Loopback Switch' + value false + } +} +state.gta04voice { + control { + } +} +state.gta04headset { + control { + } +} +state.gta04fm { + control.1 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 255' + comment.dbmin -12750 + comment.dbmax 0 + iface MIXER + name 'Digital Playback Volume' + value.0 204 + value.1 204 + } + control.2 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name Deemphasis + value false + } +} diff --git a/devices/gta04/src/plugins/audiohardware/neo/a4/MediaRecording.state b/devices/gta04/src/plugins/audiohardware/neo/a4/MediaRecording.state new file mode 100644 index 000000000..076211d6d --- /dev/null +++ b/devices/gta04/src/plugins/audiohardware/neo/a4/MediaRecording.state @@ -0,0 +1,706 @@ +state.gta04 { + control.1 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Option 2 (voice/audio)' + comment.item.1 'Option 1 (audio)' + iface MIXER + name 'Codec Operation Mode' + value 'Option 1 (audio)' + } + control.2 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 63' + comment.dbmin -6300 + comment.dbmax 0 + iface MIXER + name 'DAC1 Digital Fine Playback Volume' + value.0 0 + value.1 0 + } + control.3 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 63' + comment.dbmin -6300 + comment.dbmax 0 + iface MIXER + name 'DAC2 Digital Fine Playback Volume' + value.0 0 + value.1 0 + } + control.4 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 2' + comment.dbmin 0 + comment.dbmax 1200 + iface MIXER + name 'DAC1 Digital Coarse Playback Volume' + value.0 0 + value.1 0 + } + control.5 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 2' + comment.dbmin 0 + comment.dbmax 1200 + iface MIXER + name 'DAC2 Digital Coarse Playback Volume' + value.0 0 + value.1 0 + } + control.6 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC1 Analog Playback Volume' + value.0 0 + value.1 0 + } + control.7 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC2 Analog Playback Volume' + value.0 0 + value.1 0 + } + control.8 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 2 + iface MIXER + name 'DAC1 Analog Playback Switch' + value.0 false + value.1 false + } + control.9 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 2 + iface MIXER + name 'DAC2 Analog Playback Switch' + value.0 false + value.1 false + } + control.10 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 49' + comment.dbmin -3700 + comment.dbmax 1200 + iface MIXER + name 'DAC Voice Digital Downlink Volume' + value 0 + } + control.11 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC Voice Analog Downlink Volume' + value 0 + } + control.12 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'DAC Voice Analog Downlink Switch' + value false + } + control.13 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'PreDriv Playback Volume' + value.0 0 + value.1 0 + } + control.14 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'Headset Playback Volume' + value.0 0 + value.1 0 + } + control.15 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'Carkit Playback Volume' + value.0 0 + value.1 0 + } + control.16 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 3' + comment.dbmin -600 + comment.dbmax 1200 + iface MIXER + name 'Earpiece Playback Volume' + value 0 + } + control.17 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 31' + comment.dbmin 0 + comment.dbmax 3100 + iface MIXER + name 'TX1 Digital Capture Volume' + value.0 0 + value.1 0 + } + control.18 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 31' + comment.dbmin 0 + comment.dbmax 3100 + iface MIXER + name 'TX2 Digital Capture Volume' + value.0 31 + value.1 31 + } + control.19 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 5' + comment.dbmin 0 + comment.dbmax 3000 + iface MIXER + name 'Analog Capture Volume' + value.0 3 + value.1 3 + } + control.20 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Voice high priority' + comment.item.1 'HiFi high priority' + iface MIXER + name 'AVADC Clock Priority' + value 'Voice high priority' + } + control.21 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Voice to SoC' + comment.item.1 'Voice to twl4030' + iface MIXER + name 'Voice route' + value 'Voice to twl4030' + } + control.22 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 '27/20/14 ms' + comment.item.1 '55/40/27 ms' + comment.item.2 '109/81/55 ms' + comment.item.3 '218/161/109 ms' + comment.item.4 '437/323/218 ms' + comment.item.5 '874/645/437 ms' + comment.item.6 '1748/1291/874 ms' + comment.item.7 '3495/2581/1748 ms' + iface MIXER + name 'HS ramp delay' + value '27/20/14 ms' + } + control.23 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Vibra H-bridge direction' + comment.item.1 'Audio data MSB' + iface MIXER + name 'Vibra H-bridge mode' + value 'Audio data MSB' + } + control.24 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Positive polarity' + comment.item.1 'Negative polarity' + iface MIXER + name 'Vibra H-bridge direction' + value 'Positive polarity' + } + control.25 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Not swapped' + comment.item.1 Swapped + iface MIXER + name 'Digimic LR Swap' + value 'Not swapped' + } + control.26 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Right Sub Mic Capture Switch' + value false + } + control.27 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Right AUXR Capture Switch' + value false + } + control.28 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left Main Mic Capture Switch' + value true + } + control.29 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left Headset Mic Capture Switch' + value false + } + control.30 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left AUXL Capture Switch' + value false + } + control.31 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Analog Left Carkit Mic Capture Switch' + value false + } + control.32 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Analog + comment.item.1 Digimic1 + iface MIXER + name 'TX2 Capture Route' + value Digimic1 + } + control.33 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Analog + comment.item.1 Digimic0 + iface MIXER + name 'TX1 Capture Route' + value Analog + } + control.34 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Local vibrator' + comment.item.1 Audio + iface MIXER + name 'Vibra Route' + value 'Local vibrator' + } + control.35 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 AudioL1 + comment.item.1 AudioR1 + comment.item.2 AudioL2 + comment.item.3 AudioR2 + iface MIXER + name 'Vibra Mux' + value AudioL2 + } + control.36 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HandsfreeR Switch' + value true + } + control.37 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Voice + comment.item.1 AudioR1 + comment.item.2 AudioR2 + comment.item.3 AudioL2 + iface MIXER + name 'HandsfreeR Mux' + value AudioR2 + } + control.38 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HandsfreeL Switch' + value false + } + control.39 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 Voice + comment.item.1 AudioL1 + comment.item.2 AudioL2 + comment.item.3 AudioR2 + iface MIXER + name 'HandsfreeL Mux' + value AudioL2 + } + control.40 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitR Mixer Voice' + value false + } + control.41 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitR Mixer AudioR1' + value false + } + control.42 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitR Mixer AudioR2' + value false + } + control.43 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitL Mixer Voice' + value false + } + control.44 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitL Mixer AudioL1' + value false + } + control.45 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'CarkitL Mixer AudioL2' + value false + } + control.46 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetR Mixer Voice' + value false + } + control.47 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetR Mixer AudioR1' + value false + } + control.48 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetR Mixer AudioR2' + value false + } + control.49 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetL Mixer Voice' + value false + } + control.50 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetL Mixer AudioL1' + value false + } + control.51 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'HeadsetL Mixer AudioL2' + value false + } + control.52 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer Voice' + value false + } + control.53 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer AudioR1' + value false + } + control.54 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer AudioR2' + value false + } + control.55 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveR Mixer AudioL2' + value false + } + control.56 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer Voice' + value false + } + control.57 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer AudioL1' + value false + } + control.58 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer AudioL2' + value false + } + control.59 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'PredriveL Mixer AudioR2' + value false + } + control.60 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer Voice' + value false + } + control.61 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer AudioL1' + value false + } + control.62 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer AudioL2' + value false + } + control.63 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Earpiece Mixer AudioR1' + value false + } + control.64 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 41' + comment.dbmin -5100 + comment.dbmax -1000 + iface MIXER + name 'Voice Digital Loopback Volume' + value 0 + } + control.65 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 7' + comment.dbmin -3000 + comment.dbmax 0 + iface MIXER + name 'Right Digital Loopback Volume' + value 2 + } + control.66 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 7' + comment.dbmin -3000 + comment.dbmax 0 + iface MIXER + name 'Left Digital Loopback Volume' + value 7 + } + control.67 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Voice Analog Loopback Switch' + value false + } + control.68 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Left2 Analog Loopback Switch' + value false + } + control.69 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Right2 Analog Loopback Switch' + value false + } + control.70 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Left1 Analog Loopback Switch' + value false + } + control.71 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'Right1 Analog Loopback Switch' + value false + } +} +state.gta04voice { + control { + } +} +state.gta04headset { + control { + } +} +state.gta04fm { + control.1 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 255' + comment.dbmin -12750 + comment.dbmax 0 + iface MIXER + name 'Digital Playback Volume' + value.0 204 + value.1 204 + } + control.2 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name Deemphasis + value false + } +} diff --git a/devices/gta04/src/plugins/audiohardware/neo/neoaudioplugin.cpp b/devices/gta04/src/plugins/audiohardware/neo/neoaudioplugin.cpp index 34f95a688..16fc1e763 100644 --- a/devices/gta04/src/plugins/audiohardware/neo/neoaudioplugin.cpp +++ b/devices/gta04/src/plugins/audiohardware/neo/neoaudioplugin.cpp @@ -257,9 +257,20 @@ QAudioStateInfo StateFileAudioState::info() const QAudio::AudioCapabilities StateFileAudioState::capabilities() const { - return (QAudio::InputOnly | - QAudio::OutputOnly | - QAudio::InputAndOutput); + if (m_info.domain() == "Phone") { + /* All Phone states do both input and output. */ + return (QAudio::InputOnly | + QAudio::OutputOnly | + QAudio::InputAndOutput); + } + else if (m_info.profile() == "Recording") { + /* Recording states do input only. */ + return (QAudio::InputOnly); + } + else { + /* All other states do output only. */ + return (QAudio::OutputOnly); + } } bool StateFileAudioState::isAvailable() const @@ -556,7 +567,7 @@ QAudioStatePlugin(parent) m_data->m_states. push_back(new StateFileAudioState("Phone", "Speaker", 4, this)); - /* Priority ordering for media: Headset (if available), + /* Priority ordering for media playback: Headset (if available), Bluetooth (if available), Speaker, Earpiece. */ m_data->m_states. push_back(new HeadsetAudioState("Media", 1, this)); @@ -569,6 +580,10 @@ QAudioStatePlugin(parent) m_data->m_states. push_back(new StateFileAudioState("Media", "Earpiece", 4, this)); + /* Recording when in the Media domain. */ + m_data->m_states. + push_back(new StateFileAudioState("Media", "Recording", 5, this)); + /* Priority ordering for ringtone is the same as for media, but BluetoothAudioState doesn't yet support the Ringtone domain. */ m_data->m_states.