History log of /haiku/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp
Revision Date Author Comments
# 6d2f2ec1 24-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Rework nodes to call Run() only after registration

* While it should not be a big problem the
bebook specify to do it after custom operations,
most nodes also follow this way, this commit restore
consistency.


# 843a122f 04-May-2013 Jérôme Duval <jerome.duval@gmail.com>

MediaPlayer: some 64 bit fixes


# 280a22fd 15-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Removed no longer useful debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38666 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 05e6afd6 15-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Always wait for buffers in AudioProducer::_FillNextBuffer().
Seems to work around a problem in the system mixer. When it
happens once that the AudioProducer does not send a buffer,
then it can eventually lead to a drop into the debugger
from BBuffer::SetHeader(), which to me looks like the BMediaEventLooper
thread of the mixer still runs when the System Mixer has been
shut down, which itself is yet another problem. I shall
investigate, but for the time being, one should enjoy a more
stable media_addon_server life-time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bc76e66a 06-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

ERROR->TRACE for LateNoticeReceived()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38550 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dec32162 06-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

One should be suspicious when subtracting "samples"
from "frames". LateNoticeReceived() would have skipped
two many buffers depending on the channel count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38542 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cfe3295b 30-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

* _FillNextBuffer(): performanceTime and startTime were duplicated variables.
* Small coding style improvements.
* Improved generating of debug .wav file.
* Incorporate the channel count in the audio buffer size! This was important
since the duration could then lead to rounding errors. 6 channel playback
is much improved, but still far from perfect.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 25e6c318 30-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Print the FillBuffer() error when running out of buffers only once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38437 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0085d25 12-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* We now limit the maximum latency in MediaPlayer and the audio mixer, as a
latency can easily get annoying if too high.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36200 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8dd3060d 12-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* The AudioProducer now correctly handles late producer notices by ignoring
extra notices for buffers already scheduled.
* Also, the AudioSupplier/AudioReader classes now know their initial latency,
and the AudioProducer is now using that one to advertize its own initial
latency - this fixes late buffers on start, causing the latency to grow
too large.
* Cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36199 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b289aaf6 12-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* A BBuffer does not know where it came from, so
BBufferConsumer::BufferReceived() cannot know whom to send the "buffer is
late" notification (unless we only have a single input). To solve this, the
media_header now contains extra fields that can be used to create a
media_source object.
* Unfortunately, BBufferProducer::SendBuffer() cannot know the output either in
case there is more than one. Hence, I deprecated the existing SendBuffer()
call and moved it into "private" - IOW old sources using it won't compile
anymore under Haiku.
* I introduced a new SendBuffer() variant that also gets the media_source as
argument.
* Updated all sources (that are part of the image) to use the new variant.
* Removed some purposely commented out code in the audio mixer.
* Implemented late buffer notification, as well as late buffer handling in the
audio mixer; this is a bit of work in progress, so the debug output is left
in there.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36184 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 03191856 16-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

Disabled tracing again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34080 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa1a1c29 20-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

All sorts of refactoring with regards to the audio node and format setup. At
first I tried adding support for changing the format during running the node
connection, but later found out that this is not implemented in the system
mixer (it has this weird setting to allow input format changes, but if you
do this, the media_server will just crash, since the backend does not support
it yet). Also, the Media Kit documentation is extremely lacking in this regard.
I ended up re-establishing the node connection when the audio format is
supposed to change, just like it is already done for video. This means that
audio files now play with their native channel count and frame rate. But it
isn't so well tested yet, if 48 kHz for example introduce some clicks. The
channel count should not be a problem though, I've also tested that with some
movies and it works fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33678 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c4decd80 05-Aug-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed hardcoded AudioProducer output name.
Stephan, Axel, could one of you report this change in clockwerk/src/shared/AudioProducer.cpp too.
Clockwerk name his audio output "MediaPlayer Sound Output", which is both confusing and, well,
semantically wrong ;-).

BTW, for MediaPlayer being able to (re)name his output after the filename playing will be great, no?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77b23b70 07-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Removed left-over debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29423 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46f2d7fe 07-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Basically, the audio buffer size was simply too small and caused
audio playback with frequent glitches. I am testing with HDA and have
perfect audio now. The only remaining problem is the drop-sample
resampling in the system mixer, which gives a somewhat metallic sound.
* Removed hardcoded values from preferred format and used them if
the consumer supplies wildcard values. Since the system mixer supplies
wildcards for all those values, this change does not have any effect
for now. The code is more correct, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29422 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 591f4c05 07-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Remove the negative delay that was supposed to account for client->app_server
delay. The audio is later than the calculated realtime anyways, I suspect
the OSS Node does not advertise it's latency 100% correctly yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26285 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1308815b 06-Jul-2008 François Revol <revol@free.fr>

Fix scope for gcc4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26283 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4a684bb8 06-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

