Opened 16 years ago

Closed 16 years ago

#4386 closed patch (fixed)

Add timestretch support to mythmusic

Reported by: Mark Spieth Owned by: paulh
Priority: minor Milestone: 0.21
Component: mythmusic Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

doesnt support lcd

supports playbackbox and miniplayer.

Attachments (4)

mm_stretch.1.patch (8.4 KB) - added by Mark Spieth 16 years ago.
mm_stretch_ao_1.patch.gz (1.1 KB) - added by Mark Spieth 16 years ago.
mm_stretch_ao_2.patch.gz (1.0 KB) - added by Mark Spieth 16 years ago.
mm_stretch_ao.3.patch.gz (664 bytes) - added by Mark Spieth 16 years ago.

Download all attachments as: .zip

Change History (14)

Changed 16 years ago by Mark Spieth

Attachment: mm_stretch.1.patch added

comment:1 Changed 16 years ago by paulh

Milestone: unknown0.21
Owner: changed from Isaac Richards to paulh
Status: newassigned
Version: unknownhead

comment:2 Changed 16 years ago by paulh

Mark, It seems to be working fine. The only problem is once the speed is increased or decreased I get a continuous stream of

2007-12-30 14:24:11.538 AO, ERROR: Audio buffer overflow, audio data lost!
2007-12-30 14:24:11.562 AO, ERROR: Audio buffer overflow, audio data lost!

messages in the frontend log. I don't see these when time stretching recordings.

comment:3 Changed 16 years ago by paulh

A little more info.

Changing the buffer size makes no difference AFAICT.

Changing the music audio output from non blocking to blocking gets rid of the buffer overflow messages but that causes the visualizations to stutter.

Changed 16 years ago by Mark Spieth

Attachment: mm_stretch_ao_1.patch.gz added

comment:4 Changed 16 years ago by Mark Spieth

added patch to audiooutputbase.cpp to prevent those messages from appearing. should be ok. attached as a gz as otherwise I got a spam message on attach. patch was edited so I hope I did it correctly.

If nonblock, wait for a bit for the buffer to clear before continuing if it gets past the initial nonblock length sufficiency tests.

This patch is also part of my multichannel patch (fixed up) #1104

comment:5 Changed 16 years ago by paulh

Component: mythtvmythmusic

comment:6 in reply to:  4 Changed 16 years ago by paulh

Replying to markspieth:

added patch to audiooutputbase.cpp to prevent those messages from appearing. should be ok. attached as a gz as otherwise I got a spam message on attach. patch was edited so I hope I did it correctly.

If nonblock, wait for a bit for the buffer to clear before continuing if it gets past the initial nonblock length sufficiency tests.

This patch is also part of my multichannel patch (fixed up) #1104

Wont compile. Fails with this error:-

audiooutputbase.cpp: In member function `virtual bool
   AudioOutputBase::AddSamples(char**, int, long long int)':
audiooutputbase.cpp:461: error: `encoder' undeclared (first use this function)
audiooutputbase.cpp:461: error: (Each undeclared identifier is reported only
   once for each function it appears in.)

Looks like this is going to have to wait until after the multichannel patch is applied. Is that patch stable enough to be applied yet? With it being such a large patch it would be nice to get it in sooner rather than later so any problems can be ironed out before the 0.21 release.

Changed 16 years ago by Mark Spieth

Attachment: mm_stretch_ao_2.patch.gz added

comment:7 Changed 16 years ago by Mark Spieth

sorry paul. Ive removed the multichannel dependencies and should be good now. Ive tested the patch for self consistency and it should compile now.

comment:8 Changed 16 years ago by paulh

The new patch wouldn't apply cleanly the first 3 hunks failed but it was easy enough to apply them manually.

It's a lot better but still getting them not as frequently though.

2007-12-31 13:26:44.465 AO, ERROR: Audio buffer overflow, 5 audio samples lost!
2007-12-31 13:26:54.717 AO, ERROR: Audio buffer overflow, 6 audio samples lost!
2007-12-31 13:26:58.117 AO, ERROR: Audio buffer overflow, 4 audio samples lost!
2007-12-31 13:26:58.149 AO, ERROR: Audio buffer overflow, 11 audio samples lost!
2007-12-31 13:27:15.213 AO, ERROR: Audio buffer overflow, 1 audio samples lost!
2007-12-31 13:27:22.057 AO, ERROR: Audio buffer overflow, 4 audio samples lost!
2007-12-31 13:27:25.465 AO, ERROR: Audio buffer overflow, 2 audio samples lost!
2007-12-31 13:27:28.897 AO, ERROR: Audio buffer overflow, 7 audio samples lost!
2007-12-31 13:27:32.309 AO, ERROR: Audio buffer overflow, 5 audio samples lost!
2007-12-31 13:27:39.129 AO, ERROR: Audio buffer overflow, 1 audio samples lost!
2007-12-31 13:27:42.561 AO, ERROR: Audio buffer overflow, 6 audio samples lost!
2007-12-31 13:27:52.825 AO, ERROR: Audio buffer overflow, 7 audio samples lost!

Changed 16 years ago by Mark Spieth

Attachment: mm_stretch_ao.3.patch.gz added

comment:9 Changed 16 years ago by Mark Spieth

couldnt make it happen. So i'll guess at the problem.

3 uses a different approach limiting the total buffered audio to 2 secs. Note mm spams the audiooutput layer until it cant take it anymore. In my case with 1.5M buffer + alsa sound buffer this was 8.7 seconds. so changing speed took 8.7 secs to be apparent.

down side is 2 secs limits video playback and audiosync adjustment possible, though that much should be ok I would have thought.

alternatively, we could create an interface that mm could use to limit its buffer usage, and restrict it to mm only. you choose.

If ok Ill add settings for the maxaudiobuffertime param.

comment:10 Changed 16 years ago by paulh

Resolution: fixed
Status: assignedclosed

(In [15348]) Add timestretch support to mythmusic.

New key bindings are SPEEDUP 'W' and SPEEDDOWN 'X'.

Includes some changes to audiooutputbase.cpp to limit the buffered audio to 2 seconds to hopefully prevent some buffer overflow problems.

Note to themers:- There is a new _optional_ text area called 'speed_status' that you can use to provide some feed back on the screen.

Patch by Mark Spieth slightly modified so the LCD/VFD is also updated. Closes #4386.

Note: See TracTickets for help on using tickets.