LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-13-2020, 04:54 PM   #16
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,415

Rep: Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805

@business_kid

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:
Code:
/usr/bin/pulseaudio --system --disallow-module-loading
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.
 
1 members found this post helpful.
Old 02-14-2020, 04:48 AM   #17
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,023

Original Poster
Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Ah! Thank you agba. Done!
 
Old 02-14-2020, 07:37 AM   #18
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,415

Rep: Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805Reputation: 805
"a b g a" I know my username sucks (it's basically an abbreviation with some meaning), I was just lacking inspiration when I choose it ...

Happy to hear you're all set now with pulseaudio.
 
Old 02-14-2020, 02:03 PM   #19
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,023

Original Poster
Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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!"
 
Old 02-17-2020, 02:36 PM   #20
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,023

Original Poster
Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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
Code:
set-card-profile 0 output:hdmi-stereo+input:analog-stereo
If I get that right, that sends out only to hdmi. My preferred setup would be

No HDMI: Laptop speakers or jack
HDMI plugged in:HDMI sound only as all laptop speakers are crap. I feel I need to get an 'if' statement in there

IF there's hdmi, give it to hdmi
IF no hdmi use crappy laptop speakers.

EDIT: With that line (From post #14?)out, default is crappy laptop speakers or jack, and I've no hdmi sound option.

Last edited by business_kid; 02-17-2020 at 02:53 PM.
 
Old 02-18-2020, 09:52 AM   #21
folkenfanel
Member
 
Registered: Sep 2004
Location: formerly Fanelia and Zaibach
Distribution: Slackware-current !
Posts: 318

Rep: Reputation: 43
Wink A working setup (at least here)

Hi there!

This is my audio setup, with HDMI audio.

/home/user/.asoundrc
Code:
# 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.

Hope it's helpful. Have fun!
 
1 members found this post helpful.
Old 02-19-2020, 04:17 AM   #22
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,023

Original Poster
Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Thanks for the setup, folkenfanel .

~/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……
 
Old 02-19-2020, 07:32 AM   #23
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,023

Original Poster
Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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.
 
Old 02-19-2020, 10:27 AM   #24
folkenfanel
Member
 
Registered: Sep 2004
Location: formerly Fanelia and Zaibach
Distribution: Slackware-current !
Posts: 318

Rep: Reputation: 43
Talking Test with alsamixer

Hi there!

You may test your audio setup with

Code:
alsamixer -c0
(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 10:30 AM. Reason: Adding a line of code
 
Old 02-20-2020, 05:59 AM   #25
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 11,023

Original Poster
Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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 06:00 AM.
 
Old 02-20-2020, 05:18 PM   #26
folkenfanel
Member
 
Registered: Sep 2004
Location: formerly Fanelia and Zaibach
Distribution: Slackware-current !
Posts: 318

Rep: Reputation: 43
Talking Those lines are just there for purely cosmetic reasons

I just like seeing something other than "Analog Stereo" XD
 
  


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
current -- suddenly hdmi audio is hd:0, instead of the pci audio card genss Slackware 5 04-25-2016 09:07 AM
LXer: $50 Roku stick goes HDMI y HDMI with Chromecast LXer Syndicated Linux News 0 03-06-2014 02:00 PM
Is it possible to play Blu Ray through a video card HDMI output to HDMI TV? SharpyWarpy Linux - Hardware 5 10-28-2012 02:01 AM
[ProLiant MicroServer, ATI R6xx HDMI, Digital Out, HDMI] No HDMI sound at all vnatius Linux - Hardware 15 08-16-2012 02:09 PM
HDMI Audio doesn't work - Debian Squeeze (Intel HDMI) felipefv Linux - Hardware 8 02-06-2012 10:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:50 PM.

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