Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a set of usb speakers for my laptop. when I play music using audacious, (and other gui players) I can change settings to send the music through them.
but for waking up in the morning I have a script that calls mplayer to play a random song from my library. I have not figured out how to make the system use the usb speakers for default system wide.
Click here to see the post LQ members have rated as the most helpful post in this thread.
I made an ugly hack, so that if the PC boots with the USB speakers plugged in, it uses them, otherwise, it uses the internal soundcard (Intel, in my case)
So I put this code at the end of /etc/rc.local
Code:
# Simple control of Bose USB speakers
# If they are plugged in at boot, they'll be used,
# otherwise the internal soundcard will be used
#
# It may fail if anything is using the sound card when it is called
foo=$(cat /proc/asound/cards | grep Bose)
if [ "$foo" != "" ] ; then
# Use USB speakers
# echo Bose USB speakers detected >> /var/log/messages
cp /usr/share/alsa/alsa.conf.USB /usr/share/alsa/alsa.conf
/etc/init.d/alsa-utils restart
# BUT realplay defaults to using /dev/dsp, and doesn't know to use
# /dev/dsp1, so we need a another hack:
rm /dev/dsp
ln -sT /dev/dsp1 /dev/dsp;
else
# Use the original conf file
# echo No Bose USB speakers detected >> /var/log/messages
cp /usr/share/alsa/alsa.conf.orig /usr/share/alsa/alsa.conf
/etc/init.d/alsa-utils restart
fi
exit 0
I would have liked to do something clever with udev rules, so that when the USB speakers were plugged it, they were selected and configured automatically, and unselected when unplugged, but it got too complicated for my tiny brain, and I resorted to the above, which works fine
now my script-launched mplayer uses the usb speakers.
But I have discovered that this may not work always.
Please see this thread for a more robust script: http://www.linuxquestions.org/questi...0/#post3196077
You'll have to adapt it a bit to recognise your USB soundcard's unique identifier, but this should be easy once you have read the post.
Iwas just following the steps but Idont have the alsa-utils file in the directory /etc/init.d/ . I only have alsa-restore and alsa-store files. How can restart the sound system?
This thread is over 4 years old, and many things have changed with linux since then, including the way sound cards are handled.
So, please start a new thread with the details of your problem.
Also, it is important for you to tell us the linux distribution you are using (eg "Mint 14" or "Fedora 18"), because the different distributions sometimes handle things very differently.
This thread is over 4 years old, and many things have changed with Linux since then, including the way sound cards are handled.
So, please start a new thread with the details of your problem.
Also, it is important for you to tell us the linux distribution you are using (eg "Mint 14" or "Fedora 18"), because the different distributions sometimes handle things very differently.
_________________________
The solution provided in this thread to make the Bose Companion 5 speakers work as default audio system output worked perfectly under recently released (June 2021) Linus Mint 20.2.
Thank you very much for your post tredegar, excellent solution!
I am very surprised that a 14 year old post is still being found as useful. Perhaps this is a tribute to the power of scripts and the command line?
systemd and pulseaudio might soon be the death of this very dated advice though.
Thanks for your feedback, but it might be better if you scrolled back to the post that most helped you and clicked on "Did you find this post helpful? [Yes]" which might help a few other latecomers find the solution they need.
I am very surprised that a 14 year old post is still being found as useful. Perhaps this is a tribute to the power of scripts and the command line?
systemd and pulseaudio might soon be the death of this very dated advice though.
Thanks for your feedback, but it might be better if you scrolled back to the post that most helped you and clicked on "Did you find this post helpful? [Yes]" which might help a few other latecomers find the solution they need.
______________________________
Hi tredegar,
Thanks for your prompt reply tredegar. I did implement your script as well, but I haven't tested it yet. However, simply being able to get my Bose Companion 5 speakers working on Mint 20.2 is a big plus. I hadn't realized how old this post is, but by all means, no matter how old it gets, don't delete it!!! I followed your advice, and used the "Did you find this post useful? [Yes]" link. Of course I did! Thank you very much one more time. Cheers!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.