LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2018, 02:42 AM   #1
devgcl
LQ Newbie
 
Registered: Jul 2018
Posts: 3

Rep: Reputation: Disabled
Automate services (conditionally for sound devices)


Hi,
After much research, I managed to install Vortexbox 2.4 (Fedora 23 based) with Lynx Card (uses OSS sound driver). OSS and ALSA generally conflict each other.
Vortexbox by default uses Squeezelite/LMS as player - this works fine. I installed MPD player and managed to make it work using Gnome Music Player (Windows) client. However, I have to run the foll commands to get MPD working:
1. Reassign the specific Lynx device to /dev/dsp
# ln -sf /dev/oss/lynxtwo0/pcm4 /dev/dsp

2. Stop Squeezelite service which I suspect uses ALSA-OSS emulation which i had to install to get LMS player working.
# systemctl stop squeezelite0.service

Questions I have
- Is there anyway to automate the above commands by default when booting my machine.
- If I want to go back to LMS, I have to manually restart the Squeezelite service (not practical) - possible to avoid this.
- Can I streamline overall? I currently hear 3 pops and click in my DAC when booting highlighting the Lynx card is called 3 times through the Fedora boot process

Last edited by devgcl; 07-10-2018 at 02:47 AM.
 
Old 07-10-2018, 06:43 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by devgcl View Post
- Is there anyway to automate the above commands by default when booting my machine.
  1. i think udev rules can do this, maybe start your research here. or write a systemd service that does what you want.
  2. systemctl disable squeezelite0.service
 
Old 07-10-2018, 01:28 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I think systemd would be the simplest. Just open a systemd rule in an editor and change it to what you need. Then save it to a different name.
 
Old 07-11-2018, 08:02 AM   #4
devgcl
LQ Newbie
 
Registered: Jul 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks heaps.
I edited a rule for mpd.service to stop Squeezelite. Now, i can start MPD player without the need to get onto command line mode.
When I need squeezelite, i just resubmit Vortexbox device device assignment and I can play via LMS.

However, I have one last puzzle to solve. Once I start using Squeezelite, I can't play via MPD again (since Squeeezelite uses ALSA which locks in the sound device and disallowing MPD to use the same device). How can I get this resolved?

Cant think I can resolve via the systemd as the issue seems to be event based and don't know how to identify that MPD player is used again (i.e if MPD is called, disable squeezelite, else leave it enabled)
 
Old 07-12-2018, 02:14 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by devgcl View Post
However, I have one last puzzle to solve. Once I start using Squeezelite, I can't play via MPD again (since Squeeezelite uses ALSA which locks in the sound device and disallowing MPD to use the same device). How can I get this resolved?
are you saying you cannot play more than 1 sound sources together under alsa?
mpd is using alsa?
if so, you might need alsa's dmix plugin - something that's been enabled by default in archlinux for ages, so i don't really know how to activate it manually, but maybe this can help: https://wiki.archlinux.org/index.php/Alsa#Dmix
 
Old 07-12-2018, 10:58 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
dmix tends to be enabled by default and the soundcard should allow "sharing". With anything recent anyway (< 5 years).

About the only time I have trouble with sharing, is with pulseaudio and using multiple users. At which point networking needs enabled in pulse and a $HOME/.config/pulse/client.conf needs to exist with the contents of "default-server = 127.0.0.1". When using a user other than the one who started pulse on the same machine. Probably not your issue though. You might be running something else like jack over alsa which is locking the card. At which point you need to tell the player to use jack and not alsa when outputting sound. Or other trickery like snd-aloop and routing things through the Loopback device.
 
Old 07-13-2018, 09:51 AM   #7
devgcl
LQ Newbie
 
Registered: Jul 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the replies. I tried using alsa for both mpd and squeezelite players. This still caused mpd to not find the player (sort of locking the sound card).
It seems squeezelite and mpd services are mutually incompatible. If i stop squeezelite service, mpd can play.
Is there anyway i can detect the event of either player being used so thar i can start or stop particular services?

Last edited by devgcl; 07-13-2018 at 09:52 AM.
 
  


Reply



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
[SOLVED] Removed Sound Devices warning, yet sound works deretsigernu Slackware 1 12-10-2017 07:23 PM
[SOLVED] How to stop fping conditionally massy Linux - General 3 01-21-2014 07:05 AM
Conditionally change group ID JohnE1 Linux - General 5 01-27-2011 09:34 PM
LXer: Speaking Unix, Part 6: Automate, automate, automate! LXer Syndicated Linux News 0 01-04-2007 09:54 AM
Automate the Scheduling of the User-defined services tapishk Linux - General 2 12-14-2004 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:13 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
Open Source Consulting | Domain Registration