Hi, while Marek is trying to get the firmware properly built and/or loaded, I have started to rebase the aess patch set on top of 4.18.
The key issue and task is to get rid of all sound_soc_platform references and replace by sound_soc_component.
To make it a little more clear which files we touch, I have rearranged and reworded the patch set so that we can easily identify the subsystem. And patches affecting more than one are split up into two patches now.
So basically, there are three groups of patches:
a) for sound/soc - they mainly export internal functions or add new helper functions I am not sure if these patches are still needed and/or good
b) sound/soc/omap - here we add an mcasp driver, make mcbsp export functions and the main change is to add firmware download to abe-twl6040.
c) sound/soc/omap/aess - this is the real aess driver
The next steps are:
1. fix compile issues in sound/soc/core
2. upstream abe-twl6040 driver has already been converted to sound_soc_component, so I have to make sure that patching in the firmware loader code does not undo something important...
3. go through the aess code and convert to sound_soc_component This may make some patches of a) no longer needed. Some of them might need additional modifications.
The current work is here:
http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work-ae...
I plan to add patches for each step.
BR, Nikolaus
Hi,
Am 02.08.2018 um 11:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi, while Marek is trying to get the firmware properly built and/or loaded, I have started to rebase the aess patch set on top of 4.18.
The key issue and task is to get rid of all sound_soc_platform references and replace by sound_soc_component.
To make it a little more clear which files we touch, I have rearranged and reworded the patch set so that we can easily identify the subsystem. And patches affecting more than one are split up into two patches now.
So basically, there are three groups of patches:
a) for sound/soc - they mainly export internal functions or add new helper functions I am not sure if these patches are still needed and/or good
b) sound/soc/omap - here we add an mcasp driver, make mcbsp export functions and the main change is to add firmware download to abe-twl6040.
c) sound/soc/omap/aess - this is the real aess driver
The next steps are:
fix compile issues in sound/soc/core
upstream abe-twl6040 driver has already been converted to sound_soc_component,
so I have to make sure that patching in the firmware loader code does not undo something important...
- go through the aess code and convert to sound_soc_component
This may make some patches of a) no longer needed. Some of them might need additional modifications.
The current work is here:
http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work-ae...
I plan to add patches for each step.
Well, I tried to work on 1. first, but it turned out to be a mess.
Therefore I reverted all(most all) sound/soc/core patches and started to work on 2. It was partially straightforward, partially difficult to decide what is new, what is needed and and what is duplicated code... So I hope I did not introduce too many bugs we have to hunt...
Regarding 1. I did just need to copy&paste two helper functions to make 2. compiling. Which means, that the new abe-twl6040 doesn't rely on patches for sound/soc.
Here is the first result:
http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-ae... http://git.goldelico.com/?p=letux-kernel.git;a=blob;f=sound/soc/omap/omap-ab...
I have collected some questions for review at the beginning of the code.
What I also observed is that there is addidtional stuff we do not necessarily need for the Pyra, and which should IMHO go into separate patches against upstream:
* special support for OMAP4_SDP * spdif stuff * support for multiple DMICs
BTW: if we disable AESS it should compile fine - and we should be able to test if the twl6040 audio still works or is broken...
So the next big step is 3. Let's see how many of the patches from 1. we really need. The less we need them, the better...
BR, Nikolaus
Hi Nikolaus, On Thu, Aug 2, 2018 at 9:06 PM H. Nikolaus Schaller hns@goldelico.com wrote:
Hi,
Am 02.08.2018 um 11:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi, while Marek is trying to get the firmware properly built and/or loaded, I have started to rebase the aess patch set on top of 4.18.
The key issue and task is to get rid of all sound_soc_platform references and replace by sound_soc_component.
To make it a little more clear which files we touch, I have rearranged and reworded the patch set so that we can easily identify the subsystem. And patches affecting more than one are split up into two patches now.
So basically, there are three groups of patches:
a) for sound/soc - they mainly export internal functions or add new helper functions I am not sure if these patches are still needed and/or good
b) sound/soc/omap - here we add an mcasp driver, make mcbsp export functions and the main change is to add firmware download to abe-twl6040.
c) sound/soc/omap/aess - this is the real aess driver
The next steps are:
fix compile issues in sound/soc/core
upstream abe-twl6040 driver has already been converted to sound_soc_component,
so I have to make sure that patching in the firmware loader code does not undo something important...
- go through the aess code and convert to sound_soc_component
This may make some patches of a) no longer needed. Some of them might need additional modifications.
The current work is here:
http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work-ae...
I plan to add patches for each step.
Well, I tried to work on 1. first, but it turned out to be a mess.
Therefore I reverted all(most all) sound/soc/core patches and started to work on 2. It was partially straightforward, partially difficult to decide what is new, what is needed and and what is duplicated code... So I hope I did not introduce too many bugs we have to hunt...
Regarding 1. I did just need to copy&paste two helper functions to make 2. compiling. Which means, that the new abe-twl6040 doesn't rely on patches for sound/soc.
Here is the first result:
http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-ae... http://git.goldelico.com/?p=letux-kernel.git;a=blob;f=sound/soc/omap/omap-ab...
I have collected some questions for review at the beginning of the code.
Cool I'l take a loot.
What I also observed is that there is addidtional stuff we do not necessarily need for the Pyra, and which should IMHO go into separate patches against upstream:
- special support for OMAP4_SDP
- spdif stuff
- support for multiple DMICs
BTW: if we disable AESS it should compile fine - and we should be able to test if the twl6040 audio still works or is broken...
So the next big step is 3. Let's see how many of the patches from 1. we really need. The less we need them, the better...
I'm still strugling with creating aess FW which can be loaded properly with recent kernel. Basically old asoc-fw repo have methods to create dynamic wrap which is prepend at the beginning of firmware (part which soc-topology then verify). As Peter mentioned it work only with 3.15 linux-audio kernel. Problem is that from 3.15 to 4.17(18) a lot of headers was changed. I tried simply use 4.17 kernel header to compile but basically it's mess (kernel headers are changes so dramatically and I spend 1 hour only trying to resolve error issues but without success). So I decided to first try only aess FW without wrap header and after hacking of driver I also cannot load because something was missing from header (some memory offsets or so).
I think we should first try to use firmware without dynamic header (at least it should do something) and then try to somehow update it (can be lot of time consuming). Ideas? Thanks.
BR, Nikolaus
BR, marek
Hi,
Am 02.08.2018 um 21:06 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi,
Am 02.08.2018 um 11:51 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi, while Marek is trying to get the firmware properly built and/or loaded, I have started to rebase the aess patch set on top of 4.18.
The key issue and task is to get rid of all sound_soc_platform references and replace by sound_soc_component.
To make it a little more clear which files we touch, I have rearranged and reworded the patch set so that we can easily identify the subsystem. And patches affecting more than one are split up into two patches now.
So basically, there are three groups of patches:
a) for sound/soc - they mainly export internal functions or add new helper functions I am not sure if these patches are still needed and/or good
b) sound/soc/omap - here we add an mcasp driver, make mcbsp export functions and the main change is to add firmware download to abe-twl6040.
c) sound/soc/omap/aess - this is the real aess driver
The next steps are:
fix compile issues in sound/soc/core
upstream abe-twl6040 driver has already been converted to sound_soc_component,
so I have to make sure that patching in the firmware loader code does not undo something important...
- go through the aess code and convert to sound_soc_component
This may make some patches of a) no longer needed. Some of them might need additional modifications.
The current work is here:
http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work-ae...
I plan to add patches for each step.
Well, I tried to work on 1. first, but it turned out to be a mess.
Therefore I reverted all(most all) sound/soc/core patches and started to work on 2. It was partially straightforward, partially difficult to decide what is new, what is needed and and what is duplicated code... So I hope I did not introduce too many bugs we have to hunt...
Regarding 1. I did just need to copy&paste two helper functions to make 2. compiling. Which means, that the new abe-twl6040 doesn't rely on patches for sound/soc.
Here is the first result:
http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-ae... http://git.goldelico.com/?p=letux-kernel.git;a=blob;f=sound/soc/omap/omap-ab...
I have collected some questions for review at the beginning of the code.
What I also observed is that there is addidtional stuff we do not necessarily need for the Pyra, and which should IMHO go into separate patches against upstream:
- special support for OMAP4_SDP
- spdif stuff
- support for multiple DMICs
BTW: if we disable AESS it should compile fine - and we should be able to test if the twl6040 audio still works or is broken...
So the next big step is 3. Let's see how many of the patches from 1. we really need. The less we need them, the better...
It doesn't look as if we need (m)any of them. Here is a first result:
http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work/hn...
It compiles, but some code is commented out, because it calls functions that are not available in v4.18:
omap-aess-core.c and omap-aess-pcm.c: omap_pm_get_dev_context_loss_count() - was not used elsewhere and recently removed
omap-aess-dai.c: snd_soc_dai_trigger() - did never exist in any upstream kernel snd_soc_platform_trigger() - has been removed in v4.11 snd_interval_step() - exists but is not exported
That is all! A total of 4 functions is missing. So almost all patches we had for general sound/soc/core are not needed.
Does anyone here have background information what these functions are good for and what replacements should be used?
@Marek: as far as I can see, none of them is related to firmware loading. So you could try if this code is better or different in loading firmware?
BR, Nikolaus
Hi Marek,
Am 03.08.2018 um 12:59 schrieb H. Nikolaus Schaller hns@goldelico.com:
It doesn't look as if we need (m)any of them. Here is a first result:
http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work/hn...
I have now added your DTS patches (omap5) to this branch and it compiles and does something, but stumbles over some missing mcpsm dai link setup.
Here is the complete letux kernel with these patches:
http://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-ae...
It compiles, but some code is commented out, because it calls functions that are not available in v4.18:
omap-aess-core.c and omap-aess-pcm.c: omap_pm_get_dev_context_loss_count() - was not used elsewhere and recently removed
omap-aess-dai.c: snd_soc_dai_trigger() - did never exist in any upstream kernel snd_soc_platform_trigger() - has been removed in v4.11 snd_interval_step() - exists but is not exported
That is all! A total of 4 functions is missing. So almost all patches we had for general sound/soc/core are not needed.
Does anyone here have background information what these functions are good for and what replacements should be used?
@Marek: as far as I can see, none of them is related to firmware loading. So you could try if this code is better or different in loading firmware?
I think we should try to fix the omap_abe_probe and then continue to debug firmware loading based on this code.
BR, Nikolaus
Filtered log (omap5evm):
[ 4.664772] ehci-omap 4a064c00.ehci: irq 148, io mem 0x4a064c00 [ 4.664929] omapdss_dss 58000000.dss: bound 58001000.dispc (ops dispc_component_ops [omapdss]) [ 4.683834] omapdss_dss 58000000.dss: bound 58040000.encoder (ops hdmi5_component_ops [omapdss]) [ 4.696934] ehci-omap 4a064c00.ehci: USB 2.0 started, EHCI 1.00 [ 4.706466] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.18 [ 4.729195] ------------[ cut here ]------------ [ 4.729394] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 4.734385] WARNING: CPU: 1 PID: 1273 at drivers/base/devres.c:893 snd_soc_card_new_dai_links.constprop.3+0x5c/0x98 [snd_soc_omap_abe_twl6040] [ 4.757135] usb usb1: Product: EHCI Host Controller [ 4.773754] usb usb1: Manufacturer: Linux 4.18.0-rc7-letux+ ehci_hcd [ 4.795635] Modules linked in: snd_soc_omap_abe_twl6040(+) snd_soc_twl6040 leds_gpio omapdss cec encoder_tpd12s015 connector_hdmi omapdss_base ehci_omap(+) gpio_twl6040 dwc3_omap palmas_gpadc palmas_pwrbutton industrialio at24 snd_soc_omap_aess snd_soc_omap_mcpdm snd_soc_omap_mcbsp snd_soc_sdma [ 4.807060] usb usb1: SerialNumber: 4a064c00.ehci [ 4.868141] hub 1-0:1.0: USB hub found [ 4.869977] CPU: 1 PID: 1273 Comm: udevd Tainted: G W 4.18.0-rc7-letux+ #2587 [ 4.880791] hub 1-0:1.0: 3 ports detected [ 4.880920] Hardware name: Generic OMAP5 (Flattened Device Tree) [ 4.891406] [<c01112c8>] (unwind_backtrace) from [<c010c87c>] (show_stack+0x10/0x14) [ 4.899531] [<c010c87c>] (show_stack) from [<c078f514>] (dump_stack+0x7c/0x9c) [ 4.907107] [<c078f514>] (dump_stack) from [<c0132848>] (__warn+0xd8/0x108) [ 4.914404] [<c0132848>] (__warn) from [<c0132988>] (warn_slowpath_null+0x38/0x44) [ 4.922340] [<c0132988>] (warn_slowpath_null) from [<bf132524>] (snd_soc_card_new_dai_links.constprop.3+0x5c/0x98 [snd_soc_omap_abe_twl6040]) [ 4.935655] [<bf132524>] (snd_soc_card_new_dai_links.constprop.3 [snd_soc_omap_abe_twl6040]) from [<bf1328c0>] (omap_abe_probe+0x360/0x5f4 [snd_soc_omap_abe_twl6040]) [ 4.951235] [<bf1328c0>] (omap_abe_probe [snd_soc_omap_abe_twl6040]) from [<c04fe9b8>] (platform_drv_probe+0x48/0x98) [ 4.962352] [<c04fe9b8>] (platform_drv_probe) from [<c04fcd9c>] (driver_probe_device+0x180/0x310) [ 4.971643] [<c04fcd9c>] (driver_probe_device) from [<c04fcfbc>] (__driver_attach+0x90/0xc4) [ 4.980481] [<c04fcfbc>] (__driver_attach) from [<c04fb2bc>] (bus_for_each_dev+0x64/0xa0) [ 4.989047] [<c04fb2bc>] (bus_for_each_dev) from [<c04fc2dc>] (bus_add_driver+0xcc/0x1e0) [ 4.997613] [<c04fc2dc>] (bus_add_driver) from [<c04fdbec>] (driver_register+0xb0/0xf8) [ 5.005997] [<c04fdbec>] (driver_register) from [<bf138070>] (omap_abe_init+0x70/0x1000 [snd_soc_omap_abe_twl6040]) [ 5.016931] [<bf138070>] (omap_abe_init [snd_soc_omap_abe_twl6040]) from [<c0102eb4>] (do_one_initcall+0xc0/0x268) [ 5.027774] [<c0102eb4>] (do_one_initcall) from [<c01aeb88>] (do_init_module+0x58/0x1d0) [ 5.036249] [<c01aeb88>] (do_init_module) from [<c01ad92c>] (load_module+0xe24/0xfd4) [ 5.044450] [<c01ad92c>] (load_module) from [<c01adce4>] (sys_finit_module+0x94/0xb4) [ 5.052648] [<c01adce4>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x54) [ 5.061211] Exception stack(0xecb63fa8 to 0xecb63ff0) [ 5.066498] 3fa0: b6dc37d4 00051f70 00000007 b6dc29f8 00000000 b6dc331c [ 5.075061] 3fc0: b6dc37d4 00051f70 18e7a300 0000017b 00020000 00037f78 00050048 00059460 [ 5.083619] 3fe0: beb90ee0 beb90ed0 b6dbcc4b b6ec7a42 ^[[c^[[c[ 5.096845] ---[ end trace 308978971b15416e ]--- [ 5.104638] omap-abe-twl6040 sound: ASoC: CPU DAI mcpdm-abe not registered [ 5.115645] omap-abe-twl6040 sound: card registration failed: -517
Log with aess.ko removed/disabled:
[ 4.586613] ehci-omap 4a064c00.ehci: new USB bus registered, assigned bus number 1 [ 4.598830] omapdss_dss 58000000.dss: 58000000.dss supply vdda_video not found, using dummy regulator [ 4.625068] DSS: OMAP DSS rev 6.1 [ 4.625171] ehci-omap 4a064c00.ehci: irq 148, io mem 0x4a064c00 [ 4.630393] omapdss_dss 58000000.dss: bound 58001000.dispc (ops dispc_component_ops [omapdss]) [ 4.644373] omapdss_dss 58000000.dss: bound 58040000.encoder (ops hdmi5_component_ops [omapdss]) [ 4.668516] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_put_handle (err 0) [ 4.683001] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_set_dl1_gains (err 0) [ 4.693041] ehci-omap 4a064c00.ehci: USB 2.0 started, EHCI 1.00 [ 4.703169] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.18 [ 4.735871] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_pm_set_mode (err 0) [ 4.773419] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 4.780987] usb usb1: Product: EHCI Host Controller [ 4.786456] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_dc_set_hf_offset (err 0) [ 4.807910] usb usb1: Manufacturer: Linux 4.18.0-rc7-letux+ ehci_hcd [ 4.813026] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_load_firmware (err 0) [ 4.815674] usb usb1: SerialNumber: 4a064c00.ehci [ 4.829054] hub 1-0:1.0: USB hub found [ 4.834258] hub 1-0:1.0: 3 ports detected [ 4.843567] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_get_handle (err 0) [ 4.852508] snd_soc_omap_abe_twl6040: Unknown symbol omap_aess_dc_set_hs_offset (err 0) [ 4.887462] dwc3 4a030000.dwc3: Failed to get clk 'ref': -2 [ 4.895466] dwc3 4a030000.dwc3: changing max_speed on rev 5533202a