rodio icon indicating copy to clipboard operation
rodio copied to clipboard

(Issue and Proposal) Rodio's features can be confusing

Open dvdsk opened this issue 1 year ago • 0 comments

Background

Terminology

An audio file is a container (mp4/mkv etc). A container contains one or more streams and possibly metadata. Those streams are encoded with a codec. For audio those streams are usually multiple tracks. Rodio currently has no way to deal with multiple tracks in one file/container.

Some containers are special and can contain only a stream encoded with one specific codec. For example mp3 contains only MPEG-1 Audio Layer 3 encoded stream. Flac is another of these.

Features in rodio

Features in rodio can have two functions:

  • allow users to pick one decoder over another (for example minimp3 vs symphonia). Though this can only be done by disabling/enabling support by a decoder for a container.
  • speed up compilation by disabling unused codecs. Important for upstream libs building on rodio like bevy
  • exclude code with less permissive licenses (symphonia).

Right now there is no structure to the symphonia related features. There are features which

  • enable a single container
  • a single container and codecs often used with it.
  • a single codec.

Right now (cause of #516 and probably #527) we can not play ogg files. While there is a feature to enable the vorbis codec usually used in an ogg there is no feature to enable support for the ogg container. This will be addressed shortly.

Issue

This can be pretty confusing to users not familiar with the difference between codecs and decoders (such as me this morning). The errors you get if you fail to enable a codec feature can be puzzling. Without looking at the source code it is not possible to predict what a feature combination will do.

Proposal

  1. Document how enabled features determines the decoder used by rodio. Using different decoders for different streams in the same container will only be possible when specifying enabled codec and containers separately. As an example, it will be possible to configure rodio such that it uses lewton for ogg containing a vorbis stream while decoding ogg containing flac with symphonia.

  2. Make the current container features (for example symphonia-isomp4) enable all codecs. This removes the pitfall of #516.

  3. Add features that only enable a container without enabling any codecs to facilitate 1. and allow speeding up compilation.


Please let me know what you (the rodio user) think.

dvdsk avatar Jan 18 '24 13:01 dvdsk