Systemd service problem with sound card
Hello,
I'm new here and need some help getting my systemd script running. What I want to do: Start a gstreamer pipeline on boot which redirects one alsa input device to one alsa output device The problem: The script works if I start it after boot but if the service will start at boot I get an "Device is busy" error The problem seems to be my output device which is an audioinjector-octo-soundcard. If I use the fakesink from gstreamer everithing is working. I have also tried to delay the start of my script which also works but I need that service as fast as possible. Is there any way to wait for my soundcard? Here is my service script: [Unit] Description=Audio Mixer After=syslog.target sound.target pulseaudio.service [Service] User=root Group=root Type=simple ExecStartPre=/usr/bin/aplay -l ExecStart=/usr/bin/gst-launch-1.0 -vvv alsasrc device=hw:Loopback,1 ! audio/x-raw, rate=48000 ! alsasink device=hw:audioinjectoroc TimeoutStopSec=20 KillMode=process Restart=always [Install] WantedBy=default.target The error: gst-launch-1.0[939]: Setting pipeline to PAUSED ... gst-launch-1.0[939]: ERROR: Pipeline doesn't want to pause. gst-launch-1.0[939]: ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: Could not open audio device for playback. Device is being used by another application. gst-launch-1.0[939]: Additional debug info: gst-launch-1.0[939]: gstalsasink.c(858): gst_alsasink_open (): /GstPipeline:pipeline0/GstAlsaSink:alsasink0: gst-launch-1.0[939]: Device 'hw:audioinjectoroc' is busy gst-launch-1.0[939]: Setting pipeline to NULL ... gst-launch-1.0[939]: Freeing pipeline ... Thanks Thomas |
Can you not just add a suitable delay with the sleep command?
|
Sure. But the time for the delay is not constant and I don't want a too large delay because a short boot time is very important for my project
|
I can only suggest enabling debug mode to get more info. (I know very little about gstreamer unfortunately.)
https://gstreamer.freedesktop.org/da...t-running.html |
If you can't make progress here, you might consider also posting to gstreamer mailing list. Nabble provides a web archive and gateway if preferred...
http://gstreamer-devel.966125.n4.nab...p?forum=966125 Good luck with this. |
Similar issue
Hi, I'm sorry to reply on such an old post but I'm facing a similar issue and I'm also using a sound-card from AudioInjector, the stereo sound-card.
I'm developing an intercom based of a RPi and for that I'm using twinkle sip phone. Let me start by saying that everything is functional as long as I don't use a systemd service in order to run my script at boot, doing so also returns either device busy, or just not accessible at all, see errors below. IMPORTANT: This issue only happens when I force CLI boot mode, if I use GUI boot mode I have no issues but I have no interest in having GUI interface. Quote:
Quote:
My service config: Quote:
|
All times are GMT -5. The time now is 03:42 AM. |