Convert ALSA to PulseAudio

versatile 64-bit multi-user Linux distribution


Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
User avatar
don570
Posts: 770
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 144 times

Convert ALSA to PulseAudio

Post by don570 »

I am converting Fatdog64 903 from ALSA to PulseAudio
because my computer (hp elitedesk 800) has problems with discovering the audio-in port with fatdog64
but not with Operating systems using PulseAudio i.e. EasyOS and BookwormPup
I downloaded and installed--->
https://distro.ibiblio.org/fatdog/sfs/9 ... x86_64.sfs
and installed
I added elogind-243.7-x86_64-1.sfs as well but I don't think that is needed

I used the control panel
System > System SFS Loader

Screenshot-sfs-loader.png
Screenshot-sfs-loader.png (31.73 KiB) Viewed 2357 times

_______________________________________________

Next step
- stop ALSA and start PulseAudio

System > Manage Servers and Services

Screenshot-services.png
Screenshot-services.png (36.73 KiB) Viewed 2357 times

_____________________________________

I rebooted and then set the sound card using control panel

Sound > Fatdog64 Set Default Sound Card

Screenshot-pulse.png
Screenshot-pulse.png (32.2 KiB) Viewed 2357 times

_________________________________________-

To record I set input volume
Start Menu > Multimedia > PulseAudio Volume Control

set recording volume from Input devices
_____________________________________________

I found that mhwaveedit doesn't record - perhaps gwaveedit will. I will experiment with
https://distro.ibiblio.org/easyos/amd64 ... -64.tar.xz

____________________________________________________

I was able to record with following command...
This recorded low quality mp3

Code: Select all

ffmpeg -f  alsa -i hw:0 -ar 11025 -ac 1 -b:a 8k  -codec:a libmp3lame       -t 15 -y  output.mp3

_____________________________________________

I can't record

Code: Select all

ffmpeg -f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo  -channels 2  -y -t 30  out-pulse.wav

Unknown input format: 'pulse
___________________________________________________________

User avatar
Flash
Moderator
Posts: 1023
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 58 times
Been thanked: 138 times

Re: Convert ALSA to PulseAudio

Post by Flash »

Are you asking for help to record with pulse, or just making a comment?

Chaos coordinator :?
User avatar
fredx181
Posts: 3385
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 437 times
Been thanked: 1484 times
Contact:

Re: Convert ALSA to PulseAudio

Post by fredx181 »

don570 wrote: Mon Feb 24, 2025 10:05 pm

I can't record

Code: Select all

ffmpeg -f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo  -channels 2  -y -t 30  out-pulse.wav

Unknown input format: 'pulse
___________________________________________________________

Probably has to do with your ffmpeg installed.
I have ffmpeg version 5.1.6-0+deb12u1 running on Debian and works ok with -f pulse, (probably because compiled with --enable-libpulse :?: )

User avatar
don570
Posts: 770
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 144 times

Re: Convert ALSA to PulseAudio

Post by don570 »

Are you asking for help to record with pulse, or just making a comment?

I'm explaining what works and what doesn't.

mhwaveedit ---> I did get to record when I went to mhwaveedit preferences and set the input device to 'default' hw:0

________________________________________________

User avatar
don570
Posts: 770
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 144 times

Re: Convert ALSA to PulseAudio

Post by don570 »

Probably has to do with your ffmpeg installed.
I have ffmpeg version 5.1.6-0+deb12u1 running on Debian and works ok with -f pulse, (probably because compiled with --enable-libpulse :?: )

Sounds like the reason. I'll check.

With Easy OS Scarthgap --->
I can record with ffmpeg -f alsa -i default or ffmpeg -f pulse -i <device>

Also 'arecord' works in Easy OS Scarthgap
_____________________________________

step
Posts: 576
Joined: Thu Aug 13, 2020 9:55 am
Has thanked: 63 times
Been thanked: 213 times
Contact:

Re: Convert ALSA to PulseAudio

Post by step »

@don570, thank you for explaining what works and what doesn't.

I built a version of ffmpeg with pulseaudio support (thanks @fredx181 for mentioning libpulse), and created an SFS. Get it from "Control Panel > System > SFS Manager". I confirmed that I can record with ffmpeg -f pulse from my ALSA mono input.