That is more likely to give the right realtime...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26281 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9282400f 06-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* The SeekSlider did not update the knob when it was resized.
* Subtile visual improvements to the SeekSlider.
* Added a PeakView for displaying the audio peaks that are produced by
the AudioProducer.
* A MessageEvent can now directly take a custom BMessage for delivery.
* The peak notification mechanism is a bit separate from the rest of the
Controller notification design, since the notification delivery should
be delayed until the audio is actually audible. I may change this
quick and dirty design though, since it is not so nice. The target
time could also be part of the message and be handled at a different
stage, but that would make it less efficient.
* Layout improvements to the playback controls.
* Code cleanup here and there, changed some license statements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26280 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3b057d9f 26-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Minor changes to debug output, I was trying to track something down, actually
a problem in the OSS media node which also affects at least the ZETA 1.2
MediaPlayer on ZETA.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26143 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50c7a8f9 02-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Small code cleanups.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0fc56ed5 30-May-2008 Stephan Aßmus <superstippi@gmx.de>

* Moved a bunch of non-primary interface classes into a new subfolder
"interface"

* Complete reimplementation of the playback engine using Media Nodes:
- Seeking video files does not appear to lockup the playback anymore, but
works on a frame accurate level even for keyframe based streams. There is
currently a problem with certain container formats, the audio track reports
a "Device Seek Error" in certain conditions. In that case audio goes silent,
and can be restarted by going back to the beginnings of the stream.
- Video overlays are now supported.
- It would be possible to connect the output of the MediaPlayer to other
applications or dormant media nodes.

* Known regressions:
- The volume slider has currently no effect anymore.
- Switching the audio track during playback has a known race condition and
can crash the player.
- The new engine is not as "light weight" as the old one. I tagged the
previous implementation in tags/components/mediaplayer-engine-v1. It does
not seem to have any noticable effect though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25725 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6d2f2ec177bf615a117a7428d71be4330545b320 24-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Rework nodes to call Run() only after registration

* While it should not be a big problem the
bebook specify to do it after custom operations,
most nodes also follow this way, this commit restore
consistency.


# 843a122fd9a17bfde0f01db2c5660c33524bf40c 04-May-2013 Jérôme Duval <jerome.duval@gmail.com>

MediaPlayer: some 64 bit fixes


# 280a22fdecd4896593153ca7bacd980b8497b110 15-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Removed no longer useful debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38666 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 05e6afd6ea12352e38db41df1a92eb9730bb9cfc 15-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Always wait for buffers in AudioProducer::_FillNextBuffer().
Seems to work around a problem in the system mixer. When it
happens once that the AudioProducer does not send a buffer,
then it can eventually lead to a drop into the debugger
from BBuffer::SetHeader(), which to me looks like the BMediaEventLooper
thread of the mixer still runs when the System Mixer has been
shut down, which itself is yet another problem. I shall
investigate, but for the time being, one should enjoy a more
stable media_addon_server life-time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bc76e66a1d5284ebd1daf3deaf9c81acfe919c01 06-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

ERROR->TRACE for LateNoticeReceived()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38550 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dec32162b5e31d66142be47ab92c82a7be7726fd 06-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

One should be suspicious when subtracting "samples"
from "frames". LateNoticeReceived() would have skipped
two many buffers depending on the channel count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38542 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cfe3295bcfd23a6b3412775e212859032cda7b25 30-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

* _FillNextBuffer(): performanceTime and startTime were duplicated variables.
* Small coding style improvements.
* Improved generating of debug .wav file.
* Incorporate the channel count in the audio buffer size! This was important
since the duration could then lead to rounding errors. 6 channel playback
is much improved, but still far from perfect.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 25e6c3189305d9c15d441f192f93181557ca2cda 30-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

Print the FillBuffer() error when running out of buffers only once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38437 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d0085d25d17c2d715f4d0b862be9d833355c63e8 12-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* We now limit the maximum latency in MediaPlayer and the audio mixer, as a
latency can easily get annoying if too high.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36200 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8dd3060da4f50b8de2830fd93216b186efec7c4f 12-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* The AudioProducer now correctly handles late producer notices by ignoring
extra notices for buffers already scheduled.
* Also, the AudioSupplier/AudioReader classes now know their initial latency,
and the AudioProducer is now using that one to advertize its own initial
latency - this fixes late buffers on start, causing the latency to grow
too large.
* Cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36199 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b289aaf66bbf6e173aa90fa194fc256965f1b34d 12-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* A BBuffer does not know where it came from, so
BBufferConsumer::BufferReceived() cannot know whom to send the "buffer is
late" notification (unless we only have a single input). To solve this, the
media_header now contains extra fields that can be used to create a
media_source object.
* Unfortunately, BBufferProducer::SendBuffer() cannot know the output either in
case there is more than one. Hence, I deprecated the existing SendBuffer()
call and moved it into "private" - IOW old sources using it won't compile
anymore under Haiku.
* I introduced a new SendBuffer() variant that also gets the media_source as
argument.
* Updated all sources (that are part of the image) to use the new variant.
* Removed some purposely commented out code in the audio mixer.
* Implemented late buffer notification, as well as late buffer handling in the
audio mixer; this is a bit of work in progress, so the debug output is left
in there.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36184 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 031918562bf20b3492bfaf64b63c6d038f97bf1a 16-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

