In symbols like "bcm2708_i2s_of_match" what does the "of" bit stand for ? I'm sure things would be clearer if I was reading/saying the symbol names correctly in my head

PeterO
Ah, I was expecting it to be something more "functional"PhilE wrote:The "of" is short for Open Firmware, a Sun BIOS/ACPI alternative.
Code: Select all
target = <&sound>;
__overlay__ {
...whatever...
};
Code: Select all
target = <&soc>;
__overlay__ {
soundinput {
...whatever...
};
};
Code: Select all
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
[email protected] {
target = <&sound>;
__overlay__ {
compatible = "simple-audio-card";
simple-audio-card,name = "PiBell";
status="okay";
capture_link: simple-audio-card,[email protected] {
format = "i2s";
r_cpu_dai: cpu {
sound-dai = <&i2s>;
/* example TDM slot configuration
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
*/
};
r_codec_dai: codec {
sound-dai = <&codec_in>;
};
};
playback_link: simple-audio-card,[email protected] {
format = "i2s";
p_cpu_dai: cpu {
sound-dai = <&i2s>;
/* example TDM slot configuration
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
*/
};
p_codec_dai: codec {
sound-dai = <&codec_out>;
};
};
};
};
[email protected] {
target-path = "/";
__overlay__ {
codec_out: spdif-transmitter {
#address-cells = <0>;
#size-cells = <0>;
#sound-dai-cells = <0>;
compatible = "linux,spdif-dit";
status = "okay";
};
codec_in: card-codec {
#sound-dai-cells = <0>;
compatible = "invensense,ics43432";
status = "okay";
};
};
};
[email protected] {
target = <&i2s>;
__overlay__ {
#sound-dai-cells = <0>;
status = "okay";
};
};
};
Code: Select all
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
# dtparam=audio=on
start_x=1
gpu_mem=128
# I2S Peripherals
dtoverlay=pibell,alsaname=PiBell
Code: Select all
pcm.dmic_hw{
type hw
card PiBell
device 1
subdevice 0
channels 2
format S32_LE
}
pcm.dmic_sv{
type softvol
slave.pcm dmic_hw
control {
name "Boost"
card PiBell
}
min_dB -3.0
max_dB 50.0
}
Code: Select all
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.64
!!################################
!!Script ran on: Tue Feb 27 19:45:59 UTC 2018
!!Linux Distribution
!!------------------
ID_LIKE=debian
!!DMI Information
!!---------------
Manufacturer:
Product Name:
Product Version:
Firmware Version:
!!Kernel Information
!!------------------
Kernel release: 4.9.59-v7+
Operating System: GNU/Linux
Architecture: armv7l
Processor: unknown
SMP Enabled: Yes
!!ALSA Version
!!------------
Driver version: k4.9.59-v7+
Library version: 1.1.3
Utilities version: 1.1.3
!!Loaded ALSA modules
!!-------------------
snd_soc_simple_card
!!Sound Servers on this system
!!----------------------------
Jack:
Installed - Yes (/usr/bin/jackd)
Running - No
!!Soundcards recognised by ALSA
!!-----------------------------
0 [PiBell ]: PiBell - PiBell
PiBell
!!Modprobe options (Sound related)
!!--------------------------------
snd_pcsp: index=-2
snd_usb_audio: index=-2
snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
!!Loaded sound module options
!!---------------------------
!!Module: snd_soc_simple_card
* :
!!ALSA Device nodes
!!-----------------
crw-rw---- 1 root audio 116, 0 Feb 26 20:43 /dev/snd/controlC0
crw-rw---- 1 root audio 116, 16 Feb 26 20:43 /dev/snd/pcmC0D0p
crw-rw---- 1 root audio 116, 25 Feb 26 20:43 /dev/snd/pcmC0D1c
crw-rw---- 1 root audio 116, 1 Feb 26 20:43 /dev/snd/seq
crw-rw---- 1 root audio 116, 33 Feb 26 20:43 /dev/snd/timer
/dev/snd/by-path:
total 0
drwxr-xr-x 2 root root 60 Feb 26 20:43 .
drwxr-xr-x 3 root root 160 Feb 26 20:43 ..
lrwxrwxrwx 1 root root 12 Feb 26 20:43 platform-soc:sound -> ../controlC0
!!ALSA configuration files
!!------------------------
!!User specific config file (~/.asoundrc)
pcm.dmic_hw{
type hw
card PiBell
device 1
subdevice 0
channels 2
format S32_LE
}
pcm.dmic_sv{
type softvol
slave.pcm dmic_hw
control {
name "Boost"
card PiBell
}
min_dB -3.0
max_dB 50.0
}
!!Aplay/Arecord output
!!--------------------
APLAY
**** List of PLAYBACK Hardware Devices ****
card 0: PiBell [PiBell], device 0: bcm2835-i2s-dit-hifi dit-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
ARECORD
**** List of CAPTURE Hardware Devices ****
card 0: PiBell [PiBell], device 1: bcm2835-i2s-ics43432-hifi ics43432-hifi-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
!!Amixer output
!!-------------
!!-------Mixer controls for card 0 [PiBell]
Card hw:0 'PiBell'/'PiBell'
Mixer name : ''
Components : ''
Controls : 1
Simple ctrls : 1
Simple mixer control 'PCM',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 255
Front Left: 255 [100%]
Front Right: 255 [100%]
!!Alsactl output
!!--------------
--startcollapse--
state.PiBell {
control.1 {
iface MIXER
name PCM
value.0 255
value.1 255
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '0000000100000008ffffec1400000014'
dbmin -5100
dbmax 0
dbvalue.0 0
dbvalue.1 0
}
}
}
--endcollapse--
!!All Loaded Modules
!!------------------
Module
binfmt_misc
rfcomm
cmac
bnep
hci_uart
btbcm
bluetooth
brcmfmac
brcmutil
cfg80211
rfkill
snd_soc_simple_card
snd_soc_spdif_tx
snd_soc_simple_card_utils
snd_soc_bcm2835_i2s
ics43432
snd_soc_core
snd_compress
snd_pcm_dmaengine
bcm2835_gpiomem
snd_pcm
snd_timer
snd
fixed
uio_pdrv_genirq
uio
i2c_dev
ip_tables
x_tables
ipv6
!!ALSA/HDA dmesg
!!--------------
[ 3.080084] ics43432: loading out-of-tree module taints kernel.
[ 3.176079] asoc-simple-card soc:sound: dit-hifi <-> 3f203000.i2s mapping ok
[ 3.177231] asoc-simple-card soc:sound: ics43432-hifi <-> 3f203000.i2s mapping ok
[ 3.329370] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
Code: Select all
arecord -Dhw:PiBell,1 -c2 -r48000 -fS32_LE -twav -d10 -Vstereo test.wav
Code: Select all
$ aplay -v test.wav
Playing WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
Plug PCM: Linear conversion PCM (S24_LE)
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S32_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 32
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
Slave: Hardware PCM card 0 'PiBell' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S24_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 32
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
appl_ptr : 0
hw_ptr : 0
Congratulations on a real achievement - Device Tree is tricky enough to start with, adding overlays makes it harder still, and ALSA can be the final straw.So I crafted a DTS file to enable both devices in a single simple-audio-card overlay , compiled and installed it and now I can both record audio and play back via the speaker!!
What do I win?
You left NOOB territory many miles ago - this is advanced stuff, and I'm going to have to do some research to understand the problem unless HiassofT sees our plight and takes pity on us.Yours in anticipation of learning how much of a NOOB I am in this area...
Code: Select all
pcm.dmic_sv{
type softvol
slave {
pcm "dmic_hw"
}
control {
name "Boost"
card 0
}
min_dB -3.0
max_dB 50.0
}
Code: Select all
pcm.mems_mic {
type hw
card "PiBell"
device 1
subdevice 0
channels 2
rate 48000
format S32_LE
}
pcm.mems_mic_l {
type dsnoop
ipc_key 3153086
ipc_key_add_uid true
slave {
pcm "mems_mic"
channels 2
}
bindings.0 0
}
pcm.mems_mic_r {
type dsnoop
ipc_key 4498692
ipc_key_add_uid true
slave {
pcm "mems_mic"
channels 2
}
bindings.0 1
}
Code: Select all
arecord -Dmems_mic_l -r48000 -fS32_LE -v -twav -d5 test.wav
Code: Select all
pcm.mems_mic {
type hw
card "PiBell"
device 1
subdevice 0
channels 2
rate 48000
format S32_LE
}
pcm.mems_mic_l {
type dsnoop
ipc_key 3153086
ipc_key_add_uid true
slave {
pcm "mems_mic"
channels 2
}
bindings.0 0
}
pcm.mems_mic_r {
type dsnoop
ipc_key 4498692
ipc_key_add_uid true
slave {
pcm "mems_mic"
channels 2
}
bindings.0 1
}
pcm.mems_mic_softvol_l {
type softvol
slave {
pcm "mems_mic_l"
}
control {
name "Boost Capture Volume"
card "PiBell"
}
min_dB -3.0
max_dB 30.0
}
Code: Select all
$ arecord -Dmems_mic_softvol_l -r48000 -fS32_LE -v -twav -d5 test.wav
Code: Select all
$ aplay -v test.wav
Playing WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Mono
Plug PCM: Route conversion PCM (sformat=S24_LE)
Transformation table:
0 <- 0
1 <- 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S32_LE
subformat : STD
channels : 1
rate : 48000
exact rate : 48000 (48000/1)
msbits : 32
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
Slave: Hardware PCM card 0 'PiBell' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : MMAP_INTERLEAVED
format : S24_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 32
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 24000
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
appl_ptr : 0
hw_ptr : 0
Code: Select all
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.64
!!################################
!!Script ran on: Wed Feb 28 18:37:18 UTC 2018
!!Linux Distribution
!!------------------
ID_LIKE=debian
!!DMI Information
!!---------------
Manufacturer:
Product Name:
Product Version:
Firmware Version:
!!Kernel Information
!!------------------
Kernel release: 4.9.59-v7+
Operating System: GNU/Linux
Architecture: armv7l
Processor: unknown
SMP Enabled: Yes
!!ALSA Version
!!------------
Driver version: k4.9.59-v7+
Library version: 1.1.3
Utilities version: 1.1.3
!!Loaded ALSA modules
!!-------------------
snd_soc_simple_card
!!Sound Servers on this system
!!----------------------------
Jack:
Installed - Yes (/usr/bin/jackd)
Running - No
!!Soundcards recognised by ALSA
!!-----------------------------
0 [PiBell ]: PiBell - PiBell
PiBell
!!Modprobe options (Sound related)
!!--------------------------------
snd_pcsp: index=-2
snd_usb_audio: index=-2
snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
!!Loaded sound module options
!!---------------------------
!!Module: snd_soc_simple_card
* :
!!ALSA Device nodes
!!-----------------
crw-rw---- 1 root audio 116, 0 Feb 28 18:28 /dev/snd/controlC0
crw-rw---- 1 root audio 116, 16 Feb 28 18:28 /dev/snd/pcmC0D0p
crw-rw---- 1 root audio 116, 25 Feb 28 18:28 /dev/snd/pcmC0D1c
crw-rw---- 1 root audio 116, 1 Feb 28 18:28 /dev/snd/seq
crw-rw---- 1 root audio 116, 33 Feb 28 18:28 /dev/snd/timer
/dev/snd/by-path:
total 0
drwxr-xr-x 2 root root 60 Feb 28 18:28 .
drwxr-xr-x 3 root root 160 Feb 28 18:28 ..
lrwxrwxrwx 1 root root 12 Feb 28 18:28 platform-soc:sound -> ../controlC0
!!ALSA configuration files
!!------------------------
!!User specific config file (~/.asoundrc)
pcm.mems_mic {
type hw
card "PiBell"
device 1
subdevice 0
channels 2
rate 48000
format S32_LE
}
pcm.mems_mic_l {
type dsnoop
ipc_key 3153086
ipc_key_add_uid true
slave {
pcm "mems_mic"
channels 2
}
bindings.0 0
}
pcm.mems_mic_r {
type dsnoop
ipc_key 4498692
ipc_key_add_uid true
slave {
pcm "mems_mic"
channels 2
}
bindings.0 1
}
pcm.mems_mic_softvol_l {
type softvol
slave {
pcm "mems_mic_l"
}
control {
name "Boost Capture Volume"
card "PiBell"
}
min_dB -3.0
max_dB 30.0
}
!!Aplay/Arecord output
!!--------------------
APLAY
**** List of PLAYBACK Hardware Devices ****
card 0: PiBell [PiBell], device 0: bcm2835-i2s-dit-hifi dit-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
ARECORD
**** List of CAPTURE Hardware Devices ****
card 0: PiBell [PiBell], device 1: bcm2835-i2s-ics43432-hifi ics43432-hifi-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
!!Amixer output
!!-------------
!!-------Mixer controls for card 0 [PiBell]
Card hw:0 'PiBell'/'PiBell'
Mixer name : ''
Components : ''
Controls : 2
Simple ctrls : 2
Simple mixer control 'PCM',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 255
Front Left: 255 [100%]
Front Right: 255 [100%]
Simple mixer control 'Boost',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 255
Front Left: Capture 199 [78%] [20.88dB]
Front Right: Capture 199 [78%] [20.88dB]
!!Alsactl output
!!--------------
--startcollapse--
state.PiBell {
control.1 {
iface MIXER
name PCM
value.0 255
value.1 255
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '0000000100000008ffffec1400000014'
dbmin -5100
dbmax 0
dbvalue.0 0
dbvalue.1 0
}
}
control.2 {
iface MIXER
name 'Boost Capture Volume'
value.0 199
value.1 199
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '0000000100000008fffffed40000000c'
dbmin -300
dbmax 2760
dbvalue.0 2088
dbvalue.1 2088
}
}
}
--endcollapse--
!!All Loaded Modules
!!------------------
Module
rfcomm
cmac
bnep
hci_uart
btbcm
bluetooth
brcmfmac
brcmutil
cfg80211
rfkill
snd_soc_spdif_tx
snd_soc_simple_card
snd_soc_simple_card_utils
snd_soc_bcm2835_i2s
ics43432
snd_soc_core
bcm2835_gpiomem
snd_compress
snd_pcm_dmaengine
snd_pcm
snd_timer
snd
uio_pdrv_genirq
uio
fixed
i2c_dev
ip_tables
x_tables
ipv6
!!ALSA/HDA dmesg
!!--------------
[ 3.044366] ics43432: loading out-of-tree module taints kernel.
[ 3.101486] asoc-simple-card soc:sound: dit-hifi <-> 3f203000.i2s mapping ok
[ 3.102410] asoc-simple-card soc:sound: ics43432-hifi <-> 3f203000.i2s mapping ok
[ 3.255384] brcmfmac: F1 signature read @0x18000000=0x1541a9a6