Mixxx Documentation

repository·main·Indexed 27 days ago

https://github.com/mixxxdj/mixxx

Free, open-source DJ software for live performance on GNU/Linux, Windows, and macOS. This documentation includes guides for building from source, Flatpak installation, and developer references for internal libraries such as QM-DSP (Digital Signal Processing), SPSCQueue (lock-free communication), and rendergraph shaders. It also provides details on controller script linting and Icecast streaming via libshout.

Tokens
7.7K
Snippets
17
Records
48
Agent score
92%

What's inside Mixxx

  1. Overview of Kaitai Struct C++/STL runtime library

    main
    This library provides a C++ implementation of the Kaitai Struct API using the Standard Template Library (STL). It is designed to work with Kaitai Struct, a declarative language used to describe binary data structures such as binary file formats or network stream packet formats.
  2. Use SPSCQueue for single-producer single-consumer communication

    main

    SPSCQueue is a wait-free and lock-free fixed-size queue designed for C++11. It is optimized for scenarios where exactly one thread performs enqueue operations (the producer) and exactly one thread performs dequeue operations (the consumer).

    Constraint: Any usage involving multiple writers or multiple readers is invalid and will lead to undefined behavior.

    SPSCQueue<int> q(1);
    auto t = std::thread([&] {
      while (!q.front());
      std::cout << *q.front() << std::endl;
      q.pop();
    });
    q.push(1);
    t.join();
  3. Add or change controller mappings and advanced behaviors

    main

    If your DJ controller is not supported or is not working as expected in Mixxx, you can manually add or modify controller mappings. Mixxx provides methods to get your controller working immediately through custom mapping files or scripts.

    http://mixxx.org/forums/viewtopic.php?f=3&t=949
  4. Get started with Mixxx

    main

    Depending on your needs, you can use Mixxx in three ways:

    1. Live Use: Download the latest stable version from the official website.
    2. Experimentation and Testing: Download a development release.
    3. Bleeding Edge: Clone the repository directly to your local machine.

    Mixxx is compatible with GNU/Linux, Windows, and macOS.

    git clone https://github.com/mixxxdj/mixxx.git
  5. Access Mixxx documentation and guides

    main

    For help using the software, refer to the following resources:

    • Mixxx Manual: Official user guide.
    • Mixxx Wiki: Community-driven documentation.
    • Hardware Compatibility: Information on supported DJ hardware.
    • Creating Skins: Guide for developing custom user interface skins.
  6. Configure Huge Page support with custom allocators

    main

    SPSCQueue supports the standard custom allocator interface and the P0401R3 allocate_at_least proposal (available when C++17 is enabled). This allows you to use huge pages to improve performance without wasting allocated space.

    Because huge page APIs are platform-dependent, you must provide your own allocator. Below is a reference implementation for Linux using mmap with MAP_HUGETLB.

    #include <sys/mman.h>
    
    template <typename T> struct Allocator {
      using value_type = T;
    
      struct AllocationResult {
        T *ptr;
        size_t count;
      };
    
      size_t roundup(size_t n) { return (((n - 1) >> 21) + 1) << 21; }
    
      AllocationResult allocate_at_least(size_t n) {
        size_t count = roundup(sizeof(T) * n);
        auto p = static_cast<T *>(mmap(nullptr, count, PROT_READ | PROT_WRITE,
                                       MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB,
                                       -1, 0));
        if (p == MAP_FAILED) {
          throw std::bad_alloc();
        }
        return {p, count / sizeof(T)};
      }
    
      void deallocate(T *p, size_t n) { munmap(p, roundup(sizeof(T) * n)); }
    };
  7. Configure Mixxx Controller/MIDI Mapping

    main

    Detailed documentation is available for creating or modifying mapping files. This includes instructions on:

    • Creating/changing mapping files for your specific controller.
    • Implementing advanced behaviors, such as easy wheel scratching.
    • Accessing a complete list of Mixxx controls that can be manipulated via mapping files or scripts.
    http://mixxx.org/wiki/doku.php/#controller_midi_mapping_documentation
  8. Extract GLSL shaders from qsb bundles for OpenGL (Qt < 6.6)

    main

    If you are using a version of Qt older than 6.6, you must manually extract GLSL shaders from the .qsb shader bundles to use them with QOpenGLShader.

    Use the rg_generate_shaders_gl.py script located in the mixxx/tools directory. This script requires both qsb (part of Qt) and spirv (part of the Vulkan SDK) to be available in your system PATH.

    The script generates a generated_shaders_gl.cmake file which contains a CMake variable listing all extracted GLSL shaders, which can then be consumed by the local CMakeLists.txt.

    $ ../../../tools/rg_generate_shaders_gl.py --cmake generated_shaders_gl.cmake *.vert *.frag