rpi: add custom asound.state
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 20 Jan 2023 00:33:55 +0000 (19:33 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 1 Mar 2023 17:10:15 +0000 (12:10 -0500)
To have a usable working volume near 100%.

raspberrypi/recipes-bsp/alsa-state/alsa-state.bbappend
raspberrypi/recipes-bsp/alsa-state/alsa-state/asound.state [new file with mode: 0644]

index 50dd875..84de203 100644 (file)
@@ -1,3 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI:append:raspberrypi = " \
+     file://asound.state \
+"
+
 do_install:append:raspberrypi() {
     echo "defaults.pcm.card 1" >> ${D}${sysconfdir}/asound.conf
     echo "defaults.ctl.card 1" >> ${D}${sysconfdir}/asound.conf
diff --git a/raspberrypi/recipes-bsp/alsa-state/alsa-state/asound.state b/raspberrypi/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644 (file)
index 0000000..399860b
--- /dev/null
@@ -0,0 +1,159 @@
+state.vc4hdmi {
+       control.1 {
+               iface PCM
+               name 'Playback Channel Map'
+               value.0 0
+               value.1 0
+               value.2 0
+               value.3 0
+               value.4 0
+               value.5 0
+               value.6 0
+               value.7 0
+               comment {
+                       access read
+                       type INTEGER
+                       count 8
+                       range '0 - 36'
+               }
+       }
+       control.2 {
+               iface PCM
+               name 'IEC958 Playback Mask'
+               value ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+       control.3 {
+               iface PCM
+               name 'IEC958 Playback Default'
+               value '0400000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.4 {
+               iface PCM
+               name ELD
+               value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read volatile'
+                       type BYTES
+                       count 128
+               }
+       }
+}
+state.ALSA {
+       control.1 {
+               iface MIXER
+               name 'PCM Playback Volume'
+               value -10
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 1
+                       range '-10239 - 400'
+                       dbmin -9999999
+                       dbmax 400
+                       dbvalue.0 -10
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'PCM Playback Switch'
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+       control.3 {
+               iface MIXER
+               name 'PCM Playback Route'
+               value 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 1
+                       range '0 - 3'
+               }
+       }
+       control.4 {
+               iface PCM
+               name 'IEC958 Playback Default'
+               value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access 'read write'
+                       type IEC958
+                       count 1
+               }
+       }
+       control.5 {
+               iface PCM
+               name 'IEC958 Playback Con Mask'
+               value '0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
+               comment {
+                       access read
+                       type IEC958
+                       count 1
+               }
+       }
+}
+state.b1 {
+       control.1 {
+               iface MIXER
+               name 'HDMI Playback Volume'
+               value 0
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 1
+                       range '-10239 - 400'
+                       dbmin -9999999
+                       dbmax 400
+                       dbvalue.0 0
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'HDMI Playback Switch'
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+}
+state.Headphones {
+       control.1 {
+               iface MIXER
+               name 'Headphone Playback Volume'
+               value -2000
+               comment {
+                       access 'read write'
+                       type INTEGER
+                       count 1
+                       range '-10239 - 400'
+                       dbmin -9999999
+                       dbmax 400
+                       dbvalue.0 -2000
+               }
+       }
+       control.2 {
+               iface MIXER
+               name 'Headphone Playback Switch'
+               value true
+               comment {
+                       access 'read write'
+                       type BOOLEAN
+                       count 1
+               }
+       }
+}