The snd_bcm2835.enable_compat_alsa option:
enable_compat_alsa:Enables ALSA compatibility virtual audio device (bool)
is off these days, since the beginning of 2020 apparently.
Reference:
raspi-config (20200120) buster; urgency=medium
* Add audio switching for discrete internal ALSA devices
-- Simon Long <simon@raspberrypi.org> Mon, 20 Jan 2020 11:38:37 +0000
The "sysclk = 24000000" value is supposed to come from the "clock-frequency"
field of ac108_mclk / ac10x_mclk, but somehow it isn't on 5.4 (vs 4.19). This
is a temporary work-around. For some strange unknown reasons, this affects
only the square 4-mic device, but not the linear 4-mic nor the 6-mics device.
The other two devices have two ac108's, and seem to work fine without it.
In v4.19:
seeed_voice_card_probe [snd_soc_seeed_voicecard]
-> devm_snd_soc_register_card [snd_soc_core]
-> snd_soc_register_card [snd_soc_core]
-> seeed_voice_card_dai_init [snd_soc_seeed_voicecard]
-> asoc_simple_card_init_dai [snd_soc_simple_card_utils]
-> snd_soc_dai_set_sysclk [snd_soc_core]
-> ac108_set_sysclk [snd_soc_ac108]
In 5.4:
seeed_voice_card_probe [snd_soc_seeed_voicecard]
-> devm_snd_soc_register_card [snd_soc_core]
-> snd_soc_register_card [snd_soc_core]
-> snd_soc_instantiate_card [snd_soc_core]
-> seeed_voice_card_dai_init [snd_soc_seeed_voicecard]
-> asoc_simple_init_dai.part.0 [snd_soc_seeed_voicecard]
-> snd_soc_dai_set_sysclk [snd_soc_core]
-> ac108_set_sysclk [snd_soc_ac108]
Which results in the "ac108_set_sysclk :24000000" kernel message.
Note the extra snd_soc_instantiate_card(), and the copied/renamed
asoc_simple_init_dai() - it became static and not-available to other drivers
in v5.x.
See https://github.com/respeaker/seeed-voicecard/issues/246
The "-c 1" was simply wrong. The default (-c 0) sound device of
older kernel / alsa has a numid=3 selector for auto vs headphone vs hdmi .
Newer kernel simply has multiple devices. Also, headphone is -c 0 .
$ amixer contents
numid=2,iface=MIXER,name='Headphone Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1,iface=MIXER,name='Headphone Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
: values=-2000
| dBscale-min=-102.39dB,step=0.01dB,mute=1
TODO: For now, broadly dividing by kernel v4.x vs v5.x is good enough, but
it would be nice to find out when / which kernel /alsa this is relevant.
closes https://github.com/respeaker/seeed-voicecard/issues/240
It was made private in v5.2:
commit ad934ca8010843482d61fda46786449a9bc99e10
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:55:52 2019 +0900
ASoC: simple-card-utils: share asoc_simple_dai_init()
The init code was extracted into asoc_simple_card_init_priv(), with
additional comments.
commit 65a5056b21202eff7f54243e587183f4bb6ed352
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed Mar 20 13:56:26 2019 +0900
ASoC: simple-card-utils: share asoc_simple_card_init_priv()
The difference between simple-card / audio-graph are just using
OF graph style, or not. In other words, other things should be same.
This means, simple-card/audio-graph common functions should be
implemented at simple-card-utils, and its own functions should be
implemented at each files.
Current simple-card / audio-graph are initializing each priv,
but it is same operation.
This patch adds new asoc_simple_card_init_priv() and initialize
priv by same operation.
commit f107294c6422e772773b53dbf802186175b6289e
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu Jun 6 13:07:35 2019 +0900
ASoC: simple-card: support snd_soc_dai_link_component style for cpu
ASoC supports modern style dai_link (= snd_soc_dai_link_component) for
CPU. legacy style dai_link (= cpu_dai_name, cpu_name, cpu_of_node) are
no longer needed.
This patch switches to modern style.
commit 910fdcabedd2354d161b1beab6ad7dc7e859651d
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon Jan 21 09:32:32 2019 +0900
ASoC: soc-core: add .num_platform for dai_link
Current snd_soc_dai_link is starting to use snd_soc_dai_link_component
(= modern) style for Platform, but it is still assuming single Platform
so far. We will need to have multi Platform support in the not far
future.
Currently only simple card is using it as sound card driver,
and other drivers are converted to it from legacy style by
snd_soc_init_platform().
To avoid future problem of multi Platform support, let's add
num_platforms before it is too late.
In the same time, to make it same naming mothed, "platform" should
be "platforms". This patch fixup it too.
commit e58f41e41185c6906bd11c73c4e76aa5fc3ea685
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Fri Aug 31 03:10:33 2018 +0000
ASoC: simple-card: support snd_soc_dai_link_component style for platform
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for platform.
commit 710af9196ce614ee02185c2ec55e617a71843183
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Fri Aug 31 03:08:24 2018 +0000
ASoC: simple-card: support snd_soc_dai_link_component style for codec
Current ASoC is supporting snd_soc_dai_link_component for binding,
it is more useful than current legacy style.
Currently only codec is supporting it as multicodec (= codecs).
CPU will support multi style in the future.
We want to have it on Platform too in the future.
If all Codec/CPU/Platform are replaced into snd_soc_dai_link_component
style, we can remove legacy complex style.
This patch supports snd_soc_dai_link_component style
for simple-card for codec.
commit 294f69e662d1570703e9b56e95be37a9fd3afba5
Author: Joe Perches <joe@perches.com>
Date: Sat Oct 5 09:46:42 2019 -0700
compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use
commit 294f69e662d1570703e9b56e95be37a9fd3afba5
Author: Joe Perches <joe@perches.com>
Date: Sat Oct 5 09:46:42 2019 -0700
compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use
See include/linux/compiler_attributes.h:
/*
* Add the pseudo keyword 'fallthrough' so case statement blocks
* must end with any of these keywords:
* break;
* fallthrough;
* goto <label>;
* return [expression];
*
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
*/
-if __has_attribute(__fallthrough__)
- define fallthrough __attribute__((__fallthrough__))
-else
- define fallthrough do {} while (0) /* fallthrough */
-endif
See include/linux/compiler_attributes.h:
/*
* Add the pseudo keyword 'fallthrough' so case statement blocks
* must end with any of these keywords:
* break;
* fallthrough;
* goto <label>;
* return [expression];
*
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
*/
-if __has_attribute(__fallthrough__)
- define fallthrough __attribute__((__fallthrough__))
-else
- define fallthrough do {} while (0) /* fallthrough */
-endif
The whole warning is quite long but looks like this:
CC [M] seeed-voicecard/ac108.o
In file included from ./include/linux/printk.h:331,
from ./include/linux/kernel.h:15,
from ./include/linux/list.h:9,
from ./include/linux/module.h:12,
from seeed-voicecard/ac108.c:15:
seeed-voicecard/ac108.c: In function ‘ac108_set_fmt’:
./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]
122 | #define __dynamic_func_call(id, fmt, func, ...) do { \
| ^
./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
143 | __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:157:2: note: in expansion of macro ‘_dynamic_func_call’
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
./include/linux/device.h:1795:2: note: in expansion of macro ‘dynamic_dev_dbg’
1795 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
seeed-voicecard/ac108.c:866:4: note: in expansion of macro ‘dev_dbg’
866 | dev_dbg(dai->dev, "used as slave when AC101 is master\n");
| ^~~~~~~
seeed-voicecard/ac108.c:868:2: note: here
868 | case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/
| ^~~~
The semi-colon is needed, to prevent the comment being parsed as part of the "if {...}" statement.
The warning looks like this:
seeed-voicecard/wm8960.c: In function ‘wm8960_hw_params’:
seeed-voicecard/wm8960.c:752:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
752 | if ((iface & 0x3) != 0) {
| ^
seeed-voicecard/wm8960.c:757:2: note: here
757 | default:
| ^~~~~~~
The whole warning is quite long but looks like this:
CC [M] seeed-voicecard/ac108.o
In file included from ./include/linux/printk.h:331,
from ./include/linux/kernel.h:15,
from ./include/linux/list.h:9,
from ./include/linux/module.h:12,
from seeed-voicecard/ac108.c:15:
seeed-voicecard/ac108.c: In function ‘ac108_set_fmt’:
./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]
122 | #define __dynamic_func_call(id, fmt, func, ...) do { \
| ^
./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
143 | __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:157:2: note: in expansion of macro ‘_dynamic_func_call’
157 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
./include/linux/device.h:1795:2: note: in expansion of macro ‘dynamic_dev_dbg’
1795 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
seeed-voicecard/ac108.c:866:4: note: in expansion of macro ‘dev_dbg’
866 | dev_dbg(dai->dev, "used as slave when AC101 is master\n");
| ^~~~~~~
seeed-voicecard/ac108.c:868:2: note: here
868 | case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/
| ^~~~
The semi-colon is needed, to prevent the comment being parsed as part of the "if {...}" statement.
The warning looks like this:
seeed-voicecard/wm8960.c: In function ‘wm8960_hw_params’:
seeed-voicecard/wm8960.c:752:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
752 | if ((iface & 0x3) != 0) {
| ^
seeed-voicecard/wm8960.c:757:2: note: here
757 | default:
| ^~~~~~~