aseering / wsl_gui_autoinstall

Automatically install X Windows and PulseAudio within a WSL (Bash on Windows on Linux) environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows Pulseaudio failure

sneakernets opened this issue · comments

Using this script to install PulseAudio on Windows, this happens on startup:

C:\Users\Firstname Lastname>C:\Users\FIRSTN~1\AppData\Roaming\PulseAudio\bin\pulseaudio.exe --exit-idle-time=-1
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.
W: [(null)] pulsecore/core.c: failed to allocate shared memory pool. Falling back to a normal memory pool.
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.
W: [(null)] modules/module-waveout.c: Sample spec not supported by WaveIn, falling back to default sample rate.
E: [(null)] modules/module-waveout.c: Failed to open WaveIn.
E: [(null)] modules/module-waveout.c: Error: A device ID has been used that is out of range for your system.
E: [(null)] pulsecore/module.c: Failed to load module "module-waveout" (argument: "sink_name=output source_name=input"): initialization failed.
E: [(null)] daemon/main.c: Failed to load directory.
E: [(null)] daemon/main.c: Module load failed.
E: [(null)] daemon/main.c: Failed to initialize daemon.
W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on Win32.

I don't think this is your fault.

I'm using a combo PCI VGA card/Sound card with an HDMI output. I can't really change this configuration physically, it's just what it is. Looking on Google, I'm in the same RMS Titanic as these unfortunate folks.

I can't check 'pacmd' because PulseAudio insists on shutting down if it can't find anything, and 'pacmd' requires PulseAudio as a service to run, so I can't even figure out what PulseAudio is seeing on my box. It's not logging any specific errors, either.

It doesn't help that I have...counts six "sound cards" according to Windows. All of them serve different functions and cannot be readily disabled.

If it helps, the IRQ is 16 and the Port address ranges are as follows:

E000 - E07F
03B0 - 03BB
03C0 - 03DF

All of these are set up by the BIOS and I'm hesitant to change them.

For completeness, here are the errors on the "other side":

/usr/bin/pulseaudio: error while loading shared libraries: libprotocol-esound.so: cannot open shared object file: No such file or directory
/usr/bin/pulseaudio: error while loading shared libraries: libprotocol-esound.so: cannot open shared object file: No such file or directory
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
SDL: Failed to open audio device! (buffer = 8192 bytes)..
SDL: Try setting "Force 2^n sizes" in the config menu and restarting.
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

RtMidiIn::initialize: error creating ALSA sequencer input client object.


RtMidiIn::initialize: error creating ALSA sequencer input client object.

Failed to initialise ALSA MIDI support.

It doesn't help that a lot of older software products I have don't understand this configuration very well either. I ran into a similar issue using a Piggyback videocard configuration - the sound card kept switching contexts from application to application - a total mess.

Hm... Unfortunately, I don't have any ideas about this either... Maybe the Pulseaudio team would know more?

Hi sneakernets, it looks like I have the same problem. Did you take it elsewhere, and/or make any progress?
Thanks.
Also note that the link you posted doesn't work, at least for me.

Ah, the internet provided a fix/workaround - for my problem, at least. Woohoo!

edit ...etc\pulse\default.pa

change the line where waveout module is loaded and add record=0. That fixed it for me.

For the record, here is my verbose output before this fix: https://gist.github.com/AlisterH/ffea858f2d44e712880dc2ca49faad33

To be clear: this is of course the ..etc\pulse\default.pa on Windows, not in the Ubuntu filesystem. i.e. %APPDATA%\PulseAudio\etc\pulse\default.pa

Oh wow thanks!

Unfortunately the Fall Creators update has broken this completely. oh my god.

In a "legacy install" or a distro installed from the Windows store, or both?

The problem could be a missing or deactivated microphone on the windows-pc. I have tested with windows 10 fall creators update. When you use a headset including microphone you should have no problem.

I'm still having to keep the Fall Creator's update from installing, apparently an insider build has fixed the new issues, but I can't risk running beta stuff at work.

for what it's worth, rumor has it that the next Windows release (the Spring Creator's Update -- not an Insider build) will be released within a week or two, and should contain all Insider fixes to date.

PulseAudio might be completely fixed with that update; this fork may no longer be necessary? I haven't tested it yet, though.

Does anyone know if this has been resolved? I really don't have the ability to test it as I may lose the ability to play sound completely.

I for one still have this problem and have a very similar error msg

edit etc\pulse\default.pa

