Commit graph

339 commits

Author SHA1 Message Date
Hin-Tak Leung
138d22226e temporary work-around for not being able to read sysclk from dts for ac10x
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
2020-09-04 20:44:32 +01:00
Hin-Tak Leung
a24da444df v5.8: snd_soc_pcm_runtime->cpu_dai/codec_dai/cpu_dais/codec_dais removed
perl -pi -e 's/rtd->cpu_dai/asoc_rtd_to_cpu\(rtd, 0\)/' seeed-voicecard.c
perl -pi -e 's/rtd->codec_dai/asoc_rtd_to_codec\(rtd, 0\)/' seeed-voicecard.c

commit 1729025b04b9f242dca37f50dba8dd3705eb1ea1
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Mar 30 10:48:27 2020 +0900

    ASoC: soc-core: remove cpu_dai/codec_dai/cpu_dais/codec_dais

    No-one is using cpu_dai/codec_dai/cpu_dais/codec_dais.
    Let's remove these from snd_soc_pcm_runtime

commit c2233a266178f8937cc26a84cd7672334b5424b7
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Mon Mar 30 10:47:37 2020 +0900

    ASoC: soc: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
2020-08-30 19:20:19 +01:00
Hin-Tak Leung
c3adcde556 v5.8: struct snd_soc_dai->active replaced by snd_soc_dai_active(snd_soc_dai)
commit 0812a08ac8d054efc6cf2895d3b0e82c8731f8e9
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Fri May 15 09:48:02 2020 +0900

    ASoC: cleanup dai / component active code

    No one is using dai->active, snd_soc_component_is_active().
    Let's remove these.

commit efffd9b344adbf813e3ae6f6136df80000bf2833
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date:   Fri May 15 09:46:37 2020 +0900

    ASoC: soc-dai: add snd_soc_dai_active()

    Current snd_soc_dai_action() is updating
    dai->stream_active for Playback/Capture (A),
    dai->active        for DAI (B)

            void snd_soc_dai_action(struct snd_soc_dai *dai,
                                    int stream, int action)
            {
    (A)             dai->stream_active[stream]      += action;
    (B)             dai->active                     += action;
                    dai->component->active          += action;
            }

    But, these are very verbose, because we can calculate
    DAI active from stream_active.

    This patch adds snd_soc_dai_active() which calculate
    DAI active from DAI stream_active.
2020-08-30 19:19:57 +01:00
Hin-Tak Leung
1452d85e0f Merge branch 'v5.5' into v5.7 2020-08-27 13:17:54 +01:00
Hin-Tak Leung
329c8090ea make the config un-install directory configurable, for Ubuntu 2020-08-27 13:17:20 +01:00
Hin-Tak Leung
53c0db449b make the overlay un-install directory configurable, for Ubuntu 2020-08-27 13:15:03 +01:00
Hin-Tak Leung
89f8a76646 Allow kernel images to be elsewhere - Ubuntu kernel is not at Raspbian location 2020-08-24 12:04:38 +01:00
Hin-Tak Leung
39c134f430 Merge branch 'v5.5' into v5.7 2020-08-24 11:00:38 +01:00
Hin-Tak Leung
17944791bb Merge git://github.com/respeaker/seeed-voicecard into v5.5
This is not a merge - just to note that we don't care about those two
changes upstream.
2020-08-24 10:58:42 +01:00
Hin-Tak Leung
df68ab22d6 Merge remote-tracking branch 'origin/v5.5' into v5.7 2020-08-23 20:43:08 +01:00
Hin-Tak Leung
88aae48c41 adding new ubuntu-prerequisite.sh script
notes and typo
2020-08-23 20:37:52 +01:00
Hin-Tak Leung
6bcd4cad2f /opt/vc/bin is not on standard $PATH on Ubuntu 2020-08-23 20:37:20 +01:00
Hin-Tak Leung
7f88e11fd0 adding advice to run ./ubuntu-prerequisite.sh in install.sh 2020-08-23 20:37:07 +01:00
Hin-Tak Leung
60e90d6fae Ubuntu kernels is not at /boot/kernel.img. Revisit for Raspbian
check running kernel agree with installed kernel, and ask the user to reboot before continue

