WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: apulse wrapper for Firefox Audio  (Read 6697 times)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
apulse wrapper for Firefox Audio
« on: July 29, 2017, 10:44:43 PM »
Instead of installing and setting up dbus with pulse-audio etc. etc., try "apulse-wrapper"  for a much lighter Firefox Audio installation.

I'll upload an apulse extension, meanwhile please try this script which downloads, compiles and installs alsa-pulse wrapper on TC-8.x x86 and x86_64
be sure to configure Alsa without pulseaudio running then run this script.

Works fine with Firefox on TC-8.x x86 and x86_64 with:
YouTube Video
Deezer
Pandora (pandora also requires libavcodec.tcz)


Note: this alsa pulseaudio wrapper works with Firefox and may conflict with other media players.

Offline archerbob

  • Newbie
  • *
  • Posts: 35
Re: apulse wrapper for Firefox Audio
« Reply #1 on: October 27, 2017, 06:11:07 PM »
I tried it, it downloaded and installed and configured a heap of stuff and firefox/youtube still has no sound.  With a bar opening at the top stating I need to install pulseaudo... which is already installed :/

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: apulse wrapper for Firefox Audio
« Reply #2 on: October 27, 2017, 06:36:12 PM »
Hi archerbob

First Alsa must be working, is Alsa working? can you test with speaker-test ?

If you've already installed PulseAudio and is running as per PulseAudio info file instructions then do not install Apulse, its either one or the other..

depending on the audio source firefox may need to switch between Flash or HTML5

If able to configure Alsa and alsa speaker-test passes yet Apulse still fails use Pulseaudio instead to configure sound source and output.   

Also depending on the audio source you may find the extension "libavcodec.tcz" is needed

If still no sound load firefox_getLatest extension and use script at terminal in manual mode
Code: [Select]
firefox_getLatest.sh -m to downgrade to last known Firefox version (Firefox ESR v52.0) with working Alsa.  When prompted Enter
Code: [Select]
52.0esr reboot without pulseaudio or apulse

I'll be honest here, On pc's where I'm constantly having to configure sound on every reboot I simply use "Firefox ESR v52.0" as above which reliably resolves the Alsa connectivity issue
:)
« Last Edit: October 27, 2017, 07:03:46 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: apulse wrapper for Firefox Audio
« Reply #3 on: October 27, 2017, 10:00:59 PM »
I tried it, it downloaded and installed and configured a heap of stuff and firefox/youtube still has no sound.  With a bar opening at the top stating I need to install pulseaudo... which is already installed :/

I noticed from your post in another thread you're having problems starting pulseaudio  http://forum.tinycorelinux.net/index.php/topic,21471.msg134530.html#msg134530

Remember it's either pulseAudio Or Apulse, not both..

If committed to Pulseaudio please read and follow instructions in http://tinycorelinux.net/8.x/x86/tcz/pulseaudio.tcz.info
Remember Alsa must be functional and tested before attempting to configure pulseaudio
if Alsa is muted on reboot try
echo "amixer set "Master" 60 unmute" > ~/.X.d/alsa
which will set alsamixer unmute on next reboot

As described in the info file, add
sudo echo '/usr/local/etc/init.d/dbus start' >> /opt/bootlocal.sh

and
echo "start-pulseaudio-x11" > ~/.X.d/pulseaudio

then reboot and open pulseaudio to configure
« Last Edit: October 27, 2017, 10:10:35 PM by coreplayer2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: apulse wrapper for Firefox Audio
« Reply #4 on: October 28, 2017, 11:27:05 AM »
My biggest audio issues result from having multiple audio devices installed, then one has to realize we're just chasing our tails..  It's such a painful experience getting Audio to function as intended in Firefox.  So when all else fails I grab the latest "firefox" version and install "pavucontrol" following the instructions for pulseaudio install.   Set the hardware device in Pavucontrol config and output tabs and we're done.  No matter what the source, Youtube, Pandora, Deezer, etc etc all volume and hardware controls can be controlled through pavucontrol.
« Last Edit: October 28, 2017, 11:31:09 AM by coreplayer2 »

Offline archerbob

  • Newbie
  • *
  • Posts: 35
Re: apulse wrapper for Firefox Audio
« Reply #5 on: November 02, 2017, 04:58:06 PM »
I eventually got sound working in the latest version of Firefox 56.0.2 I think it is, I'll look later.

The main thing I was having issues with it seems was dbus not working and when I fixed that I had audio.

The only issue I have now is that pavucontrol, I think it's called, starts up muted every boot.  I wish it would remember my last setting, I've been pointed to /opt/.xfiletool.lst as specified in the corebook.pdf to add file/directory so settings are kept.  But I am yet to figure out which I need.
« Last Edit: November 02, 2017, 05:00:13 PM by archerbob »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: apulse wrapper for Firefox Audio
« Reply #6 on: November 02, 2017, 05:08:50 PM »
The only issue I have now is that pavucontrol, I think it's called, starts up muted every boot.  I wish it would remember my last setting, I've been pointed to /opt/.xfiletool.lst as specified in the corebook.pdf to add file/directory so settings are kept.  But I am yet to figure out which I need.
After a reboot, start alsamixer fro the terminal and check if the Master is muted?  if muted controls will be "mm"   unmuted = "00"

please advise

Offline archerbob

  • Newbie
  • *
  • Posts: 35
Re: apulse wrapper for Firefox Audio
« Reply #7 on: November 02, 2017, 10:42:21 PM »
I cant take screenshots at the moment, but what I have is a windows showing AlsaMixer v1.1.3 showing some info and a bunch of bars, these being:

Card: VIA 8237
Chip: Realtek ALC655 rev 0
View F3: [Playback]  F4 Capture  F6: All
Item: Master [dB gain: -46.50, -46.50]

Master 0<>0
Master M 0
PCM 0<>0
Surround 0<>0
Surround Shared
Center 100
LFE 0
Line 0<>0

Offline archerbob

  • Newbie
  • *
  • Posts: 35
Re: apulse wrapper for Firefox Audio
« Reply #8 on: November 03, 2017, 04:25:05 AM »
I've been doing a bit of Google and a suggestion I came across was in the form of a workaround using:

sleep 10 && amixer -c 0 set Speaker 100%

I presume I choose Master instead of Speaker and stick this in my bootlocal.sh I think it's called.  What do you think?  Will that work?

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: apulse wrapper for Firefox Audio
« Reply #9 on: November 03, 2017, 08:39:53 AM »
This will probably work.

Or you can save your ALSA settings via
Code: [Select]
sudo alsactl store
echo "usr/local/etc/alsa/asound.state" >> /opt/.filetool.lst
filetool.sh -b
and add to  /opt/bootlocal.sh
Code: [Select]
# Restore ALSA settings in a loop as it doesn't always work right away at boot.
{ ALSACTL="/usr/local/sbin/alsactl"
[ -e "$ALSACTL" ] && for i in $(seq 1 10) ; do "$ALSACTL" restore && break || sleep 0.5 ; done
[ $(which aplay) ] && aplay "/usr/local/share/sounds/gameboy_startup.wav"
} >/dev/null 2>&1 &
Download a copy and keep it handy: Core book ;)