diff --git a/device/community/device-pine64-pinephonepro/90-modem-eg25.rules b/device/community/device-pine64-pinephonepro/90-modem-eg25.rules new file mode 100644 index 000000000..2f62b3e0f --- /dev/null +++ b/device/community/device-pine64-pinephonepro/90-modem-eg25.rules @@ -0,0 +1,12 @@ +SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}" + +SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="01", SYMLINK+="EG25.NMEA", MODE="0660" +SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="02", SYMLINK+="EG25.AT", MODE="0660" +SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="03", SYMLINK+="EG25.MODEM", MODE="0660" + +ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="02", RUN+="/usr/bin/pinephone_setup-modem '%E{DEVNAME}'" + +ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTRS{serial}=="0123456789ABCDEF", ATTR{power/persist}="1", ATTR{power/control}="on" + +ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTRS{serial}=="community_fw", ATTR{power/persist}="1", ATTR{power/control}="on" + diff --git a/device/community/device-pine64-pinephonepro/APKBUILD b/device/community/device-pine64-pinephonepro/APKBUILD index 186708a0e..f4f8fed60 100644 --- a/device/community/device-pine64-pinephonepro/APKBUILD +++ b/device/community/device-pine64-pinephonepro/APKBUILD @@ -2,8 +2,8 @@ # Maintainer: Martijn Braam pkgname=device-pine64-pinephonepro pkgdesc="PINE64 PinePhone Pro" -pkgver=2.1 -pkgrel=2 +pkgver=3.0 +pkgrel=0 url="https://postmarketos.org" license="MIT" arch="aarch64" @@ -31,13 +31,15 @@ install=" $pkgname.post-upgrade " source=" + 90-modem-eg25.rules deviceinfo grub.cfg grub_early.cfg ucm/HiFi.conf - ucm/PinePhonePro.conf + ucm/PINE64-PinePhonePro-.conf ucm/VoiceCall.conf ppkb.sh + setup-modem.sh " build() { @@ -74,16 +76,24 @@ build() { package() { devicepkg_package $startdir $pkgname + # Grub / bootloader install -Dm644 -t "$pkgdir"/boot/grub \ "$srcdir"/grub.cfg install -Dm644 -t "$pkgdir"/boot/EFI/Boot \ "$srcdir"/bootaa64.efi + # Alsa usecase manager config install -Dm644 -t "$pkgdir"/usr/share/alsa/ucm2/conf.d/simple-card \ - "$srcdir"/PinePhonePro.conf \ + "$srcdir"/PINE64-PinePhonePro-.conf \ "$srcdir"/HiFi.conf \ "$srcdir"/VoiceCall.conf + # Modem + install -Dm755 "$srcdir"/setup-modem.sh \ + "$pkgdir"/usr/bin/pinephone_setup-modem + install -Dm644 "$srcdir"/90-modem-eg25.rules -t \ + "$pkgdir"/usr/lib/udev/rules.d/ + # Keyboard config install -Dm755 "$srcdir"/ppkb.sh "$pkgdir"/etc/profile.d/ppkb.sh } @@ -101,11 +111,13 @@ nonfree_firmware() { } sha512sums=" +fdfa807c0de33aee3deb09ee25c37a58fa970ce71483e52f21793717cb89adeb74f251ff1a2c2086361e3e58877f8b2e5643f24186b1a537acf9c16e3419313c 90-modem-eg25.rules 195ea87f346e09b781d7925bcb7752a25d27f4396e1512ae15582526c062261516f918703c633730f56becb9f5c94020cc46ef6dc9d960b4a29208f03e3b70b8 deviceinfo e69752fc7f2b8552ba2e1e6da5b6bec0e284c7f14bc09576c862faeb5154a44522535a919ae5aca33a22fd14557e802595a7c96c59b9362c5ac5b991a8eac5fc grub.cfg 0f9357d4eea089628fbceb1e3e96d21a3f4329aeb6743158a6f877f967ef274506404eba949d5f01b7e1adea149f9a3aef992a5e8cd4181f93ab00909b1c5ecd grub_early.cfg -ac22c856af81d00aa6a349b68cf9e8645bf38277d9aafd07f1f46f5f932f48d37b9dfdcc8772fff4027f914c9b4c3b4a11c51bd9f2aa1abbc53abd3f54adb818 HiFi.conf -c57dae885c9a5f366f18b38a3ce3e21627baaf014724537eced9e8d6ac3ca61ade42b9fcf84db350b1e64742760e8cf4fe10639d41052387927238e85c3c4769 PinePhonePro.conf -e978876bda8874e30df75c80554ccbbc0dd202c852ecae0b5c1a0d845402a630962afc2691c6f7d5f478fb0e4be045af4ef62ad0b1ce77f62fe2f155dc0a9cff VoiceCall.conf +1684514a6b814a83473e9da8855fd776cf3f31a2be1f8834c370f710428b4ee305559e275be52894d167ccd1e32f8f1c8586f8a072f19e44b46caec9f504d453 HiFi.conf +71786596492f3ec176806a2f85b974cb13ca1482cd695a2ebc480c29a86d2ff47b0386776b8d7f8ed56c1f8c48886e15f583c4bb9811240ef8b486527b4bbd89 PINE64-PinePhonePro-.conf +deb360baf914e1c917403d5e26291b9e9d27426876232ab753e4ebfe367423206f1fc01b85d195aa69fb4b51bcaed023423d0fcc0d73fa1bedd5fbe7b17f0fb5 VoiceCall.conf 43f67e94491791685cdbb4874bb3034b1d297bdf3d23e7405c45ba8c58de72b4fb6a9943b79f46ef7b8f4dbc4d9db254ebec8eb3453d720a5a8fad277c6a9d88 ppkb.sh +420ee1d7522d4d56c2909580fd6ba7580483ca5455b13eb6d22e700063ce0c1a5c6d2f5b161dfce0d777636fe9a712aa82f38a0585f2feabea3785b02bae7515 setup-modem.sh " diff --git a/device/community/device-pine64-pinephonepro/setup-modem.sh b/device/community/device-pine64-pinephonepro/setup-modem.sh new file mode 100644 index 000000000..71c894a30 --- /dev/null +++ b/device/community/device-pine64-pinephonepro/setup-modem.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +log() { + echo "$@" | logger -t "postmarketOS:modem-setup" +} + +QMBNCFG_CONFIG="1" + +if [ -z "$1" ] +then + DEV="/dev/EG25.AT" +else + DEV="$1" +fi + +# Read current config +QMBNCFG_ACTUAL_CONFIG=$(echo 'AT+QMBNCFG="AutoSel"' | atinout - $DEV -) + +if echo $QMBNCFG_ACTUAL_CONFIG | grep -q $QMBNCFG_CONFIG +then + log "Modem already configured" + exit 0 +fi + + +# Configure VoLTE auto selecting profile +RET=$(echo "AT+QMBNCFG=\"AutoSel\",$QMBNCFG_CONFIG" | atinout - $DEV -) +if ! echo $RET | grep -q OK +then + log "Failed to enable VoLTE profile auto selecting: $RET" + exit 1 +fi diff --git a/device/community/device-pine64-pinephonepro/ucm/HiFi.conf b/device/community/device-pine64-pinephonepro/ucm/HiFi.conf index 5de545bb4..3a125a905 100644 --- a/device/community/device-pine64-pinephonepro/ucm/HiFi.conf +++ b/device/community/device-pine64-pinephonepro/ucm/HiFi.conf @@ -1,10 +1,15 @@ SectionVerb { EnableSequence [ - ### Default rt5640 configuration, copied from /codecs/rt5640/EnableSeq.conf ### + # First of all, disable the internal speaker amplifier + cset "name='Internal Speaker Switch' off" + + ### Based on /codecs/rt5640/EnableSeq.conf ### # RT5640 default output routing cset "name='DAC MIXL INF1 Switch' on" cset "name='DAC MIXR INF1 Switch' on" + cset "name='DAC MIXL Stereo ADC Switch' off" + cset "name='DAC MIXR Stereo ADC Switch' off" cset "name='Stereo DAC MIXL DAC L1 Switch' on" cset "name='Stereo DAC MIXR DAC R1 Switch' on" cset "name='Stereo DAC MIXL DAC L2 Switch' on" @@ -34,23 +39,29 @@ SectionVerb { cset "name='Mono ADC R2 Mux' DMIC R1" cset "name='Mono ADC Capture Switch' on" + # Set capture volume to 0dB so modem audio doesn't overdrive the ADC + cset "name='ADC Capture Volume' 47" + cset "name='Mono ADC Capture Volume' 47" + # The second 'Mono ADC' path does not have a 'Boost Gain', # set this to 0dB so that the volume of the AIF1 and AIF2 paths is equal. cset "name='ADC Boost Gain' 0" - # Set IN1/IN3 internal mic boost to 8 (max) + # Set IN1 internal mic boost to 8 (max) # Set IN2 headset-mic boost to 1, headset mics are quite loud + # Set IN3 (modem audio) boost to 0 as it's already loud enough cset "name='IN1 Boost' 8" cset "name='IN2 Boost' 1" - # cset "name='IN3 Boost' 8" + cset "name='IN3 Boost' 0" # Start with all controls which are used by the individual # input/output Enable/DisableSequences off cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" - cset "name='RECMIXL BST2 Switch' off" - cset "name='RECMIXR BST2 Switch' off" + # IN2 is headset mic, make sure its route is enabled + cset "name='RECMIXL BST2 Switch' on" + cset "name='RECMIXR BST2 Switch' on" cset "name='RECMIXL BST3 Switch' off" cset "name='RECMIXR BST3 Switch' off" @@ -63,6 +74,9 @@ SectionVerb { cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" + # Limit amplification factor of earpiece amplifier so sound stays clear + cset "name='Class D SPK Ratio Control' 1.66x" + # Turn off playback switches by default, otherwise both Speaker # and headphones are playing audio initially until headphones are # re-inserted. @@ -71,26 +85,27 @@ SectionVerb { cset "name='Speaker L Playback Switch' off" cset "name='Speaker R Playback Switch' off" - ### PinePhonePro specific configuration ### - - # Set capture volume to 0dB so modem audio doesn't overdrive the ADC - cset "name='ADC Capture Volume' 47" - cset "name='Mono ADC Capture Volume' 47" - # Modem audio is line level, no need to boost this signal - cset "name='IN3 Boost' 0" - # MONO output is used as IN3 here, so make sure it's disabled cset "name='Mono Playback Switch' off" # Set playback volumes to 0dB cset "name='HP Playback Volume' 31" cset "name='Speaker Playback Volume' 31" - - # Limit amplification factor of earpiece amplifier so sound stays clear - cset "name='Class D SPK Ratio Control' 1.66x" ] DisableSequence [ + # Turn off all output channels + cset "name='HP L Playback Switch' off" + cset "name='HP R Playback Switch' off" + cset "name='HP Channel Switch' off" + cset "name='HPO MIX HPVOL Switch' off" + cset "name='Speaker L Playback Switch' off" + cset "name='Speaker R Playback Switch' off" + cset "name='Speaker Channel Switch' off" + cset "name='SPOL MIX SPKVOL L Switch' off" + cset "name='SPOL MIX SPKVOL R Switch' off" + + # Reset output routing cset "name='DAC MIXL INF1 Switch' off" cset "name='DAC MIXR INF1 Switch' off" @@ -109,6 +124,7 @@ SectionDevice."Earpiece" { Comment "Internal Earpiece" ConflictingDevice [ + "Headphones" "Speaker" ] @@ -142,6 +158,39 @@ SectionDevice."Speaker" { ConflictingDevice [ "Earpiece" + "Headphones" + ] + + EnableSequence [ + cset "name='HPO MIX HPVOL Switch' on" + cset "name='HP Channel Switch' on" + cset "name='HP L Playback Switch' on" + cset "name='HP R Playback Switch' on" + cset "name='Internal Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Internal Speaker Switch' off" + cset "name='HP Channel Switch' off" + cset "name='HP L Playback Switch' off" + cset "name='HP R Playback Switch' off" + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "HP" + PlaybackVolume "HP Playback Volume" + PlaybackMasterElem "DAC1" + } +} + +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Earpiece" + "Speaker" ] EnableSequence [ @@ -160,16 +209,20 @@ SectionDevice."Speaker" { Value { PlaybackPriority 300 PlaybackPCM "hw:${CardId}" - JackControl "Headphone Jack" + JackControl "Headphones Jack" PlaybackMixerElem "HP" PlaybackVolume "HP Playback Volume" PlaybackMasterElem "DAC1" } } -SectionDevice."DigitalMic" { +SectionDevice."Mic" { Comment "Internal Microphone" + ConflictingDevice [ + "Headset" + ] + EnableSequence [ cset "name='Mono ADC MIXL ADC2 Switch' on" cset "name='Mono ADC MIXR ADC2 Switch' on" @@ -185,10 +238,41 @@ SectionDevice."DigitalMic" { ] Value { - CapturePriority 200 + CapturePriority 100 CapturePCM "hw:${CardId}" CaptureMixerElem "ADC" CaptureVolume "ADC Capture Volume" CaptureSwitch "ADC Capture Switch" } } + +SectionDevice."Headset" { + Comment "Headset Microphone" + + ConflictingDevice [ + "Mic" + ] + + EnableSequence [ + cset "name='Mono ADC MIXL ADC1 Switch' on" + cset "name='Mono ADC MIXR ADC1 Switch' on" + cset "name='Stereo ADC MIXL ADC1 Switch' on" + cset "name='Stereo ADC MIXR ADC1 Switch' on" + ] + + DisableSequence [ + cset "name='Mono ADC MIXL ADC1 Switch' off" + cset "name='Mono ADC MIXR ADC1 Switch' off" + cset "name='Stereo ADC MIXL ADC1 Switch' off" + cset "name='Stereo ADC MIXR ADC1 Switch' off" + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId}" + JackControl "Headphones Jack" + CaptureMixerElem "ADC" + CaptureVolume "ADC Capture Volume" + CaptureSwitch "ADC Capture Switch" + } +} diff --git a/device/community/device-pine64-pinephonepro/ucm/PinePhonePro.conf b/device/community/device-pine64-pinephonepro/ucm/PINE64-PinePhonePro-.conf similarity index 90% rename from device/community/device-pine64-pinephonepro/ucm/PinePhonePro.conf rename to device/community/device-pine64-pinephonepro/ucm/PINE64-PinePhonePro-.conf index c183543d8..18b544a8f 100644 --- a/device/community/device-pine64-pinephonepro/ucm/PinePhonePro.conf +++ b/device/community/device-pine64-pinephonepro/ucm/PINE64-PinePhonePro-.conf @@ -6,7 +6,7 @@ SectionUseCase."HiFi" { Comment "Default" } -SectionUseCase."VoiceCall" { +SectionUseCase."Voice Call" { File "VoiceCall.conf" Comment "Phone call" } diff --git a/device/community/device-pine64-pinephonepro/ucm/VoiceCall.conf b/device/community/device-pine64-pinephonepro/ucm/VoiceCall.conf index ea37145cc..25bceade5 100644 --- a/device/community/device-pine64-pinephonepro/ucm/VoiceCall.conf +++ b/device/community/device-pine64-pinephonepro/ucm/VoiceCall.conf @@ -1,18 +1,23 @@ SectionVerb { EnableSequence [ - ### Default rt5640 configuration, copied from /codecs/rt5640/EnableSeq.conf ### + # First of all, disable the internal speaker amplifier + cset "name='Internal Speaker Switch' off" - # RT5640 default output routing - # cset "name='DAC MIXL INF1 Switch' on" - # cset "name='DAC MIXR INF1 Switch' on" + ### Based on /codecs/rt5640/EnableSeq.conf ### + + # Get audio only from the microphones, not the system + cset "name='DAC MIXL INF1 Switch' off" + cset "name='DAC MIXR INF1 Switch' off" + cset "name='DAC MIXL Stereo ADC Switch' on" + cset "name='DAC MIXR Stereo ADC Switch' on" cset "name='Stereo DAC MIXL DAC L1 Switch' on" cset "name='Stereo DAC MIXR DAC R1 Switch' on" cset "name='Stereo DAC MIXL DAC L2 Switch' on" cset "name='Stereo DAC MIXR DAC R2 Switch' on" - # cset "name='OUT MIXL DAC L1 Switch' on" - # cset "name='OUT MIXR DAC R1 Switch' on" - # cset "name='SPK MIXL DAC L1 Switch' on" - # cset "name='SPK MIXR DAC R1 Switch' on" + cset "name='OUT MIXL DAC L1 Switch' off" + cset "name='OUT MIXR DAC R1 Switch' off" + cset "name='SPK MIXL DAC L1 Switch' off" + cset "name='SPK MIXR DAC R1 Switch' off" # uncomment to enable swap between AIF1 and AIF2 # warning: can only work with SSP0 firmware enabled @@ -34,25 +39,32 @@ SectionVerb { cset "name='Mono ADC R2 Mux' DMIC R1" cset "name='Mono ADC Capture Switch' on" + # Set capture volume to 0dB so modem audio doesn't overdrive the ADC + cset "name='ADC Capture Volume' 47" + cset "name='Mono ADC Capture Volume' 47" + # The second 'Mono ADC' path does not have a 'Boost Gain', # set this to 0dB so that the volume of the AIF1 and AIF2 paths is equal. cset "name='ADC Boost Gain' 0" - # Set IN1/IN3 internal mic boost to 8 (max) + # Set IN1 internal mic boost to 8 (max) # Set IN2 headset-mic boost to 1, headset mics are quite loud + # Set IN3 (modem audio) boost to 0 as it's already loud enough cset "name='IN1 Boost' 8" cset "name='IN2 Boost' 1" - # cset "name='IN3 Boost' 8" + cset "name='IN3 Boost' 0" # Start with all controls which are used by the individual # input/output Enable/DisableSequences off cset "name='RECMIXL BST1 Switch' off" cset "name='RECMIXR BST1 Switch' off" - # cset "name='RECMIXL BST2 Switch' off" + # IN2 is headset mic, make sure its routed to the left channel + cset "name='RECMIXL BST2 Switch' on" cset "name='RECMIXR BST2 Switch' off" + # IN3 is modem audio, route it to the right channel cset "name='RECMIXL BST3 Switch' off" - # cset "name='RECMIXR BST3 Switch' off" + cset "name='RECMIXR BST3 Switch' on" cset "name='Stereo ADC MIXL ADC1 Switch' off" cset "name='Stereo ADC MIXR ADC1 Switch' off" @@ -63,40 +75,6 @@ SectionVerb { cset "name='Mono ADC MIXL ADC2 Switch' off" cset "name='Mono ADC MIXR ADC2 Switch' off" - # Turn off playback switches by default, otherwise both Speaker - # and headphones are playing audio initially until headphones are - # re-inserted. - cset "name='HP L Playback Switch' off" - cset "name='HP R Playback Switch' off" - cset "name='Speaker L Playback Switch' off" - cset "name='Speaker R Playback Switch' off" - - ### PinePhonePro specific configuration ### - - # Get audio only from the microphones, not the system - cset "name='DAC MIXL INF1 Switch' off" - cset "name='DAC MIXR INF1 Switch' off" - cset "name='DAC MIXL Stereo ADC Switch' on" - cset "name='DAC MIXR Stereo ADC Switch' on" - - # Route headset mic to the left channel and modem audio - # to the right channel - cset "name='RECMIXL BST2 Switch' on" - cset "name='RECMIXR BST3 Switch' on" - - # Set capture volume to 0dB so modem audio doesn't overdrive the ADC - cset "name='ADC Capture Volume' 47" - cset "name='Mono ADC Capture Volume' 47" - # Modem audio is line level, no need to boost this signal - cset "name='IN3 Boost' 0" - - # MONO output is used as IN3 here, so make sure it's disabled - cset "name='Mono Playback Switch' off" - - # Set playback volumes to 0dB - cset "name='HP Playback Volume' 31" - cset "name='Speaker Playback Volume' 31" - # Limit amplification factor of earpiece amplifier so sound stays clear cset "name='Class D SPK Ratio Control' 1.66x" @@ -112,13 +90,35 @@ SectionVerb { cset "name='LOUT MIX OUTVOL L Switch' off" cset "name='LOUT MIX OUTVOL R Switch' off" - # Disable left channel for SPK (earpiece) and HP (speaker/headphones) - # outputs as we're only routing modem audio to the right channel - cset "name='SPOL MIX SPKVOL L Switch' off" + # Disable left channel for HP (speaker/headphones) output + # as we're only routing modem audio to the right channel cset "name='HP L Playback Switch' off" + + # Turn off playback switches by default, otherwise both Speaker + # and headphones are playing audio initially until headphones are + # re-inserted. + cset "name='HP L Playback Switch' off" + cset "name='HP R Playback Switch' off" + cset "name='Speaker L Playback Switch' off" + cset "name='Speaker R Playback Switch' off" + + # MONO output is used as IN3 here, so make sure it's disabled + cset "name='Mono Playback Switch' off" + + # Set playback volumes to 0dB + cset "name='HP Playback Volume' 31" + cset "name='Speaker Playback Volume' 31" ] DisableSequence [ + # Turn off all output channels + cset "name='HP L Playback Switch' off" + cset "name='HP R Playback Switch' off" + cset "name='HP Channel Switch' off" + cset "name='Speaker L Playback Switch' off" + cset "name='Speaker R Playback Switch' off" + cset "name='Speaker Channel Switch' off" + # Reset output routing cset "name='DAC MIXL Stereo ADC Switch' off" cset "name='DAC MIXR Stereo ADC Switch' off" @@ -140,10 +140,12 @@ SectionDevice."Earpiece" { Comment "Internal Earpiece" ConflictingDevice [ + "Headphones" "Speaker" ] EnableSequence [ + cset "name='SPOL MIX SPKVOL L Switch' on" # Send right channel to left as it's mono only cset "name='SPOL MIX SPKVOL R Switch' on" cset "name='Speaker Channel Switch' on" @@ -156,7 +158,7 @@ SectionDevice."Earpiece" { ] Value { - PlaybackPriority 300 + PlaybackPriority 200 PlaybackPCM "hw:${CardId}" PlaybackMixerElem "Speaker" PlaybackVolume "Speaker Playback Volume" @@ -169,10 +171,41 @@ SectionDevice."Speaker" { ConflictingDevice [ "Earpiece" + "Headphones" ] EnableSequence [ - cset "name='HPO MIX HPVOL Switch' on" + cset "name='HPO MIX HPVOL Switch' on" + cset "name='HP Channel Switch' on" + cset "name='HP R Playback Switch' on" + cset "name='Internal Speaker Switch' on" + ] + + DisableSequence [ + cset "name='Internal Speaker Switch' off" + cset "name='HP Channel Switch' off" + cset "name='HP R Playback Switch' off" + ] + + Value { + PlaybackPriority 100 + PlaybackPCM "hw:${CardId}" + PlaybackMixerElem "HP" + PlaybackVolume "HP Playback Volume" + PlaybackMasterElem "DAC1" + } +} + +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Earpiece" + "Speaker" + ] + + EnableSequence [ + cset "name='HPO MIX HPVOL Switch' on" cset "name='HP Channel Switch' on" cset "name='HP R Playback Switch' on" ] @@ -183,18 +216,22 @@ SectionDevice."Speaker" { ] Value { - PlaybackPriority 100 + PlaybackPriority 300 PlaybackPCM "hw:${CardId}" - JackControl "Headphone Jack" + JackControl "Headphones Jack" PlaybackMixerElem "HP" PlaybackVolume "HP Playback Volume" PlaybackMasterElem "DAC1" } } -SectionDevice."DigitalMic" { +SectionDevice."Mic" { Comment "Internal Microphone" + ConflictingDevice [ + "Headset" + ] + EnableSequence [ cset "name='Stereo ADC MIXL ADC2 Switch' on" ] @@ -204,7 +241,7 @@ SectionDevice."DigitalMic" { ] Value { - CapturePriority 200 + CapturePriority 100 CapturePCM "hw:${CardId}" CaptureMixerElem "ADC" CaptureVolume "ADC Capture Volume" @@ -212,9 +249,13 @@ SectionDevice."DigitalMic" { } } -SectionDevice."HeadsetMic" { +SectionDevice."Headset" { Comment "Headset Microphone" + ConflictingDevice [ + "Mic" + ] + EnableSequence [ cset "name='Stereo ADC MIXL ADC1 Switch' on" ] @@ -224,8 +265,9 @@ SectionDevice."HeadsetMic" { ] Value { - CapturePriority 100 + CapturePriority 200 CapturePCM "hw:${CardId}" + JackControl "Headphones Jack" CaptureMixerElem "ADC" CaptureVolume "ADC Capture Volume" CaptureSwitch "ADC Capture Switch"