Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform-dependent INFO_ flags #1336

Merged
merged 2 commits into from
Oct 22, 2019

Conversation

plbossart
Copy link
Member

This is an untested but very simple proof-of-concept to illustrate how we can account for platform differences reported to userspace. Currently we have a single setting for all platforms, which e.g does not allow us to notify userspace and other SOF parts of hardware capabilities (precision of the hw pointer position, pause/resume support, etc)

The first patch is just a move of the existing settings, follow-up patches change the settings for Intel platforms based on my understanding of the hardware.

This PR should fix the issue #1285

@juimonen
Copy link

At first glance looks good, did you try with pulseaudio what happens? I'll try myself tomorrow at office.

@plbossart
Copy link
Member Author

plbossart commented Oct 17, 2019 via email

@ranj063
Copy link
Collaborator

ranj063 commented Oct 17, 2019

@plbossart so whats the difference in behavior when the user pauses audio without INFO_PAUSE and with INFO_PAUSE?

@juimonen
Copy link

@ranj063 with "aplay -i" you just can't pause..."PAUSE command ignored (no hw support)", so not sure if this is what we want to have?

@plbossart otherwise pulseaudio now works with this one in mb-byt+rt5682

couple of remarks:

  • Pierre do you have L/R channels swapped in your UI speaker test, because I have?
  • I have very subtle L/R channel balance differences with different switches for aplay (like using -vvvv or -i), so there's some timing difference in the starting of the stream, which makes the samples corrupt, you have to use "all over the ears" headphone listening to detect this...

@dbaluta
Copy link
Collaborator

dbaluta commented Oct 18, 2019

@paulstelian97 I think this will also help with our pause problems :)

@juimonen
Copy link

@plbossart and I think the channel balance issue is now fixed with thesofproject/sof#1922, I had couple of days old fw.

@plbossart
Copy link
Member Author

@juimonen PulseAudio does not use PAUSE_PUSH/RELEASE, neither does CRAS. It's also questionable if pausing without a ramp (or not on zero-crossing) is good in terms of pop/clicks. Not to mention the horrible error messages that ALSA throws at us when doing a PAUSE_RELEASE after a suspend-resume operation.

We could make this optional with a Kconfig if people really need it, but I don't think anyone would complain. It think the one thing we can all agree on is that we should not make PAUSE the default for all platforms.

@juimonen
Copy link

@plbossart, yes pause thing is fine by me, just tried to answer somehow ranjani's question. I don't know what our CI will think of this? don't we have some pause release tests? or maybe they are done manually...

@plbossart
Copy link
Member Author

update: I removed the INFO_PAUSE removal for now, we need to track this as a 'feature'

@plbossart plbossart changed the title [RFC] platform-dependent INFO_ flags platform-dependent INFO_ flags Oct 18, 2019
ranj063
ranj063 previously approved these changes Oct 19, 2019
@ranj063 ranj063 dismissed their stale review October 20, 2019 03:22

Was approved by mistake

@ranj063
Copy link
Collaborator

ranj063 commented Oct 20, 2019

@plbossart there're typos in the second commit "position" and reliable

@RanderWang
Copy link

@plbossart there're typos in the second commit "position" and reliable

good eye! I only found it by a tool.

juimonen
juimonen previously approved these changes Oct 22, 2019
Copy link

@juimonen juimonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will approve this now, because this will "fix" the stuttering playback in byt. @plbossart just fix the typos and let's just merge (?). Only thing I'm wondering do we need some more testing on other platforms?

@plbossart
Copy link
Member Author

@plbossart there're typos in the second commit "position" and reliable

well spotted, somehow codespell doesn't seem to work any longer? Fixed now

@plbossart
Copy link
Member Author

I will approve this now, because this will "fix" the stuttering playback in byt. @plbossart just fix the typos and let's just merge (?). Only thing I'm wondering do we need some more testing on other platforms?

I don't think we need to test further, this PR does not affect any HDaudio-based platforms.

juimonen
juimonen previously approved these changes Oct 22, 2019
ranj063
ranj063 previously approved these changes Oct 22, 2019
Copy link
Collaborator

@ranj063 ranj063 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart this might be a good time to try my script. You'd definitely have permissions to push to your own branch.

@plbossart
Copy link
Member Author

plbossart commented Oct 22, 2019

@ranj063 I know I am a goat at times.... I typed a control C by accident, and running the script twice adds the signature twice - this should be made idiot-proof. Also Jaska's information is invalid?

 Signed-off-by: Pierre-Louis Bossart <[email protected]>
    Reviewed-by: null <[email protected]>
    Reviewed-by: Ranjani Sridharan <[email protected]>
    Reviewed-by: null <[email protected]>
    Reviewed-by: Ranjani Sridharan <[email protected]>

@ranj063
Copy link
Collaborator

ranj063 commented Oct 22, 2019

