Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start Saraswati service after USB sound devices have been registered #12

Open
amotl opened this issue Jul 20, 2021 · 3 comments
Open

Start Saraswati service after USB sound devices have been registered #12

amotl opened this issue Jul 20, 2021 · 3 comments

Comments

@amotl
Copy link
Member

amotl commented Jul 20, 2021

Hi there,

when invoking sudo saraswati setup --systemd, Saraswati installs itself as a systemd unit. For that, it uses the saraswati.service systemd unit definition file.

@MKO1640 reported a problem with that at https://community.hiveeyes.org/t/installation-von-saraswati-auf-einem-industrie-pc-mit-upload-auf-synology-nas/4048/39:

There is also a small problem with the USB microphones. They are not always recognized by the GStreamer after a reboot. They have to be unplugged once and plugged in again.

With lsusb, the microphones are also always recognized. But it also recognizes 2 internal Linux USB hubs.
With my test computer I could not reproduce the problem so far.

He already offers a probable suggestion for the root cause:

I guess that the service starts before the USB is initialized and therefore it doesn't work. So it might be enough to restart ALSA and GStreamer before Saraswati.

With kind regards,
Andreas.

/cc @ClemensGruber

@amotl
Copy link
Member Author

amotl commented Jul 20, 2021

When investigating how to improve the situation, I found those resources on the internet.

How could I say "after USB is ready" for a systemd unit?

@amotl
Copy link
Member Author

amotl commented Jul 20, 2021

357b148 is an attempt to address this. By using path-based activation mechanics, it will make Saraswati only start if /dev/bus/usb becomes non-empty.

I am not sure yet if that works best in all occasions. A built-in soundcard is probably not made available through USB, so the Saraswati unit configuration should be improved further to account for this scenario where there might a built-in soundcard but no USB devices at all.

@MKO1640
Copy link
Contributor

MKO1640 commented Jul 25, 2021

I will soon check and report this in my test environment. There is also an onboard sound card that I am not currently using.
In any case, it is now running perfectly via usb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants