All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Rick Mann <rmann@latencyzero.com>
Cc: Alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: mcasp: stream has more channels (2) than are enabled in mcasp (0)
Date: Tue, 19 Apr 2016 12:22:23 +0300	[thread overview]
Message-ID: <5715F8CF.5000101@ti.com> (raw)
In-Reply-To: <7817DD4F-6BD2-4EBE-8AA6-CBC595B1FBBF@latencyzero.com>

On 04/19/16 12:04, Rick Mann wrote:
> 
>> On Apr 19, 2016, at 01:37 , Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>>
>> On 04/19/16 11:05, Rick Mann wrote:
>>>>> Yup, seems like it's 0:
>>>>>
>>>>> [   67.876673] davinci-mcasp 48038000.mcasp: Slots: 2,
>>>>> max_active_serializers: 1, active_serializers: 0, channels: 2,
>>>>> mcasp->num_serializer: 0 [   67.889362] davinci-mcasp 48038000.mcasp: ASoC:
>>>>> can't set 48038000.mcasp hw params: -22
>>>>
>>>> How can it be?
>>>> can you take a look of the davinci_mcasp_set_pdata_from_of() function where
>>>> the serial-dir is set up? Do we get the of_serial_dir32? What is the size of
>>>> the array we got (val)?
>>>
>>> It seems to be 0:
>>>
>>> [    8.411990] davinci-mcasp 48038000.mcasp: davinci_mcasp_probe: enter
>>> [    8.453167] davinci-mcasp 48038000.mcasp: serial-dir: 0
>>> [    8.501317] davinci-mcasp 48038000.mcasp: invalid tdm slots: 0
>>> [    8.554405] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: enter
>>> [    8.562924] davinci-mcasp 4803c000.mcasp: serial-dir: 0
>>> [    8.635250] davinci-mcasp 4803c000.mcasp: invalid tdm slots: 0
>>
>> Hrm, it seems that we can not read any of the parameters set by the DT
>> fragment for mcasp0, my guess is that the tx-num-evt and rx-num-evt is not
>> there either.
>>
>> from the full log: the mcasp is loaded earlier than you have patched the DT
>> with the audio overlay.
>>
>> [    8.220175] davinci-mcasp 48038000.mcasp: davinci_mcasp_probe: enter
>> [    8.268496] davinci-mcasp 48038000.mcasp: invalid tdm slots: 0
>> [    8.323405] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: enter
>> [    8.339936] davinci-mcasp 4803c000.mcasp: invalid tdm slots: 0
>> ...
>> [   33.432680] bone_capemgr bone_capemgr: part_number 'BB-BONE-AUDI-02',
>> version 'N/A'
>> [   33.432719] bone_capemgr bone_capemgr: slot #4: override
>> [   33.432736] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
>> [   33.432752] bone_capemgr bone_capemgr: slot #4: 'Override Board
>> Name,00A0,Override Manuf,BB-BONE-AUDI-02'
>> [   33.451729] bone_capemgr bone_capemgr: slot #4: dtbo
>> 'BB-BONE-AUDI-02-00A0.dtbo' loaded; overlay id #0
>> [   33.462646] 2-0018 supply IOVDD not found, using dummy regulator
>> [   33.462722] 2-0018 supply DVDD not found, using dummy regulator
>> [   33.462779] 2-0018 supply AVDD not found, using dummy regulator
>> [   33.462822] 2-0018 supply DRVDD not found, using dummy regulator
>> [   33.484174] asoc-simple-card sound: tlv320aic3x-hifi <-> 48038000.mcasp
>> mapping ok
>> [   50.062097] davinci-mcasp 48038000.mcasp: Slots: 2, max_active_serializers:
>> 1, active_serializers: 0, channels: 2
>> [   50.072596] davinci-mcasp 48038000.mcasp: stream has more channels (2) than
>> are enabled in mcasp (0)
>> [   50.072613] davinci-mcasp 48038000.mcasp: ASoC: can't set 48038000.mcasp hw
>> params: -22
>>
>> You can try to remove the mcasp module, do the DT fragment magic, reload the
>> mcasp driver if it is not loaded automatically.
> 
> I don't quite understand how to do what you're suggesting here.

rmmod snd-soc-davinci-mcasp
...
DT patching
...
modprobe snd-soc-davinci-mcasp


