Skip to content
Snippets Groups Projects
frequently-asked-questions.md 8.3 KiB
Newer Older
  • Learn to ignore specific revisions
  • David Trattnig's avatar
    David Trattnig committed
    
    # Frequently Asked Questions
    
    <!-- TOC -->
    
    - [Frequently Asked Questions](#frequently-asked-questions)
        - [Which Audio Interface or Soundcard is compatible with Engine Core?](#which-audio-interface-or-soundcard-is-compatible-with-engine-core)
        - [How can I find the audio device IDs, required for settings in engine-core.ini?](#how-can-i-find-the-audio-device-ids-required-for-settings-in-engine-coreini)
    
        - [I have configured an audio device in my `engine-core.ini` but still hear no sound](#i-have-configured-an-audio-device-in-my-engine-coreini-but-still-hear-no-sound)
        - [I have configured an audio device in my `docker.engine-core.ini` but still hear no sound](#i-have-configured-an-audio-device-in-my-dockerengine-coreini-but-still-hear-no-sound)
        - [I'm getting [clock.wallclock_alsa:2] Error when starting output lineout: Failure("Error while setting open_pcm: No such file or directory")!**](#im-getting-clockwallclock_alsa2-error-when-starting-output-lineout-failureerror-while-setting-open_pcm-no-such-file-or-directory)
    
    David Trattnig's avatar
    David Trattnig committed
        - [How to solve 'Error when starting output output_lineout_0: Failure("Error while setting open_pcm: Device or resource busy")!'?](#how-to-solve-error-when-starting-output-output_lineout_0-failureerror-while-setting-open_pcm-device-or-resource-busy)
        - [How to avoid stutter, hangs, artifacts or in general glitchy sound?](#how-to-avoid-stutter-hangs-artifacts-or-in-general-glitchy-sound)
    
        - [Are there any commands to directly control the playout-server for development, debugging or testing?](#are-there-any-commands-to-directly-control-the-playout-server-for-development-debugging-or-testing)
    
    David Trattnig's avatar
    David Trattnig committed
        - [Read More](#read-more)
    
    <!-- /TOC -->
    
    ## Which Audio Interface or Soundcard is compatible with Engine Core?
    
    Basically any audio device which is supported by Linux Debian/Ubuntu and has ALSA, JACK or Pulse Audio support.
    
    ## How can I find the audio device IDs, required for settings in engine-core.ini?
    
    
    **ALSA**: If your system has a default ALSA device configured you just need to enter the device id "`default`". The background is that in addition to addressing the hardware through the included kernel drivers, ALSA configures the devices using plugins from the ALSA library (sample rate conversion, mixing) and this is based on experience with the actual audio devices. For more details: [alsa-project.org/wiki/Asoundrc](https://www.alsa-project.org/wiki/Asoundrc). But if you want some specific device, there is a varienty of commands to obtain the device ids:
    
    - To see only the physically available sound cards: `cat /proc/asound/cards`
    - To see sound cards with all additional devices (e.g. HDMI): `aplay -l`
    - To see devices configured by ALSA with additional plugins: `aplay -L`
    - The default devices that should be used: `aplay -L | grep default`
    
    For example if the last command results in:
    
    ```ini
    default:CARD=PCH
    sysdefault:CARD=PCH
    default:CARD=Device
    sysdefault:CARD=Device
    ```
    
    It means there are two sound cards here, the onboard sound (PCH) and a USB one (Device).
    
    Now, in `engine-core.ini` use:
    
    `output_device_0="default:CARD=PCH"`
    
    or just:
    
    `output_device_0="default:PCH"`
    
    Disadvantages can be:
    
    - Modern distributions configure the ALSA devices with dmix, so that several devices can use the sound card at the same time. This can lead to unintentional audio being played independently of engine-core, e.g. if a desktop is running on the same computer.
    
    - The default configuration has higher latencies than would be possible. However, the latency of the default devices is like using Pulseaudio and quite sufficient.
    
    This can be avoided by directly addressing the hardware and setting the parameters buffer size and periods. However, this requires a deep understanding of ALSA and experimentally finding the right parameters, so it is not recommended. A good starting point is to set only the parameter for the buffer size, Liquidsoap will adjust the remaining parameters automatically:
    
    ```ini
    output_device_0="hw:0"
    alsa_buffer="8192"
    ```
    
    See [alsa-project.org/wiki/FramesPeriods](https://www.alsa-project.org/wiki/FramesPeriods) and [jan.newmarch.name/LinuxSound/Sampled/ALSA/](https://jan.newmarch.name/LinuxSound/Sampled/ALSA/) for more details.
    
    David Trattnig's avatar
    David Trattnig committed
    
    **Pulse Audio**: You might not need this for Pulse Audio as the `default` device might be sufficient. To choose a specific one its ID can be found using `pactl list`
    
    
    **JACK**: Please check out the [JACK Documentation](https://jackaudio.org/).
    
    
    ## I have configured an audio device in my `engine-core.ini` but still hear no sound
    
    To test if you device is able to output audio at all, independently from Engine Core, try executing `speaker-test`. Also checkout out the `-D` argument to test specific devices. If you system doesn't provided `speaker-test` you have to install or use your preferred way of testing also audio.
    ## I have configured an audio device in my `docker.engine-core.ini` but still hear no sound
    
    If you are running Engine Core using Docker, run the aforementioned `speaker-test` from within your docker container by perform following:
    
    1. Start Engine Core in debug mode using `./run.sh docker:debug`
    2. To login to your Docker container you can use the command `docker exec -it aura-engine-core bash`.
    3. Now run `speaker-test`. It that's working, you now know that your audio device is at least available from within Docker and you'll need to further check your Liquidsoap device configuration.
    4. Next you can run `liquidsoap tests/test_alsa_default.liq`. This is a basic script which tries to play the supplied MP3 using the default ALSA device.
    
    
    ## I'm getting [clock.wallclock_alsa:2] Error when starting output lineout: Failure("Error while setting open_pcm: No such file or directory")!**
    
    David Trattnig's avatar
    David Trattnig committed
    
    Assure you have set the correct device ID. To do so check the aformentioned question. Check the audio interface configuration section in `engine-core.ini`. Verify if the default settings `input_device_0` and `output_device_0` are valid device IDs.
    
    In case your are *not* running Engine Core within Docker, also check if your executing user (è.g. `engineuser`) belongs to the group `audio`.
    
    ## How to solve 'Error when starting output output_lineout_0: Failure("Error while setting open_pcm: Device or resource busy")!'?
    
    You probably have set a wrong or occupied device ID. The device could be reserved by another software using the ALSA sound system. Or you might be accessing a device using ALSA which is already assigned to the Pulse Audio sound system. Here it could help to [remove the device from PulseAudio](https://jamielinux.com/blog/tell-pulseaudio-to-ignore-a-usb-device-using-udev/) before accessing it.
    
    ## How to avoid stutter, hangs, artifacts or in general glitchy sound?
    
    This can have various reasons, but first of all it's good to check the `engine-core.log` logs.
    
    **Incorrect ALSA buffer settings**: If the ALSA settings provided by your system are not working cleanly the `engine-core.ini` settings provide to option to override parameters such as `alsa_buffer`. The correct settings are individual to the used soundcard but in general this is a tricky topic. In our case we had more success using PulseAudio or JACK instead. Recommendations are welcome.
    
    **These problems occurr while having Icecast streaming enabled**: Try to reduce the quality of the stream, especially when you are experiencing hangs on the stream. Check your Icecast connection. Is it up and running? Maybe there is some authentication issue or an [Icecast limitation for max clients](ttps://github.com/savonet/liquidsoap/issues/524).
    
    **The hardware is hitting its limits**: Also check the relevant logs and the system utilization. Are there other processes using up the machines resources? You might even be hitting the performance limit of your hardware. Maybe using a realtime linux kernel could help too.
    
    
    ## Are there any commands to directly control the playout-server for development, debugging or testing?
    
    Connect to Liquidsoap via [Telnet](https://en.wikipedia.org/wiki/Telnet)
    
    
    `telnet 127.0.0.1 1234`
    
    
    List available commands
    
    
    
    List all available channels
    
    
    
    List all input channels connected to the mixer
    
    
    
    Set the volume of mixer `input 0` to `100%`
    
    
    `mixer.volume 0 100`
    
    
    Push some audio file to the filesystem `in_filesystem_0`
    
    
    `in_filesystem_0.push /path/to/your/file.mp3`
    
    David Trattnig's avatar
    David Trattnig committed
    
    ## Read More
    
    - [Overview](/README.md)
    - [Frequently Asked Questions (FAQ)](docs/frequently-asked-questions.md)