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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test-case/check-sof-logger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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?

# - /proc/asound/sofsoundwire/id
# - /proc/asound/sofhdadsp/id
test -e /proc/asound/sof*/id
for i in /proc/asound/sof*/id; do
if test -e "$i"; then return 0; fi
done
return 1
}

wait_for_sof_alsa_card()
Expand Down
3 changes: 2 additions & 1 deletion test-case/verify-kernel-boot-log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

)
}

Expand Down