Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
96f9a8d6
Commit
96f9a8d6
authored
Dec 21, 2000
by
Ove Kaaven
Committed by
Alexandre Julliard
Dec 21, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable the DirectSound HAL for sound drivers that do not report
DSP_CAP_REALTIME. Set precision of these to 256 bytes (about 3ms).
parent
11ed8400
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
audio.c
dlls/winmm/wineoss/audio.c
+24
-9
No files found.
dlls/winmm/wineoss/audio.c
View file @
96f9a8d6
...
...
@@ -253,11 +253,11 @@ LONG OSS_WaveInit(void)
TRACE
(
"OSS dsp out caps=%08X
\n
"
,
caps
);
if
((
caps
&
DSP_CAP_REALTIME
)
&&
!
(
caps
&
DSP_CAP_BATCH
))
{
WOutDev
[
0
].
caps
.
dwSupport
|=
WAVECAPS_SAMPLEACCURATE
;
/* well, might as well use the DirectSound cap flag for something */
if
((
caps
&
DSP_CAP_TRIGGER
)
&&
(
caps
&
DSP_CAP_MMAP
))
WOutDev
[
0
].
caps
.
dwSupport
|=
WAVECAPS_DIRECTSOUND
;
}
/* well, might as well use the DirectSound cap flag for something */
if
((
caps
&
DSP_CAP_TRIGGER
)
&&
(
caps
&
DSP_CAP_MMAP
)
&&
!
(
caps
&
DSP_CAP_BATCH
))
WOutDev
[
0
].
caps
.
dwSupport
|=
WAVECAPS_DIRECTSOUND
;
}
close
(
audio
);
TRACE
(
"out dwFormats = %08lX, dwSupport = %08lX
\n
"
,
...
...
@@ -821,9 +821,14 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
}
if
(
dwFlags
&
WAVE_DIRECTSOUND
)
{
/* with DirectSound, fragments are irrelevant, but a large buffer isn't...
* so let's choose a full 64KB (32 * 2^11) for DirectSound */
audio_fragment
=
0x0020000B
;
if
(
wwo
->
caps
.
dwSupport
&
WAVECAPS_SAMPLEACCURATE
)
/* we have realtime DirectSound, fragments just waste our time,
* but a large buffer is good, so choose 64KB (32 * 2^11) */
audio_fragment
=
0x0020000B
;
else
/* to approximate realtime, we must use small fragments,
* let's try to fragment the above 64KB (256 * 2^8) */
audio_fragment
=
0x01000008
;
}
else
{
/* shockwave player uses only 4 1k-fragments at a rate of 22050 bytes/sec
* thus leading to 46ms per fragment, and a turnaround time of 185ms
...
...
@@ -1415,12 +1420,15 @@ static HRESULT WINAPI IDsDriverBufferImpl_GetPosition(PIDSDRIVERBUFFER iface,
if
(
lpdwPlay
)
*
lpdwPlay
=
ptr
;
if
(
lpdwWrite
)
{
/* add some safety margin (not strictly necessary, but...) */
*
lpdwWrite
=
ptr
+
32
;
if
(
WOutDev
[
This
->
drv
->
wDevID
].
caps
.
dwSupport
&
WAVECAPS_SAMPLEACCURATE
)
*
lpdwWrite
=
ptr
+
32
;
else
*
lpdwWrite
=
ptr
+
WOutDev
[
This
->
drv
->
wDevID
].
dwFragmentSize
;
while
(
*
lpdwWrite
>
This
->
buflen
)
*
lpdwWrite
-=
This
->
buflen
;
}
TRACE
(
"playpos=%ld, writepos=%ld
\n
"
,
lpdwPlay
?*
lpdwPlay
:
0
,
lpdwWrite
?*
lpdwWrite
:
0
);
return
DS
ERR_UNSUPPORTED
;
return
DS
_OK
;
}
static
HRESULT
WINAPI
IDsDriverBufferImpl_Play
(
PIDSDRIVERBUFFER
iface
,
DWORD
dwRes1
,
DWORD
dwRes2
,
DWORD
dwFlags
)
...
...
@@ -1567,6 +1575,7 @@ static HRESULT WINAPI IDsDriverImpl_CreateSoundBuffer(PIDSDRIVER iface,
IDsDriverBufferImpl
**
ippdsdb
=
(
IDsDriverBufferImpl
**
)
ppvObj
;
HRESULT
err
;
audio_buf_info
info
;
int
enable
=
0
;
TRACE
(
"(%p,%p,%lx,%lx)
\n
"
,
iface
,
pwfx
,
dwFlags
,
dwCardAddress
);
/* we only support primary buffers */
...
...
@@ -1605,6 +1614,12 @@ static HRESULT WINAPI IDsDriverImpl_CreateSoundBuffer(PIDSDRIVER iface,
*
pdwcbBufferSize
=
WOutDev
[
This
->
wDevID
].
maplen
;
*
ppbBuffer
=
WOutDev
[
This
->
wDevID
].
mapping
;
/* some drivers need some extra nudging after mapping */
if
(
ioctl
(
WOutDev
[
This
->
wDevID
].
unixdev
,
SNDCTL_DSP_SETTRIGGER
,
&
enable
)
<
0
)
{
ERR
(
"ioctl failed (%d)
\n
"
,
errno
);
return
DSERR_GENERIC
;
}
This
->
primary
=
*
ippdsdb
;
return
DS_OK
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment