SlackwareThis Forum is for the discussion of Slackware Linux.
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.
You shouldn't make /etc/rc.d/rc.pulseaudio executable, you don't need a SystemWide mode, that's what we discussed in previous posts,
- the header of /etc/rc.d/rc.pulseaudio states:
Code:
# Start/stop/restart PulseAudio in system mode.
# In this mode, a single system instance of PulseAudio will be shared by
# multiple local users.
#
# Please note: this is not generally the best way to use PulseAudio!
# Normally pulseaudio will start automatically as-needed with an instance
# per audio user. Unless you really need to use system mode you should leave
# this script non-executable.
#
# For more information, see:
# http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide
Just remove the exec bit and use pulseaudio normally, in its default autospawning mode. Note that /etc/rc.d/rc.pulseaudio also disables modules loading by launching pulseaudio with:
and you definitely need the pulseaudio modules for normal "general use". All the options you put in the conf files from /etc/pulse/ will be considered also in autospawning mode.
Sorry, abga. Yes, your username sucks, but it's not bad beside many I've seen. I was gifted mine. As a J.W., I took my 3 boys aged 4-7 at the time, into a nasty drug-ridden part of town one morning to do our door-to door work. Afterwards, we waited for everybody, instead of leaving any stragglers behind on their own. The local kids wanted to tear into my kids, but of course they couldn't with us there. Then another local kid came along and (highlighting my kids' clothes) exclaimed:"Yaa, look! Business Kids!"
sorry to be posting again on this, but it appears I've lost Analogue stereo on the laptop speakers. What I think was the big change for me was this line in /etc/pulse/default.pa
# PulseAudio devices
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
# DEFAULT DEVICE
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}
/etc/pulse/default.pa (at the end of the file)
Code:
### Load HDMI audio device
load-module module-alsa-sink device=hw:0,3 sink_name=hdmi sink_properties="device.description='HDMI Stereo'"
### Set default properties on this box
update-sink-proplist alsa_output.pci-0000_00_1f.3.analog-stereo device.description="Lenovo Stereo"
update-source-proplist alsa_input.pci-0000_00_1f.3.analog-stereo device.description="Lenovo Microphone"
update-source-proplist alsa_output.pci-0000_00_1f.3.analog-stereo.monitor device.description="Monitor of Lenovo Stereo"
### Set default devices on this box
set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
set-default-source alsa_input.pci-0000_00_1f.3.analog-stereo
Before testing that config, you should change those "raw" device names (in bold) to your proper device names. I change the device descriptions for purely cosmetic reasons, change them as desired.
I'm using slackware-current with the 5.4 huge kernel. On the 4.x kernel, the line for loading the HDMI device used to be at the top of the file, but if you do that it won't work with the 5.4.x kernel.
Now to the part that mutes/unmutes HDMI:
/etc/acpi/acpi_handler.sh (adding a new case, I added mine between button and ac_adapter)
Code:
jack)
case "$2" in
lineout)
hdmi_audio_state=`cat /sys/class/drm/card0/*HDMI*/status`
case "$hdmi_audio_state" in
connected)
logger "HDMI: plug detected, unmuting HDMI audio port"
amixer -c0 set 'IEC958' unmute
;;
disconnected)
logger "HDMI: unplug detected, muting HDMI audio port"
amixer -c0 set 'IEC958' mute
;;
*)
;;
esac
;;
videoout)
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
As you can see, the ACPI handler handles the events of your HDMI connection being plugged or unplugged. That command (amixer -c0 set 'IEC958' mute | unmute) mutes/unmutes HDMI audio. Might vary for your specific sound card.
If you have your HDMI cable permanently connected, I suggest you add amixer -c0 set 'IEC958' unmute , or any appropriate command to unmute your HDMI audio, to your /etc/rc.d/rc.local file.
Next, when you play any music or movies, you'll be able to control the output port using pavucontrol (the Playback tab), and select your preferred output.
~/asoundrc, etc/pulse/default.pa, & rc.local. It goes, in my mind, to show what dreadful things alsa and pulse are. Everyone can interrogate card hardware & load modules just fine. That should sort module loading. Maybe a simple setup with choice1, choice2 & choice3 or some such. You'd think somebody could do it.
I'm trying to summon the mental energy to drag myself back to it, and implement your suggestions, all of which look good. I'm low this early morning with yet more rain due all today, tomorrow, & next day……
Those config changes all went in. I have home-rolled kernels-5.4.18 & 5.4.14 which are well honed for this box atm in it's current uses.It mainly saves a MB of log spam every time I boot, and avoids initrds with every module under the sun, when all you want is access to /.
That line you had
Quote:
amixer -c0 set 'IEC958' unmute
does that job. What's the equivalent line to mute/unmute the crappy laptop speakers? I could see myself needing that.
(may vary depending on your sound card) -> you will see here everything your sound card has, and try muting and unmuting them and test sounds.
Then your command would be:
Code:
amixer -c0 set 'write-your-output-channel-here' unmute
(assuming your card number is 0)
There is a caveat: if you have pulseaudio, you will notice that if you plug your headphones your speakers get muted, and vice versa if you unplug your headphones, your speakers get unmuted. It seems pulseaudio detects such things automatically (you may test them live with pavucontrol)
Have fun, and good luck taming your box!
Last edited by folkenfanel; 02-19-2020 at 09:30 AM.
Reason: Adding a line of code
After I wrote that last post, I started kicking myself when I realised pulse wouldn't start, so everything was quiet. I ran that down to 2 of these three lines in /etc/pulse/default.pa
Code:
### Set default properties on this box
update-sink-proplist alsa_output.pci-0000_00_1f.3.analog-stereo device.description="Lenovo Stereo"
update-source-proplist alsa_input.pci-0000_00_1f.3.analog-stereo device.description="Lenovo Microphone"
update-source-proplist alsa_output.pci-0000_00_1f.3.analog-stereo.monitor device.description="Monitor of Lenovo Stereo"
I had updated the address & comments, commented out the above linesd and it kinda works now, I think. I've no issue with the headphones, really. Yeah, I have to select them in Pavucontrol despite the fact that there's a hard wired switch in the jackplug which is thrown when you plug the earphones in on all 3.5mm plugs. Take that from an electronics techie, who knows the score.
Last edited by business_kid; 02-20-2020 at 05:00 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.