Disabled tracing again.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34080 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa1a1c2980105e6293ad7cce436360ffa5e9033a 20-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

All sorts of refactoring with regards to the audio node and format setup. At
first I tried adding support for changing the format during running the node
connection, but later found out that this is not implemented in the system
mixer (it has this weird setting to allow input format changes, but if you
do this, the media_server will just crash, since the backend does not support
it yet). Also, the Media Kit documentation is extremely lacking in this regard.
I ended up re-establishing the node connection when the audio format is
supposed to change, just like it is already done for video. This means that
audio files now play with their native channel count and frame rate. But it
isn't so well tested yet, if 48 kHz for example introduce some clicks. The
channel count should not be a problem though, I've also tested that with some
movies and it works fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33678 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c4decd80b17bdc17e487c81a0ec1a7ffbacf5fce 05-Aug-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed hardcoded AudioProducer output name.
Stephan, Axel, could one of you report this change in clockwerk/src/shared/AudioProducer.cpp too.
Clockwerk name his audio output "MediaPlayer Sound Output", which is both confusing and, well,
semantically wrong ;-).

BTW, for MediaPlayer being able to (re)name his output after the filename playing will be great, no?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77b23b704d65647f37828547ea326614374ae9ec 07-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Removed left-over debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29423 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46f2d7feece2b826c8484238b5e65050bf790eab 07-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Basically, the audio buffer size was simply too small and caused
audio playback with frequent glitches. I am testing with HDA and have
perfect audio now. The only remaining problem is the drop-sample
resampling in the system mixer, which gives a somewhat metallic sound.
* Removed hardcoded values from preferred format and used them if
the consumer supplies wildcard values. Since the system mixer supplies
wildcards for all those values, this change does not have any effect
for now. The code is more correct, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29422 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 591f4c05bc9853987ca69b4fcb30e1f48d7e7756 07-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Remove the negative delay that was supposed to account for client->app_server
delay. The audio is later than the calculated realtime anyways, I suspect
the OSS Node does not advertise it's latency 100% correctly yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26285 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1308815ba3f8c122266c189f5d3d4e390d9b5277 06-Jul-2008 François Revol <revol@free.fr>

Fix scope for gcc4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26283 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4a684bb8320e0c17ce5739ec53905f69b0c29090 06-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

That is more likely to give the right realtime...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26281 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9282400ff444c8d85c264f0f5fd16d1c639b7fae 06-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* The SeekSlider did not update the knob when it was resized.
* Subtile visual improvements to the SeekSlider.
* Added a PeakView for displaying the audio peaks that are produced by
the AudioProducer.
* A MessageEvent can now directly take a custom BMessage for delivery.
* The peak notification mechanism is a bit separate from the rest of the
Controller notification design, since the notification delivery should
be delayed until the audio is actually audible. I may change this
quick and dirty design though, since it is not so nice. The target
time could also be part of the message and be handled at a different
stage, but that would make it less efficient.
* Layout improvements to the playback controls.
* Code cleanup here and there, changed some license statements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26280 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3b057d9fad9d180b3b102db3759abf38c83a6ce3 26-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Minor changes to debug output, I was trying to track something down, actually
a problem in the OSS media node which also affects at least the ZETA 1.2
MediaPlayer on ZETA.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26143 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50c7a8f9971388bdb845f3518618fad9ab9a4023 02-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Small code cleanups.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0fc56ed57bdd5d2d44f33edd17d94210704613bd 30-May-2008 Stephan Aßmus <superstippi@gmx.de>

* Moved a bunch of non-primary interface classes into a new subfolder
"interface"

* Complete reimplementation of the playback engine using Media Nodes:
- Seeking video files does not appear to lockup the playback anymore, but
works on a frame accurate level even for keyframe based streams. There is
currently a problem with certain container formats, the audio track reports
a "Device Seek Error" in certain conditions. In that case audio goes silent,
and can be restarted by going back to the beginnings of the stream.
- Video overlays are now supported.
- It would be possible to connect the output of the MediaPlayer to other
applications or dormant media nodes.

* Known regressions:
- The volume slider has currently no effect anymore.
- Switching the audio track during playback has a known race condition and
can crash the player.
- The new engine is not as "light weight" as the old one. I tagged the
previous implementation in tags/components/mediaplayer-engine-v1. It does
not seem to have any noticable effect though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25725 a95241bf-73f2-0310-859d-f6bbb57e9c96