Page MenuHomeFreeBSD

sound: Remove ncards variable from sound_oss_card_info()
ClosedPublic

Authored by christos on May 9 2024, 8:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 1:44 PM
Unknown Object (File)
Thu, Oct 17, 3:30 AM
Unknown Object (File)
Wed, Oct 16, 9:34 PM
Unknown Object (File)
Thu, Oct 10, 7:51 AM
Unknown Object (File)
Oct 7 2024, 10:40 AM
Unknown Object (File)
Oct 7 2024, 10:40 AM
Unknown Object (File)
Oct 7 2024, 10:40 AM
Unknown Object (File)
Oct 7 2024, 10:16 AM
Subscribers

Details

Summary

The loop counter is also the card's index, so ncards is redundant.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This is ok as is, but it has the same problem as SNDCTL_MIXERINFO: We should consider returning "blank" oss_card_info structs for unavailable devices / device indices, instead of an error. Current implementation breaks audio/oss and probably kodi when devices are unavailable, since they stop iterating the SNDCTL_CARDINFO indices if there's an error. There is no enabled in oss_card_info to signal that a device is unavailable, but the info is mostly descriptive. We could return "unavailable" or something like that in the strings, which would hopefully be picked up by the application and shown to the user.

This revision is now accepted and ready to land.May 10 2024, 1:52 PM

This is ok as is, but it has the same problem as SNDCTL_MIXERINFO: We should consider returning "blank" oss_card_info structs for unavailable devices / device indices, instead of an error. Current implementation breaks audio/oss and probably kodi when devices are unavailable, since they stop iterating the SNDCTL_CARDINFO indices if there's an error. There is no enabled in oss_card_info to signal that a device is unavailable, but the info is mostly descriptive. We could return "unavailable" or something like that in the strings, which would hopefully be picked up by the application and shown to the user.

You are talking about the !PCM_REGISTERED(d) case right?

This is ok as is, but it has the same problem as SNDCTL_MIXERINFO: We should consider returning "blank" oss_card_info structs for unavailable devices / device indices, instead of an error. Current implementation breaks audio/oss and probably kodi when devices are unavailable, since they stop iterating the SNDCTL_CARDINFO indices if there's an error. There is no enabled in oss_card_info to signal that a device is unavailable, but the info is mostly descriptive. We could return "unavailable" or something like that in the strings, which would hopefully be picked up by the application and shown to the user.

You are talking about the !PCM_REGISTERED(d) case right?

Yes, exactly. Should have mentioned that.