Ubuntu kernels are not installed at /boot/kernel.img
2020-08-23 20:35:44 +01:00
Hin-Tak Leung
5cefec4cca make the config file configurable, for Ubuntu 2020-08-23 20:34:32 +01:00
Hin-Tak Leung
1f9c1464ab make the overlay install directory configurable, for Ubuntu 2020-08-23 20:34:25 +01:00
Hin-Tak Leung
71f01070d8 spelling 2020-08-21 16:27:08 +01:00
Psycho
19d1e6eb88 English correction 2020-08-20 08:16:13 +08:00
Hin-Tak Leung
07dc49259a remove "-c 1" and also protect with test for older kernel / alsa
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
2020-08-18 23:30:21 +01:00
Hin-Tak Leung
d8775ccb93 Use pr_info() for regular information 2020-08-18 08:22:32 +01:00
Hin-Tak Leung
c3ddbb521d likely v5 kernels behave like late 4.x, regarding dynamic dtoverlay; untested, and possibly revisit. 2020-08-18 08:22:19 +01:00
Hin-Tak Leung
1456785779 Merge remote-tracking branch 'origin/v5.5' into v5.7 2020-08-09 10:07:09 +01:00
Hin-Tak Leung
02eccbcd55 mask amixer failures - some user have different numbered / multiple audio devices 2020-08-09 10:06:21 +01:00
Hin-Tak Leung
131ee8187d Merge branch 'v5.7' into v5.7 2020-08-05 06:26:08 +01:00
Hin-Tak Leung
ed615d2318 Merge remote-tracking branch 'origin/v5.5' into v5.7 2020-08-05 06:20:32 +01:00
Hin-Tak Leung
2cc009619e Merge branch 'ubuntu' into v5.5 2020-08-05 06:10:37 +01:00
Hin-Tak Leung
aaf0cc2c61 move files in place, to capture hhuysqt <1020988872@qq.com>'s ubuntu-porting work
git rm seeed-voicecard.c
git mv seeed-voicecard-v5.3.c seeed-voicecard.c
2020-08-05 06:07:36 +01:00
Hin-Tak Leung
a6db04e724 Merge branch 'wrong-initialization-fix' into v5.5
Conflicts:
	seeed-voicecard.c
2020-08-05 05:59:37 +01:00
Hin-Tak Leung
0be1de9750 Revert previous over-zealous "rename asoc_simple_card_xxx() to asoc_simple_()"
Two of them should not have been changed, as they were protected and intended
for older kernels.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
fcbc3b6d6b copy asoc_simple_card_init_dai() from v5.7:sound/soc/generic/simple-card-utils.c
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()
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
c2b419c286 Revert "asoc_simple_card_init_dai is not exported, but asoc_simple_dai_init is, and does more"
This reverts commit de22f92298.

That commit was wrong: seeed_priv_to_props() is not identical to simple_priv_props().

Conflicts:
	seeed-voicecard.c
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
ed094dece5 v5.2: comments
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
51966603da v5.3: support snd_soc_dai_link_component style for cpu
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
6afe18224a v5.1: add .num_platform for dai_link
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
953fa50f4f v4.20: support snd_soc_dai_link_component style for platform
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
4396e4f834 v4.20: support snd_soc_dai_link_component style for codec
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.
2020-08-05 05:45:31 +01:00
Hin-Tak Leung
26754b0821 Revert previous over-zealous "rename asoc_simple_card_xxx() to asoc_simple_()"
Two of them should not have been changed, as they were protected and intended
for older kernels.
2020-08-05 05:26:01 +01:00
Hin-Tak Leung
af8668ff97 copy asoc_simple_card_init_dai() from v5.7:sound/soc/generic/simple-card-utils.c
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()
2020-08-05 04:54:46 +01:00
Hin-Tak Leung
2d08bb0b35 Revert "asoc_simple_card_init_dai is not exported, but asoc_simple_dai_init is, and does more"
This reverts commit de22f92298.

That commit was wrong: seeed_priv_to_props() is not identical to simple_priv_props().

Conflicts:
	seeed-voicecard.c
2020-08-05 04:54:46 +01:00
Hin-Tak Leung
c2f81c1f23 v5.2: comments
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.
2020-08-05 04:54:38 +01:00
Hin-Tak Leung
63fa92db39 v5.3: support snd_soc_dai_link_component style for cpu
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.
2020-08-05 02:37:32 +01:00
Hin-Tak Leung
d2c0f1b5c9 v5.1: add .num_platform for dai_link
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.
2020-08-05 02:18:23 +01:00
Hin-Tak Leung
775005d865 v4.20: support snd_soc_dai_link_component style for platform
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.
2020-08-05 02:07:32 +01:00
Hin-Tak Leung
8c80018c3e v4.20: support snd_soc_dai_link_component style for codec
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.
2020-08-05 01:42:57 +01:00
Hin-Tak Leung
076d12f7fb Revert partial-fix, in preparation for proper fix.
Revert "Fix dai_link->cpus etc used without backing storage."

This reverts commit 97146337cb.
2020-08-05 01:24:35 +01:00
Baozhu Zuo
c0f1dfa8bb Please use the 4.19 kernel first, 5.4 kernel support is still under development. 2020-08-03 09:07:51 +08:00
Hin-Tak Leung
67f7942cfd Merge remote-tracking branch 'origin/v5.5' into v5.7 2020-07-30 10:09:42 +01:00
HinTak
86c198d7dc
Merge pull request #4 from rotdrop/feature/support-ubuntu-server
Support ubuntu-server with /boot/firmware/overlays
2020-07-30 10:05:21 +01:00
HinTak
1d4abfa41d
Merge pull request #3 from rotdrop/bugfix/uninitialized-cpu-codec-platform
Fix dai_link->cpus etc used without backing storage.
2020-07-30 10:03:23 +01:00
Claus-Justus Heine
f52ed1b363 Support ubuntu-server with /boot/firmware/overlays 2020-07-29 22:26:34 +02:00