virtual_oss and wine oss: no captured sound

I recompiled the wine port to use OSS instead of Alsa, and set up virtual_oss like this:
Code:
virtual_oss -S -C 2 -c 2 -r 48000 -b 16 -s 1024 -f /dev/dsp0 -w vdsp.wav -l dsp
then tried to capture the audio from /dev/dsp0 like this:
Code:
ffmpeg -f oss -i /dev/dsp /tmp/output.wav
but I get no sound in the recording when I repeatedly click the "Test Sound" button in winecfg while ffmpeg is recording. I am able to hear sound from winecfg when clicking the "Test Sound" button so I know sound is working in wine.

I also tried this with no success:
Code:
dd if=/dev/vdsp.wav of=/tmp/output.wav

I was able to capture sound from beep using both of the previous commands, so what am I doing wrong?

pkg options wine:
Code:
wine - ALSA: off                                                                                                                                                                                               
wine - CUPS: off                                                                                                                                                                                               
wine - DOCS: on                                                                                                                                                                                                 
wine - DOSBOX: off                                                                                                                                                                                             
wine - GECKO: on                                                                                                                                                                                               
wine - GNUTLS: on                                                                                                                                                                                               
wine - MONO: on                                                                                                                                                                                                 
wine - OSS: on                                                                                                                                                                                                 
wine - V4L: off                                                                                                                                                                                                 
wine - WINEMAKER: off                                                                                                                                                                                           
wine - X11: on

mixer -a:
Code:
pcm0:mixer: <EMU10Kx DSP front PCM interface> on emu10kx0 (play/rec) (default)                                                                                                                                 
    vol       = 0.65:0.65     rec                                                                                                                                                                               
    pcm       = 0.75:0.75     pbk                                                                                                                                                                               
    speaker   = 0.75:0.75     pbk                                                                                                                                                                               
    line      = 0.75:0.75     rec                                                                                                                                                                               
    mic       = 0.25:0.25     rec src                                                                                                                                                                           
    cd        = 0.75:0.75     rec                                                                                                                                                                               
    rec       = 0.75:0.75     pbk                                                                                                                                                                               
    igain     = 0.00:0.00     pbk                                                                                                                                                                               
    ogain     = 0.50:0.50     pbk                                                                                                                                                                               
    line1     = 0.75:0.75     rec                                                                                                                                                                               
    line2     = 0.00:0.00     rec                                                                                                                                                                               
    line3     = 0.00:0.00     rec                                                                                                                                                                               
    dig1      = 0.00:0.00     rec                                                                                                                                                                               
    dig2      = 0.00:0.00     rec                                                                                                                                                                               
    dig3      = 0.00:0.00     rec                                                                                                                                                                               
    phin      = 0.00:0.00     rec                                                                                                                                                                               
    phout     = 0.00:0.00     rec                                                                                                                                                                               
    video     = 0.75:0.75     rec                                                                                                                                                                               
pcm1:mixer: <EMU10Kx DSP rear PCM interface> on emu10kx0 (play)                                                                                                                                                 
    vol       = 0.75:0.75     pbk                                                                                                                                                                               
    pcm       = 0.75:0.75     pbk                                                                                                                                                                               
pcm2:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)                                                                                                                                                     
    vol       = 1.00:1.00     pbk                                                                                                                                                                               
    pcm       = 1.00:1.00     pbk                                                                                                                                                                               
pcm3:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)                                                                                                                                                     
    vol       = 1.00:1.00     pbk                                                                                                                                                                               
    pcm       = 1.00:1.00     pbk                                                                                                                                                                               
pcm4:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)                                                                                                                                                     
    vol       = 1.00:1.00     pbk                                                                                                                                                                               
    pcm       = 1.00:1.00     pbk                                                                                                                                                                               
pcm5:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)                                                                                                                                                     
    vol       = 1.00:1.00     pbk                                                                                                                                                                               
    pcm       = 1.00:1.00     pbk

uname -a:
Code:
FreeBSD 14.2-RELEASE-p1 GENERIC amd64

wine audio tab:
 

Attachments

  • wine.png
    wine.png
    11.6 KB · Views: 160
I looked into the link and it is helpful to see what device wine is using with WINEDEBUG=-all,+oss. It is using /dev/dsp0.

The intent was to create a loopback audio device, /dev/dsp, from /dev/dsp0 so I could capture desktop audio playing in wine to /dev/dsp, then record /dev/dsp in ffmpeg. I tried renaming my loopback device to /dev/dsp6 and telling ffmpeg to record /dev/dsp6 (to avoid any conflicts with /dev/dsp) but still no sound in the recording.
 
I think I'm getting closer, but my virtual_oss command needs some fine tuning. From the wiki, my snd_emu10kx device is using channels 8 and 9 for rear left and right audio. I was able to create a new output device like this:

Code:
virtual_oss -S -c 12 -r 48000 -b 16 -s 20ms -R /dev/null -P /dev/dsp0 -b 16 -c 2 -m 8,0,9,1 -d vdsp -t vdsp.ctl

and I can play a beep sound on the virtual device and I hear it:
Code:
beep -d /dev/vdsp -D 2000

