Page MenuHomeFreeBSD

sound: Remove ncards variable from sound_oss_card_info()
ClosedPublic

Authored by christos on Thu, May 9, 8:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 15, 8:21 PM
Unknown Object (File)
Tue, May 14, 4:08 PM
Unknown Object (File)
Mon, May 13, 2:56 AM
Unknown Object (File)
Sun, May 12, 8:49 PM
Unknown Object (File)
Sun, May 12, 2:05 AM
Unknown Object (File)
Sat, May 11, 11:28 AM
Unknown Object (File)
Fri, May 10, 7:00 PM
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.Fri, May 10, 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.