Page MenuHomeFreeBSD

sound: Simplify pcm/feeder_mixer.c
Needs ReviewPublic

Authored by christos on Thu, Jan 9, 2:37 PM.

Details

Summary
  • Get rid of macro magic.
  • Make feed_mixer_info handling similar to most feeders.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61607
Build 58491: arc lint + arc unit

Event Timeline

christos added inline comments.
sys/dev/sound/pcm/feeder_mixer.c
52

We don't need to care about this, since all these types are defined as int32_t.

sys/dev/sound/pcm/feeder_mixer.c
52

Actually if SND_PCM_64 is set, intpcm32_t is defined as int64_t.
@dev_submerge.ch I think we might need to clean up these types altogether.

sys/dev/sound/pcm/feeder_mixer.c
52

I think we can just use int32_t and int64_t in place of intpcm*_t directly, and in this particular case, a simple #ifdef SND_PCM_64 to choose the right type. I'm not sure about the benefit of these types, since they are mostly just aliases for int32_t.

sys/dev/sound/pcm/feeder_mixer.c
52

Hm, I have to investigate and look at all the use cases first. Also it looks like we lose precision here when the volume is changed somewhere else in the chain. But that's probably a general issue with the current feeder design.

sys/dev/sound/pcm/feeder_mixer.c
52

Yeah, this patch, as well as the others, are just a step towards making this codebase easier to work with. I think there is quite a lot of room for improvements.

Update to reflect changes in D47932 (use of pcm_sample_read_24bit()).