but when I try to route the output to a virtual recording device i'm not getting anything in the recording:
Code:
virtual_oss -S -c 12 -r 48000 -b 16 -s 20ms -R /dev/null -P /dev/dsp0 -b 16 -c 2 -m 8,0,9,1 -M x,8,0,0,0,0 -M x,9,1,0,0,0 -d vdsp.rec -t vdsp.ctl

Code:
cmdwatch beep -d /dev/dsp0 -D 2000

Code:
ffmpeg -f oss -i /dev/vdsp.rec output.wav

dmesg output for emu10kx:
Code:
emu10kx0: <Creative SBLive! 5.1 Digital [CT4780]> port 0xc100-0xc11f irq 17 at device 1.0 on pci5
pcm0: <EMU10Kx DSP front PCM interface> on emu10kx0
pcm1: <EMU10Kx DSP rear PCM interface> on emu10kx0
 
I would prefer not relying on snd_emu10kx driver-specific functionality, but this passed my beep test but not my wine test:
Code:
# /boot/loader.conf
hint.emu10kx.0.multichannel_recording="1"

reboot. you can see the driver added a pcm2 device, so now I have 7 PCM devices instead of 6.

Code:
mixer -a
pcm0:mixer: <EMU10Kx DSP front PCM interface> on emu10kx0 (play/rec) (default)
    vol       = 0.52:0.52     rec
    pcm       = 0.75:0.75     pbk
    speaker   = 0.75:0.75     pbk
    line      = 0.75:0.75     rec
    mic       = 0.25:0.25     rec src
    cd        = 0.75:0.75     rec
    rec       = 0.75:0.75     pbk
    igain     = 0.00:0.00     pbk
    ogain     = 0.50:0.50     pbk
    line1     = 0.75:0.75     rec
    line2     = 0.00:0.00     rec
    line3     = 0.00:0.00     rec
    dig1      = 0.00:0.00     rec
    dig2      = 0.00:0.00     rec
    dig3      = 0.00:0.00     rec
    phin      = 0.00:0.00     rec
    phout     = 0.00:0.00     rec
    video     = 0.75:0.75     rec
pcm1:mixer: <EMU10Kx DSP rear PCM interface> on emu10kx0 (play)
    vol       = 0.75:0.75     pbk
    pcm       = 0.75:0.75     pbk
pcm2:mixer: <EMU10Kx DSP multichannel recording PCM interface> on emu10kx0 (rec)
    vol       = 1.00:1.00     pbk
pcm3:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)
    vol       = 1.00:1.00     pbk
    pcm       = 1.00:1.00     pbk
pcm4:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)
    vol       = 1.00:1.00     pbk
    pcm       = 1.00:1.00     pbk
pcm5:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)
    vol       = 1.00:1.00     pbk
    pcm       = 1.00:1.00     pbk
pcm6:mixer: <NVIDIA (0x0040) (HDMI/DP 8ch)> on hdaa0 (play)
    vol       = 1.00:1.00     pbk
    pcm       = 1.00:1.00     pbk

Code:
cmdwatch beep -d /dev/dsp0 -D 2000
Code:
ffmpeg -f oss -i /dev/dsp2 output.wav

I still can't capture output from wine, and winecfg displays this output when I go to the audio tab:
Code:
012c:trace:oss:oss_test_connect Priority_Low: sysinfo.version[0]: 31                                                                                                                                                
012c:trace:oss:oss_get_endpoint_ids OSS sysinfo:
012c:trace:oss:oss_get_endpoint_ids product: FreeBSD native OSS ABI
012c:trace:oss:oss_get_endpoint_ids version: 1402000
012c:trace:oss:oss_get_endpoint_ids versionnum: 40000
012c:trace:oss:oss_get_endpoint_ids numaudios: 8
012c:trace:oss:oss_get_endpoint_ids nummixers: 8
012c:trace:oss:oss_get_endpoint_ids numcards: 8
012c:trace:oss:oss_get_endpoint_ids numaudioengines: 20
012c:trace:oss:get_default_device Default devnode: /dev/dsp0
012c:warn:oss:oss_get_endpoint_ids Opening device "/dev/dsp2" failed, pretending it doesn't exist: 45 (Operation not supported)
012c:warn:oss:oss_get_endpoint_ids Opening device "" failed, pretending it doesn't exist: 2 (No such file or directory)
012c:trace:oss:get_default_device Default devnode: /dev/dsp0
012c:warn:oss:oss_get_endpoint_ids Opening device "/dev/dsp1" failed, pretending it doesn't exist: 45 (Operation not supported)
012c:warn:oss:oss_get_endpoint_ids Opening device "/dev/dsp3" failed, pretending it doesn't exist: 45 (Operation not supported)
012c:warn:oss:oss_get_endpoint_ids Opening device "/dev/dsp4" failed, pretending it doesn't exist: 45 (Operation not supported)
012c:warn:oss:oss_get_endpoint_ids Opening device "/dev/dsp5" failed, pretending it doesn't exist: 45 (Operation not supported)
012c:warn:oss:oss_get_endpoint_ids Opening device "/dev/dsp6" failed, pretending it doesn't exist: 45 (Operation not supported)
012c:warn:oss:oss_get_endpoint_ids Opening device "" failed, pretending it doesn't exist: 2 (No such file or directory)
 
Back
Top