change the line where waveout module is loaded and add record=0. That fixed it for me.

This works for me too.

edit etc\pulse\default.pa
change the line where waveout module is loaded and add record=0. That fixed it for me.

wow, may you post the output? I don't know what's the output expected to be after the editing. @AlisterH @hacker1024

I think I found a work around

I have been have the same problem. I got mine working by launching pulseaudio.exe with --use-pid-file=false switch.

pulseaudio.exe --use-pid-file=false -D

I hope this helps!

While launching pulseaudio with the --use-pid-file=false -D to ignore the existence of a pid file works, just keep in mind that the reason this happens is due to the pid file not being managed after closing pulseaudio. So if you go to %USERPROFILE%\.pulse\%USERDOMAIN%-runtime\ in your explorer you will find a ghost pid file. Since the system finds that pid file it thinks pulseaudio is already running and to avoid running the process twice it closes the new instance of pulseaudio. Now that you know this you can on the "Linux" side create a script to delete the pid if pulseaudio is not running. I recommend something like the GNU app entr to replace the lack of systemd on wsl and Windows and manage your init events.

For now, you can use two simple aliases like those to start and kill pulseaudio after a crash:

## first the name of the alias, then the route to cmd (if already in your path `cmd.exe` or the full wsl route), then the "/c" or "-c" flag for a command, then in quotes the windows route to pulseaudio.exe and start it daemonized, finally a "&" to send it to the background.
alias wpulseaudio='/mnt/c/Windows/System32/cmd.exe /c "C:\soft\pulseaudio\bin\pulseaudio.exe --daemonize" &'
## bellow the alias, then just like above the wsl route to cmd.exe, the command flag "/c", next you can either use "taskkill.exe /IM" or "tskill" to end the process (check both commands to learn more), then if killing pulseaudio fails delete the pid file.
alias kpulseaudio='cmd.exe /c tskill pulseaudio || rm -f /mnt/c/Users/Intel/.pulse/GIGABYTE-runtime/pid'

or use a script or whatever, be creative.

I also have the issue. Thanks @ertwro for sharing a solution!
How can I test if it's working properly? Is there a software I can install on Windows or WSL that would use pulseaudio?
I'm trying to make a docker container output sound and it may be other config that make it not work. Therefore I want to validate it in a reliable way before digging into docker :-)

Thanks in advance!
Cheers ;-)

Ah, the internet provided a fix/workaround - for my problem, at least. Woohoo!

edit ...etc\pulse\default.pa
change the line where waveout module is loaded and add record=0. That fixed it for me.

For the record, here is my verbose output before this fix: https://gist.github.com/AlisterH/ffea858f2d44e712880dc2ca49faad33

Can you please send your email id. i have few doubts regarding pulse audio testing in windows.

Ah, the internet provided a fix/workaround - for my problem, at least. Woohoo!

edit ...etc\pulse\default.pa
change the line where waveout module is loaded and add record=0. That fixed it for me.

For the record, here is my verbose output before this fix: https://gist.github.com/AlisterH/ffea858f2d44e712880dc2ca49faad33

Can you please send your email id. i have few doubts regarding pulse audio testing in windows.

Maybe best to post them here

Ah, the internet provided a fix/workaround - for my problem, at least. Woohoo!

edit ...etc\pulse\default.pa
change the line where waveout module is loaded and add record=0. That fixed it for me.

For the record, here is my verbose output before this fix: https://gist.github.com/AlisterH/ffea858f2d44e712880dc2ca49faad33

Can you please send your email id. i have few doubts regarding pulse audio testing in windows.

Maybe best to post them here
Hi,
am able to build pulseaudio v13.99.1 for windows PC using MinGW.

Now, I am trying to test it on Windows PC and getting below messages. Also could not record using audacity (i.e when we record in audacity , no logs/message from pulse audio which means it is not going through pulse audio).

Please suggest me how to test it on windows PC.

C:\Users\Nathan\Desktop\New folder>pulseaudio.exe -vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

I: [(null)] pulsecore/core-util.c: Successfully gained high priority class.

I: [(null)] daemon/main.c: This is PulseAudio 13.99.1

D: [(null)] daemon/main.c: Compilation host: i686-pc-mingw32

D: [(null)] daemon/main.c: Compilation CFLAGS: -g -O0 -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto

D: [(null)] daemon/main.c: Running on host: Windows 6.2 (9200)

D: [(null)] daemon/main.c: Found 1 CPUs.

I: [(null)] daemon/main.c: Page size is 4096 bytes

D: [(null)] daemon/main.c: Compiled with Valgrind support: no

D: [(null)] daemon/main.c: Running in valgrind mode: no

D: [(null)] daemon/main.c: Running in VM: no

D: [(null)] daemon/main.c: Running from build tree: no

D: [(null)] daemon/main.c: Optimized build: no

D: [(null)] daemon/main.c: All asserts enabled.

I: [(null)] daemon/main.c: Machine ID is DESKTOP-HAHJH0Q.

W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on this platform.

I: [(null)] daemon/main.c: Using runtime directory C:\Users\Nathan.pulse\DESKTOP-HAHJH0Q-runtime.

W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on this platform.

I: [(null)] daemon/main.c: Using state directory C:\Users\Nathan.pulse.

I: [(null)] daemon/main.c: Using modules directory C:\Users\Nathan\Desktop\New folder\lib\pulse-13.99\modules.

I: [(null)] daemon/main.c: Running in system mode: no

W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on this platform.

W: [(null)] pulsecore/pid.c: Stale PID file, overwriting.

I: [(null)] daemon/main.c: System supports high resolution timers

W: [(null)] pulsecore/core.c: Failed to allocate shared posix-shm memory pool. Falling back to a normal memory pool.

D: [(null)] pulsecore/memblock.c: Using private memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65496

I: [(null)] pulsecore/cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2

I: [(null)] pulsecore/svolume_mmx.c: Initialising MMX optimized volume functions.

I: [(null)] pulsecore/remap_mmx.c: Initialising MMX optimized remappers.

I: [(null)] pulsecore/svolume_sse.c: Initialising SSE2 optimized volume functions.

I: [(null)] pulsecore/remap_sse.c: Initialising SSE2 optimized remappers.

I: [(null)] pulsecore/sconv_sse.c: Initialising SSE2 optimized conversions.

W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on this platform.

I: [(null)] modules/module-device-restore.c: Successfully opened database file 'C:\Users\Nathan.pulse\DESKTOP-HAHJH0Q-device-volumes'.

I: [(null)] pulsecore/module.c: Loaded "module-device-restore" (index: #0; argument: "").

W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on this platform.

I: [(null)] modules/module-stream-restore.c: Successfully opened database file 'C:\Users\Nathan.pulse\DESKTOP-HAHJH0Q-stream-volumes'.

I: [(null)] pulsecore/module.c: Loaded "module-stream-restore" (index: #1; argument: "").

W: [(null)] pulsecore/core-util.c: Secure directory creation not supported on this platform.

I: [(null)] modules/module-card-restore.c: Successfully opened database file 'C:\Users\Nathan.pulse\DESKTOP-HAHJH0Q-card-database'.

I: [(null)] pulsecore/module.c: Loaded "module-card-restore" (index: #2; argument: "").

I: [(null)] pulsecore/module.c: Loaded "module-augment-properties" (index: #3; argument: "").

I: [(null)] pulsecore/module.c: Loaded "module-switch-on-port-available" (index: #4; argument: "").

D: [(null)] modules/module-waveout.c: WaveIn subsystem opened.

D: [(null)] modules/module-waveout.c: WaveOut subsystem opened.

D: [(null)] modules/module-device-restore.c: Database contains no data for key: source:input

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: source:input:null

I: [(null)] pulsecore/source.c: Created source 0 "input" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right

I: [(null)] pulsecore/source.c: device.description = "WaveIn on Microsoft Sound Mapper"

I: [(null)] pulsecore/source.c: device.icon_name = "audio-input-microphone"

D: [(null)] modules/module-device-restore.c: Database contains no data for key: sink:output

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: sink:output:null

I: [(null)] pulsecore/sink.c: Created sink 0 "output" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right

I: [(null)] pulsecore/sink.c: device.description = "WaveOut on Microsoft Sound Mapper"

I: [(null)] pulsecore/sink.c: device.icon_name = "audio-card"

D: [(null)] modules/module-device-restore.c: Database contains no data for key: source:output.monitor

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: source:output.monitor:null

I: [(null)] pulsecore/source.c: Created source 1 "output.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right

I: [(null)] pulsecore/source.c: device.description = "Monitor of WaveOut on Microsoft Sound Mapper"

I: [(null)] pulsecore/source.c: device.class = "monitor"

I: [(null)] pulsecore/source.c: device.icon_name = "audio-input-microphone"

D: [(null)] modules/module-waveout.c: Poll timeout = 23.2 ms

D: [(null)] modules/module-waveout.c: Thread starting up

I: [(null)] pulse/util.c: Successfully enabled THREAD_PRIORITY_TIME_CRITICAL scheduling for thread.

D: [(null)] pulsecore/sink.c: output: state: INIT -> IDLE

D: [(null)] pulsecore/source.c: output.monitor: state: INIT -> IDLE

I: [(null)] pulsecore/core.c: default_source: (unset) -> output.monitor

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: sink:output:null

I: [(null)] pulsecore/core.c: default_sink: (unset) -> output

D: [(null)] pulsecore/core-subscribe.c: Dropped redundant event due to change event.

D: [(null)] pulsecore/source.c: input: state: INIT -> IDLE

I: [(null)] pulsecore/core.c: default_source: output.monitor -> input

D: [(null)] pulsecore/core-subscribe.c: Dropped redundant event due to change event.

I: [(null)] pulsecore/module.c: Loaded "module-waveout" (index: #5; argument: "sink_name=output source_name=input").

D: D: [(null)] pulsecore/modu[(null)] modules/module-waveout.c: WaveIn overflow!

le.c: Checking for existence of 'C\module-detect.so': failure

D: [(null)] pulsecore/module.c: Checking for existence of '/Users/Nathan/Desktop/New folder/lib/pulse-13.99/modules\module-detect.so': failure

D: [(null)] pulsecore/module.c: Checking for existence of 'C\module-jackdbus-detect.so': failure

D: [(null)] pulsecore/module.c: Checking for existence of '/Users/Nathan/Desktop/New folder/lib/pulse-13.99/modules\module-jackdbus-detect.so': failure

I: [(null)] daemon/main.c: Daemon startup complete.

D: [(null)] modules/module-device-restore.c: Database contains no data for key: sink:output

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: sink:output:null

I: [(null)] modules/module-device-restore.c: Storing port for device sink:output.

I: [(null)] modules/module-device-restore.c: Storing volume/mute for device+port sink:output:null.

D: [(null)] modules/module-device-restore.c: Database contains no data for key: source:output.monitor

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: source:output.monitor:null

I: [(null)] modules/module-device-restore.c: Storing port for device source:output.monitor.

I: [(null)] modules/module-device-restore.c: Storing volume/mute for device+port source:output.monitor:null.

D: [(null)] modules/module-device-restore.c: Database contains no data for key: source:input

D: [(null)] modules/module-device-restore.c: Database contains no (or invalid) data for key: source:input:null

I: [(null)] modules/module-device-restore.c: Storing port for device source:input.

I: [(null)] modules/module-device-restore.c: Storing volume/mute for device+port source:input:null.

I: [(null)] modules/module-device-restore.c: Synced.

Best Regards,
Yugesh.

Sorry, I can't really help with that.
I'm not actually sure if it is possible to get recording to work, and it isn't obvious to me if you're saying you have problems with playback too. That log does look odd, looking for a .so on Windows.

Ah, the internet provided a fix/workaround - for my problem, at least. Woohoo!

edit ...etc\pulse\default.pa
change the line where waveout module is loaded and add record=0. That fixed it for me.

For the record, here is my verbose output before this fix: https://gist.github.com/AlisterH/ffea858f2d44e712880dc2ca49faad33

It is worked for me thanks
pulseaudio

Just for the records, even if you get the error E: [(null)] daemon/main.c: Failed to load directory the Pulseaudio server is running. If the PULSE_SERVER environment variable is set correctly in WSL

export HOST_IP=$(ip route | grep default | awk '{print $3}')
export PULSE_SERVER=tcp:$HOST_IP

and pulseaudio.exe is running on Windows with the default.pa file edited as described above

load-module module-waveout sink_name=output source_name=input record=0
load-module module-native-protocol-tcp auth-ip-acl=0.0.0.0 auth-anonymous=1

it should work.

I'm sorry for the noobish post here, guys, but there's not much information about this setup on the web so could you direct me somewhere where I find how to setup pulseaudio-client on windows machine streaming to linux host? or type it here...

I've been doing quite a bit of work on the PulseAudio Windows port recently, and have a fully-working bleeding-edge build here: https://pgaskin.net/pulseaudio-win32.

I've been doing quite a bit of work on the PulseAudio Windows port recently, and have a fully-working bleeding-edge build here: https://pgaskin.net/pulseaudio-win32.

I am getting some errors while running your program so please help me fix it:
image