Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#18877 closed bug (fixed)

{Regression} system .wav sounds freeze Media

Reported by: bbjimmy Owned by: pulkomandy
Priority: normal Milestone: R1/beta5
Component: Audio & Video/Codecs Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

hrev57689 x86_64

Set beep in the Sounds prefrences to a .wav sound file. In my case, BeBeep.wav.

Change the volume control. This shoule play the beep sound.

The volume control freezes and the sound does not play.

The media serveses need to be re-started for any sounds to play and un-freeze the volume control.

MediaPlayer freezes as well withany .wav sound files, although .wav sounds seem to play ok with games. My LoopDLoop has several .wav files that play fine in the game, but MediaPlayer freezes on them.

I insatlled audacity and it plays BeBeep wave as expected

As this affecte media player aned system sounds but does not affect with other players, I am unsure what component is responsible.

Attachments (2)

BeBeep.wav (30.4 KB ) - added by bbjimmy 7 months ago.
BeStartup.wav (135.6 KB ) - added by bbjimmy 7 months ago.

Download all attachments as: .zip

Change History (12)

comment:1 by korli, 7 months ago

Version: R1/beta4R1/Development

Last know working hrev? Thanks.

in reply to:  1 comment:2 by mbrumbelow, 7 months ago

Replying to korli:

Last know working hrev? Thanks.

hrev57666 last known to work.

in reply to:  1 comment:3 by mbrumbelow, 7 months ago

This looks like ffmpeg6 may be the problem.

media_addon_server, which links to the ffmpeg library pegs a CPU at 100%.

comment:4 by madmax, 7 months ago

Component: - GeneralAudio & Video/Codecs
Owner: changed from nobody to pulkomandy

Can't check till the weekend, but we may need to return AVERROR_EOF on EOF instead of just "0 bytes read" in StreamBase::_Read for ffmpeg6.

From the doc for avio_alloc_context, the read function 'For stream protocols, must never return 0 but rather a proper AVERROR code.' It seems 0 was temporarily allowed for libavformat < 59.

comment:5 by waddlesplash, 7 months ago

I tried a few .wav files here, MediaPlayer doesn't freeze for me. Is it only with specific files?

by bbjimmy, 7 months ago

Attachment: BeBeep.wav added

by bbjimmy, 7 months ago

Attachment: BeStartup.wav added

comment:6 by bbjimmy, 7 months ago

I think it has to do with short .wav files.

comment:7 by madmax, 7 months ago

Also happens with longer ones, and with flac files, the media extractor thread pegs one CPU. Starting MediaPlayer with a flac file with cover art wouldn't even show its window.

Enabling traces shows a never ending loop of:

StreamBase::_Read(0x10c0ba775760, 0x10c0ba810960, 32768) position: 138899
  read: 0

https://review.haiku-os.org/c/haiku/+/7601

comment:8 by pulkomandy, 7 months ago

Merged in hrev57699.

Does it also fix the 100% CPU use on files with cover art? (there are various tickets about this I think)

comment:9 by pulkomandy, 7 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

in reply to:  8 comment:10 by madmax, 7 months ago

Replying to pulkomandy:

Does it also fix the 100% CPU use on files with cover art? (there are various tickets about this I think)

You may be thinking of old issues you fixed, like #13622. We still get a black image. But now that you've mentioned it, I've tried removing the check in AVFormatReader. Both that and returning 1.0 make the audio unseekable and unstoppable, which I guess will continue to be so until MediaPlayer changes its way to calculate position.

Note: See TracTickets for help on using tickets.