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

Updated check-sof-logger.sh and verify-kernel-boot-log.sh #1245

Closed
wants to merge 2 commits into from

Conversation

harajend
Copy link
Contributor

Updated SOF-specific codecs since the sof* regex also lists sofprobes.

@harajend harajend requested a review from a team as a code owner December 17, 2024 18:43
@sofci
Copy link
Collaborator

sofci commented Dec 17, 2024

Can one of the admins verify this patch?

reply test this please to run this test once

@marc-hb
Copy link
Collaborator

marc-hb commented Dec 17, 2024

test this please

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

  • Are there any other possibilities besides these two? @kv2019i , @ranj063 , @bardliao can you answer?

  • The commit message must link to the corresponding bug, e.g. "Fixes issue [BUG] /proc/asound/sofprobes breaks "check-sof-logger" test #1243"

  • The commit title and message must describe the change much precisely. For instance: check-sof-logger: remove wildcard from sof_alsa_card_found(). The title has very little space, so don't use words like "update": every commit is an update.

See past commit message examples in the git log.

Here are some good references, most of this applies to any open-source project so please spend some time and take a look

https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-guidelines
https://wiki.openstack.org/wiki/GitCommitMessages
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#write-a-meaningful-commit-message
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

test-case/check-sof-logger.sh Outdated Show resolved Hide resolved
@marc-hb
Copy link
Collaborator

marc-hb commented Dec 17, 2024

Are there any other possibilities besides these two?

Answer: it is not enough.

https://sof-ci.01.org/softestpr/PR1245/build795/devicetest/index.html?model=ADLP_RVP_NOCODEC-ipc4&testcase=check-sof-logger

@marc-hb
Copy link
Collaborator

marc-hb commented Dec 18, 2024

Simpler and probably good enough:

sof_alsa_card_found()
{
   for i in /proc/asound/sof*/id; do
      if test -e "$i"; then return 0; fi
   done
   return 1
}

@harajend harajend requested a review from marc-hb January 2, 2025 10:17
@marc-hb
Copy link
Collaborator

marc-hb commented Jan 2, 2025

You need to use git rebase -i and squash the 2 git commits into a single one. We don't want to keep trial-and-error in the history; every git commit must work. Neither Zephyr nor SOF use Github in the "usual" way, they use it in the "traditional git" way zephyrproject-rtos/zephyr#39194

Also, see advice above for a useful commit message.

@marc-hb
Copy link
Collaborator

marc-hb commented Jan 2, 2025

Jenkins did not test this at all :-(

Updated the test script with suggested changes

Signed-off-by: harajend <[email protected]>

Updated check-sof-logger.sh

Updated SOF-specific codecs since the sof* regex also lists sofprobes.

Signed-off-by: harajend <[email protected]>
@marc-hb
Copy link
Collaborator

marc-hb commented Jan 6, 2025

Jenkins did not test this at all :-(

Still not running :-(

@marc-hb
Copy link
Collaborator

marc-hb commented Jan 7, 2025

Jenkins still not running; pushing new versions does not make any difference. Something is wrong on the Jenkins side. cc: @kv2019i

You need to use git rebase -i and squash the 2 git commits into a single one.

Still not done.

By default card 0 is selected so i added  dynamic selection for amixer card

Signed-off-by: harajend <[email protected]>
@harajend harajend changed the title Updated check-sof-logger.sh Updated check-sof-logger.sh and verify-kernel-boot-log.sh Jan 9, 2025
@marc-hb
Copy link
Collaborator

marc-hb commented Jan 9, 2025

There is still no testing.

Squashing looks good but the commit message of 212a420 is still a mess:

Updated the test script with suggested changes

Signed-off-by: harajend <[email protected]>

Updated check-sof-logger.sh

Updated SOF-specific codecs since the sof* regex also lists sofprobes.

Signed-off-by: harajend <[email protected]>

Don't say "update", every commit is an update. Just describe the change (once).

Copy link
Contributor

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Mostly good, but some comments inline.

@@ -115,7 +115,8 @@ dmic_switch_present()
(set -x
# name= is hardcoded in /usr/share/alsa/ucm2/*
# This returns a non-zero error status on failure
amixer cget name='Dmic0 Capture Switch'
switch=$(aplay -l | head -2 | tail -1 | awk '{print $3}')
amixer -c "$switch" cget name='Dmic0 Capture Switch'
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, doesn't this still select a fixed card?

E.g.

~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sofhdadsp [sof-hda-dsp], device 0: HDA Analog (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

... you'd get the same with "amixer -c 0" gets us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Select a card using its name, such as "sofsoundwire", instead of selecting it using numbers

aplay -l | head -2 | tail -1 | awk '{print $3}'

sofsoundwire

Command shall be like: amixer -c "sofsoundwire" cget name='Dmic0 Capture Switch'

Copy link
Contributor

Choose a reason for hiding this comment

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

@harajend But "head -2 | tail -1" will always pick the first card, so this is same as passing "amixer -c 0", right?

Copy link
Collaborator

@marc-hb marc-hb Jan 11, 2025

Choose a reason for hiding this comment

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

awk is a "big boy" and can select lines itself. It's shorter AND more readable:

   switch=$(aplay -l |  awk 'NR == 2 {print $3}')

amixer -c 0 looks even better? I'm only simplifying code but I don't know if it is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@harajend But "head -2 | tail -1" will always pick the first card, so this is same as passing "amixer -c 0", right?

Yes, On functionality front both are same. Here I thought to pass "name/identifier" instead of "index number"

@@ -71,7 +71,10 @@ sof_alsa_card_found()
# note: assumes SOF card names to start with "sof", e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

Change is good, but the commit message seems wrong. There are two signed offs. Can you amend the message and repush?

@marc-hb
Copy link
Collaborator

marc-hb commented Jan 11, 2025

There is still no testing.

Mmm.... Jenkins just started running in unrelated #1247... Let's try something....

@marc-hb
Copy link
Collaborator

marc-hb commented Jan 11, 2025

test this please

@marc-hb
Copy link
Collaborator

marc-hb commented Jan 11, 2025

Jenkins is still not running :-( @harajend please try closing this one and re-submitting in a new PR?

@harajend
Copy link
Contributor Author

Submitted new PR's for sof-logger and kernel-boot-log failures. Hence closing this (#1245) pull request.
Sof-logger: #1248
Kernel-boot-log: #1249

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.

4 participants