Opened 9 months ago

Closed 9 months ago

#18530 closed defect (fixed)

alsactl init exits with non zero error code

Reported by: pierre Owned by: pierre
Priority: normal Milestone: 12.1
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

Commit a0da9419fd has added the alsactl init instruction for setting up sound cards, but now I get:

pierre [ ~ ]$ sudo alsactl init
alsa-lib parser.c:2783:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
alsa-lib main.c:1560:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
Found hardware: "HDA-Intel" "Intel Haswell HDMI" "HDA:80862807,80860101,00100000" "0x1043" "0x8534"
Hardware is initialized using a generic method
alsa-lib parser.c:2783:(load_toplevel_config) Unable to find the top-level configuration file '/usr/share/alsa/ucm2/ucm.conf'.
alsa-lib main.c:1560:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -2
Found hardware: "HDA-Intel" "Realtek ALC887-VD" "HDA:10ec0887,10438616,00100302" "0x1043" "0x8616"
Hardware is initialized using a generic method
pierre [ ~ ]$ echo $?
99

Note that it is not a problem with ucm2 configuration not found: if I run alsactl --no‐ucm init, I get:

pierre [ ~/downloads/blfs ]$ sudo alsactl --no-ucm init
Found hardware: "HDA-Intel" "Intel Haswell HDMI" "HDA:80862807,80860101,00100000" "0x1043" "0x8534"
Hardware is initialized using a generic method
Found hardware: "HDA-Intel" "Realtek ALC887-VD" "HDA:10ec0887,10438616,00100302" "0x1043" "0x8616"
Hardware is initialized using a generic method
pierre [ ~/downloads/blfs ]$ echo $?
99

I think a lot of cards can use a "generic method", and don't need to be recognized, so that a 99 error code is normal for them. But it breaks scripts running with set -e

Change History (11)

comment:1 by pierre, 9 months ago

Not sure what the best approach is. Maybe just add || true, but somebody may come with a better idea...

comment:2 by pierre, 9 months ago

Summary: alsactl init exits with non sero error codealsactl init exits with non zero error code

in reply to:  1 ; comment:3 by Xi Ruoyao, 9 months ago

Replying to pierre:

Not sure what the best approach is. Maybe just add || true, but somebody may come with a better idea...

|| [ $? = 99 ]?

in reply to:  3 comment:4 by pierre, 9 months ago

Replying to Xi Ruoyao:

Replying to pierre:

Not sure what the best approach is. Maybe just add || true, but somebody may come with a better idea...

|| [ $? = 99 ]?

So smart ! Thanks, will try.

comment:5 by Bruce Dubbs, 9 months ago

Just add a note to explain the issue. It only comes up in a script so it really is not a big deal for the book.

in reply to:  5 ; comment:6 by pierre, 9 months ago

Replying to Bruce Dubbs:

Just add a note to explain the issue. It only comes up in a script so it really is not a big deal for the book.

But it breaks jhalfs...

in reply to:  6 ; comment:7 by Xi Ruoyao, 9 months ago

Replying to pierre:

Replying to Bruce Dubbs:

Just add a note to explain the issue. It only comes up in a script so it really is not a big deal for the book.

But it breaks jhalfs...

Could we make it nodump?

comment:8 by Bruce Dubbs, 9 months ago

Can jhalfs handle multiple roles: 'role="root alfs"' and add what is needed for that role?

in reply to:  7 comment:9 by pierre, 9 months ago

Replying to Xi Ruoyao:

Replying to pierre:

Replying to Bruce Dubbs:

Just add a note to explain the issue. It only comes up in a script so it really is not a big deal for the book.

But it breaks jhalfs...

Could we make it nodump?

I suppose this is the simplest.

in reply to:  8 comment:10 by pierre, 9 months ago

Owner: changed from blfs-book to pierre
Status: newassigned

Replying to Bruce Dubbs:

Can jhalfs handle multiple roles: 'role="root alfs"' and add what is needed for that role?

It could, but it's not yet written :) Not sure what you are thinking of for this case.

Anyway, I'll make the instruction "nodump", and add a sentence explaining that the command may return error code 99, although the cards a re correctly initialized.

comment:11 by pierre, 9 months ago

Resolution: fixed
Status: assignedclosed

Fixed at 3b411d49f5

Note: See TracTickets for help on using tickets.