Git Product home page Git Product logo

Comments (4)

bondagit avatar bondagit commented on June 13, 2024

Hi there,
no, your question is not foolish and your analysis is correct: the driver was originally thought to be able to dynamically switch the sample rate according to the playback or recording sample rate and it was never meant to perform any sample rate conversion.
Basically the idea is that when a new playback comes and the rate is different from the current or initial rate the driver informs the user space (the daemon) of this change and this in turn updates the advertised sources and switches the driver rate.
Note that I never needed this feature in my configuration either but I didn't want to change the original behavior.
If you just need 48KHz/L24 streams my suggestion is to use an ALSA plugin and let the plugin perform the necessary sample rate conversions.
So for example I can achieve this by using the DMIX plugin with the following ALSA configuration:

From file: ~/.asoundrc

pcm.source_1 {
    type dmix
    ipc_key 0x11111
    slave {
        pcm "hw:1,0"
        channels 2
        rate 48000
        format S24_3LE
    }
    bindings { 0 0 1 1 }
}

And then I can playback a 44.1Khz file and let the plugin perfom the conversion to 48KHz with:

aplay -D plug:source_1 sample.wav -vv

Use the option -vv In aplay to see the audio chain used to achieve this.

Finally, please note that I have found a bug in the daemon that currently does not always correctly set the new driver sample rate once this has announced a change and I will be releasing a patch for this soon.

from aes67-linux-daemon.

bondagit avatar bondagit commented on June 13, 2024

Any updates on this issue? If it works for you I would close it. Thanks

from aes67-linux-daemon.

Aika0 avatar Aika0 commented on June 13, 2024

Yes... its working. Thanks for the super-quick reply. Sorry I didn't reply sooner.
I was thinking of trying to modify the driver to support a "lock" of the frequency to 48000Hz specifically for aes67 compatibility (since I think 48/24 is all it can be for aes67). I'm not sure it's necessary now though. It seems like now that I'm using ALSA to ensure things are 48000Hz I'm not having incorrect initial reporting. What do you think?

from aes67-linux-daemon.

bondagit avatar bondagit commented on June 13, 2024

My suggestion is to leave the driver as it is and to rely on the ALSA plugin to perform sample rate conversions.
You can always modify the driver to force a single sample rate but in that case all the attempts to playback or record at a different rate will fail with an error.
If you want to take this second direction just remove the undesired sample rates from the following structures in 3rdparty/ravenna-alsa-lkm/driver/audio_driver.c

static struct snd_pcm_hardware mr_alsa_audio_pcm_hardware_capture
static struct snd_pcm_hardware mr_alsa_audio_pcm_hardware_playback
static unsigned int g_supported_rates[] = {44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000};

from aes67-linux-daemon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.