@ranj063 I know I am a goat at times.... I typed a control C by accident, and running the script twice adds the signature twice - this should be made idiot-proof. Also Jaska's information is invalid?

 Signed-off-by: Pierre-Louis Bossart <[email protected]>
    Reviewed-by: null <[email protected]>
    Reviewed-by: Ranjani Sridharan <[email protected]>
    Reviewed-by: null <[email protected]>
    Reviewed-by: Ranjani Sridharan <[email protected]>

@plbossart thanks for trying. Yes, for sure it needs a bit more testing with the corner cases but looks like everyone needs to update their profiles too. I will fix the script to ignore the null name when there's no name in the profile.

Currently the INFO_ flags such as PAUSE/NO_PERIOD_WAKEUP are defined
in the SOF PCM core, which doesn't scale. To account for platform
variations, these flags need to be set in DSP ops.

This patch only moves the definitions and does not change any
functionality.

Reviewed-by: Jaska Uimonen <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
The current position update is not precise enough for PulseAudio to
work reliably with the timer-based scheduling on Baytrail,
Cherrytrail, Broadwell.

Disable the NO_PERIOD_WAKEUP capability and use BATCH to signal that
the position is only reliable and updated during period_elapsed
events.

This will be reverted when the firmware provides a more accurate
position for those platforms.

Reviewed-by: Jaska Uimonen <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
@plbossart
Copy link
Member Author

Also we seem to lose the approved status by force-pushing a new branch, so now we have the information in the commit message but not in GitHub any longer :-(

@plbossart plbossart merged commit c105b6f into thesofproject:topic/sof-dev Oct 22, 2019
@ranj063
Copy link
Collaborator

ranj063 commented Oct 22, 2019

Also we seem to lose the approved status by force-pushing a new branch, so now we have the information in the commit message but not in GitHub any longer :-(

@plbossart this is because our repo settings dismiss reviews when the branch is updated. Can we please change this?

@plbossart
Copy link
Member Author

Also we seem to lose the approved status by force-pushing a new branch, so now we have the information in the commit message but not in GitHub any longer :-(

@plbossart this is because our repo settings dismiss reviews when the branch is updated. Can we please change this?

not sure, it's a good feature to have.

@ranj063
Copy link
Collaborator

ranj063 commented Oct 22, 2019

not sure, it's a good feature to have.

@plbossart in general one person may agree with a solution and another may not. So if someone approves a PR and the other person "requests changes", it will automatically be flagged to not be merged. So I'm not sure if dismissing reviews automatically is a good feature or not.

kv2019i pushed a commit to kv2019i/linux that referenced this pull request Oct 24, 2019
BugLink: https://bugs.launchpad.net/bugs/1819515

[ Upstream commit 87c11f1 ]

Similar to commit 44f49dd ("ipmr: fix possible race resulting from
improper usage of IP_INC_STATS_BH() in preemptible context."), we cannot
assume preemption is disabled when incrementing the counter and
accessing a per-CPU variable.

Preemption can be enabled when we add a route in process context that
corresponds to packets stored in the unresolved queue, which are then
forwarded using this route [1].

Fix this by using IP6_INC_STATS() which takes care of disabling
preemption on architectures where it is needed.

[1]
[  157.451447] BUG: using __this_cpu_add() in preemptible [00000000] code: smcrouted/2314
[  157.460409] caller is ip6mr_forward2+0x73e/0x10e0
[  157.460434] CPU: 3 PID: 2314 Comm: smcrouted Not tainted 5.0.0-rc7-custom-03635-g22f2712113f1 thesofproject#1336
[  157.460449] Hardware name: Mellanox Technologies Ltd. MSN2100-CB2FO/SA001017, BIOS 5.6.5 06/07/2016
[  157.460461] Call Trace:
[  157.460486]  dump_stack+0xf9/0x1be
[  157.460553]  check_preemption_disabled+0x1d6/0x200
[  157.460576]  ip6mr_forward2+0x73e/0x10e0
[  157.460705]  ip6_mr_forward+0x9a0/0x1510
[  157.460771]  ip6mr_mfc_add+0x16b3/0x1e00
[  157.461155]  ip6_mroute_setsockopt+0x3cb/0x13c0
[  157.461384]  do_ipv6_setsockopt.isra.8+0x348/0x4060
[  157.462013]  ipv6_setsockopt+0x90/0x110
[  157.462036]  rawv6_setsockopt+0x4a/0x120
[  157.462058]  __sys_setsockopt+0x16b/0x340
[  157.462198]  __x64_sys_setsockopt+0xbf/0x160
[  157.462220]  do_syscall_64+0x14d/0x610
[  157.462349]  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Fixes: 0912ea3 ("[IPV6] MROUTE: Add stats in multicast routing module method ip6_mr_forward().")
Signed-off-by: Ido Schimmel <[email protected]>
Reported-by: Amit Cohen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants