Audio config: ALSA not playing out to built-in HW

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
hjhmusic
Established Member
Posts: 18
Joined: Mon Nov 07, 2016 3:24 am
Been thanked: 1 time

Audio config: ALSA not playing out to built-in HW

Post by hjhmusic »

Hi, haven't been around in a while, but having a little problem.

Last week, I installed Ubuntu Studio 16.04. (Previously, I was on plain Ubuntu 14.04.)

Current state: Audio is working as I want it to, for USB soundcards. The laptop's built-in soundcard is not pumping any audio out.

GOAL: I want all audio traffic to go through JACK, all the time -- JACK launches ALSA. Unfortunately, I can't do without PulseAudio. I want PA *always* to use the JACK source and sink, and *never* to connect independently to a different sound card.
  • Initial, OOTB configuration: When I start it, the JACK server takes over the specified audio hardware. PA creates the JACK source and sink, but it does not use them by default.
  • I tried to set the source and sink as PA's defaults, but (as I recall) the behavior was inconsistent. Sometimes everything would hook up. Sometimes the source and sink would fail to be created. Sometimes they would be created but not used.
  • So I tried to go back to the trick I had been using in my old environment:
    • Turn off PA auto-start: add to /etc/pulse/client.conf: autospawn = no and daemon-binary = /bin/true.
    • ~/.pulse/default.pa:

      Code: Select all

      load-module module-native-protocol-unix
      load-module module-jack-sink channels=2
      load-module module-jack-source channels=2
      load-module module-null-sink
      load-module module-stream-restore
      load-module module-rescue-streams
      load-module module-always-sink
      load-module module-suspend-on-idle
      set-default-sink jack_out
      set-default-source jack_in
      
    • Add a post-start script into qjackctl to do "pulseaudio --start" and connect the sink/source using pacmd.
This last configuration is working perfectly for USB devices. But, ALSA is now unable to use my laptop's built-in hardware. I think it's not related to the PA configuration, because JACK-native applications are affected as well.

ALSA had been working with the default hardware until I set up the last (autospawn=no) configuration.

Oh, wait... SuperCollider's level meter shows the laptop's built-in microphone is pushing audio in. But if I play something (e.g. SC --> JACK --> ALSA --> built-in), I hear nothing, no matter what I do in alsamixer. (Yes, I checked alsamixer and raised the level of master, headphone, speaker and PCM.)

So: built-in mic = no problem; built-in speakers/headphones = nothing.

I don't quite know where to start with this. I never had a problem with the built-in hardware -- in my previous Ubuntu installations, hw:PCH always "just worked."

TIA,
James
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: Audio config: ALSA not playing out to built-in HW

Post by tramp »

Hi

I don't know what goes wrong exactly with your configuration, but, to get rid of
hjhmusic wrote:Turn off PA auto-start: add to /etc/pulse/client.conf: autospawn = no and daemon-binary = /bin/true.
and integrate pulse smooth within jack over qjackctl, this one may be of some help:
https://github.com/brummer10/pajackconnect
On the road again.
hjhmusic
Established Member
Posts: 18
Joined: Mon Nov 07, 2016 3:24 am
Been thanked: 1 time

Re: Audio config: ALSA not playing out to built-in HW

Post by hjhmusic »

tramp wrote:I don't know what goes wrong exactly with your configuration, but, to get rid of
hjhmusic wrote:Turn off PA auto-start: add to /etc/pulse/client.conf: autospawn = no and daemon-binary = /bin/true.
and integrate pulse smooth within jack over qjackctl, this one may be of some help:
https://github.com/brummer10/pajackconnect
Interesting. Should I worry about this?

Code: Select all

dlm@dlm-E431:~/share/tools$ sudo dpkg -i pajackconnect_0.1_all.deb 
Selecting previously unselected package pajackconnect.
(Reading database ... 334748 files and directories currently installed.)
Preparing to unpack pajackconnect_0.1_all.deb ...
Unpacking pajackconnect (0.1) ...
dpkg: dependency problems prevent configuration of pajackconnect:
 pajackconnect depends on dh-systemd (>= 1.5); however:
  Package dh-systemd is not installed.

dpkg: error processing package pajackconnect (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 pajackconnect
dlm@dlm-E431:~/share/tools$ sudo apt-get install dh-systemd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  snap-confine
Use 'sudo apt autoremove' to remove it.
Suggested packages:
  augeas-tools
The following NEW packages will be installed:
  dh-systemd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 18.0 kB of archives.
After this operation, 67.6 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 dh-systemd all 1.29ubuntu4 [18.0 kB]
Fetched 18.0 kB in 0s (67.9 kB/s)   
Selecting previously unselected package dh-systemd.
(Reading database ... 334754 files and directories currently installed.)
Preparing to unpack .../dh-systemd_1.29ubuntu4_all.deb ...
Unpacking dh-systemd (1.29ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up dh-systemd (1.29ubuntu4) ...
Setting up pajackconnect (0.1) ...
logname: no login name
dpkg: error processing package pajackconnect (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
James
hjhmusic
Established Member
Posts: 18
Joined: Mon Nov 07, 2016 3:24 am
Been thanked: 1 time

Re: Audio config: ALSA not playing out to built-in HW

Post by hjhmusic »

hjhmusic wrote:Interesting. Should I worry about this?

Code: Select all

... snip ...
dpkg: error processing package pajackconnect (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
Apparently I should worry: pajackconnect crashed upon reboot. Not gonna waste time with that.

But... it seems the XF86AudioMute key's light is on, and if I press the key, it doesn't turn off. Possibly this is killing the audio output.

Anyone know about that?

James
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: Audio config: ALSA not playing out to built-in HW

Post by tramp »

hjhmusic wrote:

Code: Select all

Setting up pajackconnect (0.1) ...
logname: no login name
dpkg: error processing package pajackconnect (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
don't use gnome-terminal, it has a bug regarding logname:
https://bugs.launchpad.net/ubuntu/+sour ... ug/1537645
At least it means that pajackconnect isn't properly installed, so the results, are uncertain.:
hjhmusic wrote:Apparently I should worry: pajackconnect crashed upon reboot.
hjhmusic wrote:Not gonna waste time with that.
Okay, understand that, good luck by solving your issue.
On the road again.
hjhmusic
Established Member
Posts: 18
Joined: Mon Nov 07, 2016 3:24 am
Been thanked: 1 time

Re: Audio config: ALSA not playing out to built-in HW

Post by hjhmusic »

tramp wrote:
hjhmusic wrote:

Code: Select all

Setting up pajackconnect (0.1) ...
logname: no login name
dpkg: error processing package pajackconnect (--configure):
 subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
don't use gnome-terminal, it has a bug regarding logname:
https://bugs.launchpad.net/ubuntu/+sour ... ug/1537645
At least it means that pajackconnect isn't properly installed, so the results, are uncertain.
Oh, that's hilarious. I might try it again later in xterm, but I'm content with my usual approach.

Perhaps I'll take the issue over to ubuntuforums, then. At this point, it looks like the problem is that the hardware is muting the built-in audio output. That is, the F1 key on my laptop has a little orange light and a mute icon. The orange light is always on, and pressing the key doesn't toggle. That's new behavior, never happened before.

Again, mic input from the built-in hardware is fine -- so ALSA seems to be connecting to the built-in sound card just fine.

James
Last edited by hjhmusic on Sat Jul 22, 2017 6:28 pm, edited 1 time in total.
User avatar
sysrqer
Established Member
Posts: 2519
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: Audio config: ALSA not playing out to built-in HW

Post by sysrqer »

hjhmusic wrote: GOAL: I want all audio traffic to go through JACK, all the time -- JACK launches ALSA. Unfortunately, I can't do without PulseAudio. I want PA *always* to use the JACK source and sink, and *never* to connect independently to a different sound card.
At least as far as this is concerned, cadence is the easiest way I've come across for achieving this. Just start jack from it, press start for the alsa and pulseaudio bridges and it all works. Have you tried this?
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: Audio config: ALSA not playing out to built-in HW

Post by tramp »

sysrqer wrote:At least as far as this is concerned, cadence is the easiest way I've come across for achieving this. Just start jack from it, press start for the alsa and pulseaudio bridges and it all works. Have you tried this?
So the issue with cadence is solved for you?
viewtopic.php?f=19&t=13234&p=79922&hili ... dio#p79922
On the road again.
User avatar
sysrqer
Established Member
Posts: 2519
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: Audio config: ALSA not playing out to built-in HW

Post by sysrqer »

tramp wrote:
sysrqer wrote:At least as far as this is concerned, cadence is the easiest way I've come across for achieving this. Just start jack from it, press start for the alsa and pulseaudio bridges and it all works. Have you tried this?
So the issue with cadence is solved for you?
viewtopic.php?f=19&t=13234&p=79922&hili ... dio#p79922
No :(
Using qjackctl with your script solves the problem, I can use the built in volume icon in plasma 5 to send media players etc to my HDMI card. Cadence does not allow me to do this, it still just shows jack sink entry in the volume icon and no HDMI. According to this reply viewtopic.php?f=47&t=16769#p79875 this is expected... I don't know whether I didn't explain very well but it seems like a bug to me if qjackctl can allow me to do it. I don't know, I just stick to qjackctl until something changes.

I mean, I can use cadence with pulseaudio and alsa bridged, that works fine. If you just want to forward everything to the jack output it works perfectly, but with qjackctl I can send audio to my HDMI and not the JACK output.
hjhmusic
Established Member
Posts: 18
Joined: Mon Nov 07, 2016 3:24 am
Been thanked: 1 time

Re: Audio config: ALSA not playing out to built-in HW

Post by hjhmusic »

It's with some embarrassment that I have to report: In fact, sound was muted in alsamixer, but I was confused because the faders were up. That was pretty dumb. I hadn't noticed because I didn't use "M" before.

So... never mind. It's working now.

Thanks for the advice.
James
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: Audio config: ALSA not playing out to built-in HW

Post by rghvdberg »

don't feel bad, this has happened to many users :-)

also
LOL :lol:
Post Reply