Unlike you, I didn't change the ALSA server boot configuration, nor did I reboot. I loaded the pulseaudio and ffmpeg-pulseaudio SFS packages using SFS Manager, then started the PulseAudio server from Control Panel, and changed the default sound card to ALSA-pulseaudio bridge.
Then:

Code: Select all

pulse -sources     # to find out the pulseaudio name of my ALSA input hardware
ffmpeg -f pulse -i 'alsa_input.<my hardware>.mono-fallback' -channels 1 -y -t 30  /tmp/out-pulse.wav
^C

and played out-pulse.wav with vlc.

User avatar
don570
Posts: 770
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 144 times

Re: Convert ALSA to PulseAudio

Post by don570 »

I compiled and installed a new version of ffmpeg and now it records with the command

ffmpeg -f pulse <etc>

I like Pulse....PulseAudio finds audio devices in a nicer way :thumbup2:

Code: Select all

pactl list short sources

I made the version of ffmpeg available...
viewtopic.php?t=13955

Remember that the SFS has to installed and the audio device control panel
must be set to convert alsa audio stream to pulse
https://distro.ibiblio.org/fatdog/sfs/9 ... x86_64.sfs

User avatar
fredx181
Posts: 3385
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 437 times
Been thanked: 1484 times
Contact:

Re: Convert ALSA to PulseAudio

Post by fredx181 »

don570 wrote: Mon Mar 03, 2025 6:50 pm

...
I like Pulse....PulseAudio finds audio devices in a nicer way :thumbup2:

Code: Select all

pactl list short sources

....

Me too, I sometimes record from soundcard ("what-u-hear") and AFAIK with bare ALSA you need to mess with a config file , e.g. /etc/asound.conf or ~/.asoundrc .
With pulse (or pipewire, which I use) I just do like this:

Code: Select all

pactl list short sources
49	alsa_output.pci-0000_00_0e.0.analog-stereo.monitor	PipeWire	s32le 2ch 48000Hz	IDLE
50	alsa_input.pci-0000_00_0e.0.analog-stereo	PipeWire	s32le 2ch 48000Hz	SUSPENDED

And:
ffmpeg -f pulse -i 49 ... ... or: ffmpeg -f pulse -i alsa_output.pci-0000_00_0e.0.analog-stereo.monitor ... ...

User avatar
don570
Posts: 770
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 144 times

Re: Convert ALSA to PulseAudio

Post by don570 »

I believe that
alsa_output.pci-0000_00_0e.0.analog-stereo.monitor

would be useful for recording the music heard in the background of a game
or perhaps the soundtrack of a DVD

But I think that people use it to record a voice track to video
_______________________________________________________

User avatar
fredx181
Posts: 3385
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 437 times
Been thanked: 1484 times
Contact:

Re: Convert ALSA to PulseAudio

Post by fredx181 »

don570 wrote: Tue Mar 04, 2025 11:41 pm

I believe that
alsa_output.pci-0000_00_0e.0.analog-stereo.monitor

would be useful for recording the music heard in the background of a game
or perhaps the soundtrack of a DVD

But I think that people use it to record a voice track to video
_______________________________________________________

Not sure what you mean to say exactly, for me it just works to record the audio that comes out of my speakers, e.g. from web browser playing media (from e.g. YouTube) or whatever sound playing.

User avatar
don570
Posts: 770
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 144 times

Re: Convert ALSA to PulseAudio

Post by don570 »

Not sure what you mean to say exactly,

I was referring to this page which recommends 'monitor' source when recording an application
https://trac.ffmpeg.org/wiki/Capture/PulseAudio

Screenshot 2025-03-05 14.52.33.png
Screenshot 2025-03-05 14.52.33.png (41.66 KiB) Viewed 989 times

_______________________________________________________

User avatar
fredx181
Posts: 3385
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 437 times
Been thanked: 1484 times
Contact:

Re: Convert ALSA to PulseAudio

Post by fredx181 »

don570 wrote: Wed Mar 05, 2025 7:57 pm

Not sure what you mean to say exactly,

I was referring to this page which recommends 'monitor' source when recording an application
https://trac.ffmpeg.org/wiki/Capture/PulseAudio
Screenshot 2025-03-05 14.52.33.png
_______________________________________________________

Ah, I see, but in fact I never play multiple sound sources at the same time, just one (otherwise I could get crazy ;) )

Post Reply

Return to “FatDog64”