>> But if you want to get it working properly you need to find the dts(i) file
>> which set the mcasp0 and mcasp1 nodes to status = "okay";
>> In upstream we do not do this, so it must come from the bone changes.
> 
> The DTB (prior to the BB-BONE-AUDI-02 overlay) starts with this file:
> 
> 	http://pastebin.com/5vVEdAKt
> 
> That file first includes the following files in this order, before adding
> its own entries (sorry about the line length):
> 
> https://github.com/RobertCNelson/dtb-rebuilder/blob/4.4.x/src/arm/am33xx.dtsi
> https://github.com/RobertCNelson/dtb-rebuilder/blob/4.4.x/src/arm/am33xx-es2.dtsi
> https://github.com/RobertCNelson/dtb-rebuilder/blob/4.4.x/src/arm/am335x-bone-common.dtsi
> https://github.com/RobertCNelson/dtb-rebuilder/blob/4.4.x/src/arm/am33xx-overlay-edma-fix.dtsi
> 
> The last of these files sets spi0, spi1, mcasp0, mcasp1 to "okay".

Interesting, why an include file called am33xx-overlay-edma-fix.dtsi would
enable spi and mcasp??? What it is fixing regarding to eDMA?

> If I understand what you're saying, this is causing the driver to load
> before other things have been set in the DT, and they should be moved
> to later, perhaps in the overlay? In fact, the overlay (which gets loaded
> after login) does also set the mcasp0 to "okay" (I think):

Yes, since the DT blob you are booting with have mcasp0/1 enabled, the driver
will load using the boot DTB. You later patch the DTB, but the driver is
already loaded so it will have no effect to the driver.

> https://github.com/RobertCNelson/bb.org-overlays/blob/master/src/arm/BB-BONE-AUDI-02-00A0.dts#L72
> 
> I rebuilt the .dtb by commenting out the enabling of the macasp0/1 in
> that .dtsi, and now it seems to work! davinci_mcasp_probe is entered
> when I apply the overlay, and I get this logged:
> 
> [   35.868324] davinci-mcasp 48038000.mcasp: davinci_mcasp_probe: enter
> [   35.874741] davinci-mcasp 48038000.mcasp: serial-dir: 64
> [   43.469254] davinci-mcasp 48038000.mcasp: Slots: 2,
> 	max_active_serializers: 1, active_serializers: 1,
> 	channels: 2, mcasp->num_serializer: 16
> [   78.846314] davinci-mcasp 48038000.mcasp: Slots: 2,
> 	max_active_serializers: 1, active_serializers: 1,
> 	channels: 2, mcasp->num_serializer: 16

Great!

> By default, speaker-test only outputs to the left channel, and I get
> noise out that channel. If I invoke speaker-test -c 2, it claims to
> cycle between Front Left and Front Right, but there is only silence
> out the Front Right. This is probably due to issues in asound.state,
> right (I'd sure love some help getting that straightened out)?

I'll try to take a look at the speaker-test, it should work fine AFAIK.

> In any case, thank you. This seems to have advanced things considerably.
> I really appreciate your help and your patience.

No problem, I'm glad that I we sorted out.

-- 
Péter

  reply	other threads:[~2016-04-19  9:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04  8:59 mcasp: stream has more channels (2) than are enabled in mcasp (0) Rick Mann
2016-04-18 15:36 ` Peter Ujfalusi
2016-04-19  0:25   ` Rick Mann
2016-04-19  0:48     ` Rick Mann
2016-04-19  7:00     ` Peter Ujfalusi
2016-04-19  7:18       ` Rick Mann
2016-04-19  7:36         ` Peter Ujfalusi
2016-04-19  8:05           ` Rick Mann
2016-04-19  8:37             ` Peter Ujfalusi
2016-04-19  9:04               ` Rick Mann
2016-04-19  9:22                 ` Peter Ujfalusi [this message]
2016-04-19  9:32                   ` Rick Mann
2016-04-19 11:17                     ` Peter Ujfalusi
2016-06-03 13:22           ` ASoC: TLV320AIC3x changing suspend delay time Timur Karaldin
2016-06-03 14:38             ` Timur Karaldin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5715F8CF.5000101@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=rmann@latencyzero.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.