LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 11-27-2017, 08:08 AM   #1
truthz03
LQ Newbie
 
Registered: Nov 2017
Posts: 2

Rep: Reputation: Disabled
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
 
Old 11-28-2017, 06:20 PM   #2
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 2,364

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Can you not just add a suitable delay with the sleep command?
 
Old 11-29-2017, 07:30 AM   #3
truthz03
LQ Newbie
 
Registered: Nov 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-29-2017, 01:35 PM   #4
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 2,364

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
 
Old 11-29-2017, 01:49 PM   #5
ferrari
Senior Member
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 2,364

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Systemd service: AUTOSSH.service does not start at boot, how can I fix this? The_Linux_Machine Linux - Newbie 1 07-06-2016 01:00 PM
Can't access full journalctl from script via systemd service even though user is in systemd-journal group iwtbf Linux - Newbie 0 02-19-2016 03:44 PM
systemd service aagaag Linux - Newbie 1 01-18-2016 08:42 PM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 10:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration