duncanthrax / scream Goto Github PK
View Code? Open in Web Editor NEWVirtual network sound card for Microsoft Windows
License: Microsoft Public License
Virtual network sound card for Microsoft Windows
License: Microsoft Public License
I am currently using a 5.1 to 5.1 configuration.
The destination computer supports "speaker fill" - however it needs a 2.1 input signal to engage.
But since the input signal for it is 5.1 - the 'upmixing' does not engage.
The work around is to fallback to a 2.1 to 5.1 configuration. Then upon restarting the audio stream - the 'upmixing' does engage as expected. But this requires switching between 2.1 and 5.1 from source depending on the media being played - which is very inconvenient.
It would be nice to have the upmix available in the virtual sound card driver itself.
I understand that this may be beyond the scope of what this project seeks to do.
Reference material: https://chunminchang.github.io/blog/post/audio-5-1
From what I can tell, currently it's not possible to send linux audio to a windows receiver.
Would this be possible?
I basically need bidirectional audio between a windows and linux which I currently realize using
a usb-soundcard and cross-connecting headphones <-> line-in twice.
Hi, I'd like to help you to build an iOS client for Scream.
Is it something that you plan on doing in the long run?
Pulseaudio output
I'm trying to use FL Studio in a VM but Scream's latency is absurdly high...
The alsa Receiver doesn't have this issue, but I don't want to use it as pulse is so much more convenient...
When I first download scream, I assumed that the IVSHMEM version would be faster (because there wouldn't be any networking involved) and it worked perfectly, but as I later found out the normal version has noticeably less latency. When I tried to switch back though, I couldn't get it to work. Here's what I tried:
The guest is a windows 10 VM running in qemu, it's using a virtio networking interface.
The host in running linux mint 19.2 and I'm using the included pulseaudio receiver.
I can reach the guest from the host and also the host from the guest via a ping command.
What happens:
The receiver starts (no output, doesn't crash) but I can't hear any output. It does open a sound output though on the host.
Let me know if you need more information about this issue.
I am having a problem compiling the alsa Receiver under debian 8.
cheche@casa:~/git/scream/Receivers/alsa$ make
gcc -Wall -O2 -o scream-alsa scream-alsa.c -lasound
scream-alsa.c: In function ‘main’:
scream-alsa.c:298:11: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i=0; i<cur_channels; i++) {
^
scream-alsa.c:298:11: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
scream-alsa.c:299:13: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int j = k+1; j<=10; j++) {// check the channel map bit by bit from lsb to msb, starting from were we left on the previous step
^
Makefile:5: recipe for target 'scream-alsa' failed
I did a 5 sec of research and I made this change on the source:
diff --git a/Receivers/alsa/scream-alsa.c b/Receivers/alsa/scream-alsa.c
index 3b9a19a..e49de7f 100644
--- a/Receivers/alsa/scream-alsa.c
+++ b/Receivers/alsa/scream-alsa.c
@@ -295,8 +295,10 @@ int main(int argc, char *argv[])
// it goes from 0 (SPEAKER_FRONT_LEFT) up to 10 (SPEAKER_SIDE_RIGHT) following the order in ksmedia.h
// the SPEAKER_TOP_* values are not used
int k = -1;
- for (int i=0; i<cur_channels; i++) {
- for (int j = k+1; j<=10; j++) {// check the channel map bit by bit from lsb to msb, starting from were we left on the previous step
+ int i;
+ for (i=0; i<cur_channels; i++) {
+ int j;
+ for (j = k+1; j<=10; j++) {// check the channel map bit by bit from lsb to msb, starting from were we left on the previous step
if ((cur_channel_map >> j) & 0x01) {// if the bit in j position is set then we have the key for this channel
k = j;
break;
Be aware that I do not want to start any religious war about the proper use of. i just wanted to test your driver and this small change worked for me. :-)
First, thanks a lot for this great software!
When i start Rocksmith 2014, which needs the sound devices exclusive mode turned on, it starts to stutter greatly, like 0,7 seconds on and 0,7 seconds off over and over.
The sample rate and size doesn't change because they are set identically in windows and game.
If i turn off exclusive mode the sound works but the game is unplayable in that mode because it introduces too much audio lag. The game must be played with exclusive mode on, even on native systems, to be playable.
I have tried all transfer modes in scream, multicast, unicast and ivshmem and the results are the same.
I cant see any error messages in the log output.
I'm using git of today, jun 13, 2019. I have also tried earlier releases with the same result.
In all other cases it works perfectly.
Is it possible to have a configurable unicast mode, instead of multicast?
I'm asking this for two reasons: reducing network traffic (with switches without IGMP snooping) and allowing more than one sender-receiver pair in the same network without interferences.
Maybe you can read the target address from the registry?
https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/registry-key-object-routines
Great stuff by the way, even though I didn't manage to get it working via multicast, unicast is really good :)
Can you please support mono/mixed to mono streams as well ? It would reduce the throughput requirements when the output is mono - like most BT speakers for example.
My setup is a windows box, streaming to a raspi zero w, which in turn streams to ikea eneby 30 bluetooth speaker. Using a bluetooth dongle for the windows box would have worked as well, but it is no fun :)
I was getting occasional crackling in my audio when CPU load was high. I was able to largely resolve this when I reniced scream-pulse to -11, same as Pulse was. As a suggestion this could be done by the clients themselves.
Hello @duncanthrax,
It's possible to add a RTP/DLNA support for the output instead of raw PCM stream?
So great driver!
Thanks you
Thanks for the mono fix for 3.3, I've confirmed that it works by switching it on and observing the throughput in my router go down in half as opposed to stereo.
In the volume mixer I cannot mute it now via the mute/unmute button. Even when muted scream continues to play.
Volume control works.
It seems to me or the volume level is not very high?
As discussed on #35 and on Reddit I'm studying a way to have high quality, high performance audio from windows VMs to linux host with IVSHMEM or VirtIO.
The idea is to have a registry key to swith from the default networked mode to a SHM mode.
In practice I'll need to create something that mimic savedata.cpp
I have to find the documentation for IVSHMEM or VirtIO and see how much there is to do.
The receiver should be a piece of cacke. Read from an hypotetical /dev/scream-shm , write to pulse, done.
I'll start working on this after #35 is finished and merged upstream.
Hi!
Great project! I have a (specific) problem. My main intention is to I want to use my OpenWRT router as a sound server. The possible way is the PulseAudio, so I installed it on my router, so the server is working. Howewer, the pulseaudio can't run at Windows, so I searched and found the Scream, what's an alternative way to use the PC as a "PulseAudio client".
Well, now I have some problems.
Unfortunately I can't understand how to use Scream to work with my OpenWRT router, that has the PulseAudio.
If the UseIVSHMEM
DWORD in HKLM\SYSTEM\CurrentControlSet\Services\Scream\Options
contains an invalid value (eg because that user didn't read the next paragraph and set it to 1
instead of the available shmem MBs whistles), the system BSODs on the first playback attempt w/ SYSTEM_SERVICE_EXCEPTION. OS is Windows 10 1903 (18362.86).
While BSODing is a very noticeable notification that the driver is misconfigured, it is also most likely not the best way to do so :)
gcc -Wall -O2 -o scream-alsa scream-alsa.c -lasound
scream-alsa.c:4:10: fatal error: alsa/asoundlib.h: No such file or directory
#include <alsa/asoundlib.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:5: recipe for target 'scream-alsa' failed
make: *** [scream-alsa] Error 1
_____________-
gcc -Wall -o scream-pulse scream-pulse.c -lpulse-simple -lpulse
scream-pulse.c:4:10: fatal error: pulse/simple.h: No such file or directory
#include <pulse/simple.h>
^~~~~~~~~~~~~~~~
compilation terminated.
Makefile:5: recipe for target 'scream-pulse' failed
make: *** [scream-pulse] Error 1
Hi,
I am developing a multi-protocol audio receiver for linux, which also supports scream.
Check it out here: https://github.com/mincequi/cornrow.
Currently, it only supports 44.1/48 kHz, Stereo, 16 Bit.
Testers welcome; please share your feedback :)
When the Scream WDDM device is selected as output device, one cannot control the volume/loudness. More specifically, it is only possible to switch the sound on or off. If the fader is set to volume = 0, the sound is off; any other volume setting will only turn the sound on (i.e. there is no volume level adjustment possible).
This was tested on Windows 10 (1703) x64 with the latest signed drivers.
Would it be possible to support higher sample rates, like 48000 or 96000kHz?
I am running the a Windows 10 as root through libvirt (kvm/qemu), pulseaudio server is ran as non-root user on the host (Fedora 30, kernel 5.0.8-201.acspatch.fc30.x86_64 from the jlay-kernel-acspatch copr repo), root is connecting to the server as a client. For hardware I'm running a Ryzen 1700 on a B450 motherboard.
/dev/shm/scream-ivshmem exists, with permissions rw-r--r--
I tried ivshmem-pulse as non-root but had errors opening the file. I thought this was odd since I had read permission, but now I know it's trying to open with read/write access so this makes sense.
I then tried running it as root, only to discover that it's getting stuck in the while loop at line 106
Thread 1 "scream-ivshmem-" hit Breakpoint 1, main (argc=2, argv=0x7fffffffd768) at scream-ivshmem-pulse.c:106
106 while (header->magic != 0x11112014) {
(gdb) c
Continuing.
I had one breakpoint at 106 and another at 109, which was never reached.
I gave the non-root user write permission (for /dev/shm/scream-ivshmem) and tried to run the script again, but encountered the same problem.
I thought this might have been related to hugepages, so I tried running the VM without hugepages and got the same result.
I tested the raw receiver and also got stuck in the same place (line 97).
Hello, I really don't know if this is correct place for my problem, but I really think that you guys can help me.
My situation:
I want to switch to Linux (I use Linux as server for long time), only problem is for some gaming but I made GPU Passthrough for it and I use Looking Glass too, only problem is that how to pass effectively sound from Windows VM back to Linux host as some source and pass from Linux host some sound source like microphone to Windows VM.
I have 2 sound cards, one internal on the motherboard and second is external where I have my headphones with microphone plugged. Second sound card (external) I want for Linux, but I don't use internal one, so that internal can be used for VM, if there is any use case for it.
I don't know if scream can help me, if yes, then I have some additional questions:
Thank you very much
Installed Successfully, it got added in device manager.
but device not showing in "Playback Devices List". Restarted multiple times.
Screenshot: https://i.postimg.cc/tRvp4XWy/Screenshot-2019-01-23-at-11-10-15-PM.png
As the title says, please consider specifying a license for the code you wrote.
Thanks.
I am not sure if this is just an issue for me but I cannot seem to get a local windows udp client to receive packets from the multicast stream. I've run both the client packaged with scream as well as a UDP client noted here: https://gist.github.com/hostilefork/f7cae3dc33e7416f2dd25a402857b6c6 on the same machine that has the scream virtual driver installed on it. Neither of them pick up the stream. Any assistance would be greatly appreciated!
The hash for the file is not present in the specified catalog file. The file is likely corrupt or the victum of tampering.
As for the bat,
devcon failed
When I'm using the multicast config, it works, but when I switch to SHMEM variant using the registry, no sound is picked up on the receiver (host) side. I quadruple-checked the registry key name, value and type (UseIVSHMEM, DWORD=2)
The Win10 guest has the virtual audio output device and the mixer is showing sound is played.
On the host side:
I'm not using looking-glass, scream is the only shmem entry defined for the VM
Can't test with the scream-ivshmem-test.exe since the links I found to that executable are expired :(
Am I missing something?
I installed the virtual machine sound card in the virtual machine equipped with windows7 system, and used the IVSHMEM to conduct sound test. Everything was normal, but occasionally there was a little noise.This is a real headache. I wonder what all about.
Thank you so much.
Not sure if this is distro/version specific but somehow sounds from Windows get the channels reversed, meanwhile sounds played within Debian are mapped correctly.
It's not clear to me where in the chain the channels get reversed, is there any known way to play the network stream with mpv or vlc for debugging?
I'm not sure if this would be possible but asking doesn't hurt I guess/hope.
I'm (again) searching for a way to transfer 5.1 audio from windows to linux (as close to real-time as possible).
As this is a VM Guest <-> Host setup, I should be able to bring network latency down quite a bit fingers crossed
Given that scream just dumps raw PCM data, and PCM can hold more than 2 channels it should be possible right?
It would be just a matter of the virtual device driver to support configuration of more than 2 channels.
I'm obviously just guessing though :)
I follow the instructions as stated, and am not getting any sound from pulseaudio. /dev/shm/scream-ivshmem is created on VM boot, but is an empty file and remains so even during audio playback with the Scream WDM listed as speakers in windows.
I think something is preventing it from writing to the IVSHMEM file.
[korey@hydra a]$ cat /dev/shm/scream-ivshmem
The above gives me no output at all. However, in my Windows VM I tried Red Hat's "ivshmem-test.exe" in virtio-win10-prewhql-0.1-161 and catting again gave me expected garbage binary output.
Otherwise I'm too tired and completely stumped on this one.
In fact, my USB stereo can't save the volume configuration on Linux (reconnecting it to a very small initial volume after power failure)
I had to keep the USB sound working.
But fortunately, I bought a ARM development board before, though its Linux kernel has some minor problems.
Can I cross compile Receivers for the ARM development board?(I have no experience with that)
Hi!
Nice project
I like the idea behind it.
I have a other problem: I need to output the audio to an Android device (old smartphone). I was found here a reciver for Windows and for Linux, both of them can't be used on my system.
Thanks for all,
Hi,
New signed driver does not get installed.
Do you sign using EV certificates?
Thanks.
Nice driver. I have been looking for such a driver for a long time.
Is it possible to make an option to send just a clear PCM stream via UDP?
I use this kind of magic on the device.
socat -u udp-listen:4444,reuseaddr,fork stdio | aplay -q -f S16_BE -r 48000 -c 2
This works well, but the software that I use in Windows has limitations.
Some devices, it is difficult to cross-compile your receiver.
These two are hardcoded here: https://github.com/duncanthrax/scream/blob/master/Receivers/pulseaudio/scream-pulse.c#L14-L15
I've had to change the IP to 10.0.2.2
for my use case (Windows is a guest in a VM, Linux is QEMU host using user networking, guest itself isn't normally reachable.)
Rebuilding just to change these can be tricky and needs all the tooling of course.
Can scream be made to take in microphone input from the "receiver"?
This is a brilliant piece of software. Both the windows binary and the pulseaudio receiver worked flawlessly out of the box to let me stream audio from my windows VM to my linux host. Thanks for making this!
I didn’t know that Receivers needed to monitor 4010 to work half an hour ago.😂
I was trying to play a game in a win7 VM with Scream in multicast mode (IVSHMEM is also busted, but I think this is known) as audio device (5.1 channels, 48k SR setup; though it happens with other configs too) and when multiple audio events occur in quick succession, as is common in games, (new ones start before the ones playing finish) there is crackling and noticeable breaks in the received audio. So while there is no crackling in the Windows audio test and 5.1 channel mappings work great, gaming is pretty much a bust (worse than qemu's ich6 for me in this case). Any way to fix this?
Edit: Also when I provoke many simultaneous sounds they get queued for a long time and some then play seconds after their intended playback time. Like they are queued one after the other instead of being mixed together.
hi, I don't know where to put this, but I was able to brew install pulseaudio and use pulseaudio receiver on mac os x... hope that helps someone
Hi
Great project! Couldn't find any other software able to stream system audio to another computer without massive latency and/or complexity.
But i have one issue:
On my computer i have two active network adapters, one virtual adapter for VirtualBox and one real.
Scream appears to automatically talk with the former instead of the latter, and i could not find any way to configure this, so to use scream to cast to my other physical computer i have to disable the virtualbox network to make scream choose the real adapter.
I've set up a dev-test environment and want to solve the issue by myself, I just need some directions as I'm not familiar with Windows Driver development.
I found that if the unicast address is set to a nonexistent IP in the same LAN as the server, CSaveData::SendData
will hang for 3 seconds before sending the next packet. The result is that everything related to sound (Sound Settings, Volume Control, etc) is inhibited from launching. Captured packets show that the system tries to find the host that has the IP through ARP every time it wants to send a UDP packet and gives up after 3 seconds.
How can I make Scream stop sending UDP packets if unicast address' ARP resolution fails?
I installed Scream driver and started ScreamReader. Default device is hardware soundcard. I expexted listen sound when I press test button in properites tab of Scream device. But I can not hear anything. When I configure Scream device to unicast to another local PC, I hear test sound.
I have router with OpenWRT. How to configure my system?
Hi @duncanthrax ,
could we implement some kind of "standard way" of distributing the audio stream?
RTP comes to my mind here. Then we could check for dropped packets, do recovering and so on.
This should be fairly simple to implement (on sender side).
Thanks a lot for your nice project!
Hi!
This issue is probably specific to me, I was just wondering if you could give me any pointers to what might be the root of the issue. So on my network running scream sever, the audio works fine on all clients connecting through wifi but it's all the wired gigabit LAN client that having issues and it's completely unusable whether it's Linux, Raspberry PI or Windows7/10, the sound coming through is broken, garbled glitchy mess, I've ruled out everything, it must be network issue, I tried different routers even but still same results. You can still make out the sound but it's very bad. So I'm wondering where exactly could be the issue? So maybe some IGMP setting on the router? I have no idea what's exactly relevant to Scream or not. I'd appreciate any tip on what kind of network setup scream needs.
Mono and Stereo works, but when I change to Multichannel configuration - there is no sound.
Data is received on the receiving computer though. Using latest release v3.3
If there is a channel mapping issue, how about having a mapping config file that user can edit to establish correct mapping.
I'm sure this is really a bug with Qemu or the IVSHMEM driver, but when drying to use scream on Windows 7, either the OS hangs or I get no audio output. I'm not exactly sure why.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.