JDK-6986718 : DataLine.getLongFramePosition returns inconsistent results
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 7
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86
  • Submitted: 2010-09-22
  • Updated: 2021-07-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
as a result the following reg. test fails:
closed/javax/sound/sampled/DataLine/LongFramePosition.java
environment:
system: ubuntu 10
sound: ALSA; ALSA with dmix plugin

Comments
- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

EVALUATION The test got a race condition when UNDERRUN state changes between getFramePosition & getLongFramePosition calls. See DAUDIO_GetBytePosition function: 1. snd_pcm_state(info->handle) reports RUNNING state 2. (GET_POSITION_METHOD2) snd_pcm_status(info->handle, info->positionStatus) - here we have UNDERRUN and "avail" value is incorrect. info->positionStatus should be checked for UNDERRUN condition: snd_pcm_status_get_state(info->positionStatus) != SND_PCM_STATE_XRUN) and return "full buffer available" if underrun detected.
19-04-2011

EVALUATION research shown that ALSA sometimes report incorrect state (snd_pcm_state(...)) on underrun/overflow (the function does not update actual value and returns "cached" state). As a result DAUDIO_GetBytePosition function (PLATFORM_API_LinuxOS_ALSA_PCM.c) returns incorrect result (2nd call returns correct value).
24-09-2010