summaryrefslogtreecommitdiffstats
path: root/core.h
AgeCommit message (Collapse)AuthorFilesLines
2019-04-08Introduce 'unconfigure' callbackMark Farrugia1-0/+4
The 'unconfigure' callback can be used to clean up the 'configured' state of an Audio Path, for when it is desired to reset the streams, and/or reload a different stream configuration. To destroy the streams, we must attempt to force their PCMs closed. Take note though, that if a PCM is being written to when an unconfigure command is issued, system instability may occur. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-04-08Refactor 'sealed' to 'configured'Mark Farrugia1-6/+6
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-04-01Add 'internal' streams for routing, revamp stream finalisationMark Farrugia1-1/+20
Uses the ALSA internal PCM API to create streams purely used for internal routing purposes. Adds the 'try_complete' functions for both streams and routes in an attempt to standardize the finalization of a stream or route object. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-03-27Rework routing systemMark Farrugia1-0/+12
- Add 'route' to snd_avirt_stream, remove from audio path - Add route checking - ensure that source ap and ink ap have compatible hw params - Add private data support for both source and sink Audio Paths, to ensure that the PCM can hold multiple private data(s). - Add ability to use copy_kernel and exttriggers from AVIRT instead of from Audio Paths - Reintroduce pcm_trigger and pcm_prepare, so that they may be called appropriately from AVIRT, rather than child Audio Paths. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-03-01Add ability to route audio between audio pathsMark Farrugia1-0/+21
Configfs interface for adding 'routes' is added, and allows two audio paths to chain together particular inputs/outputs, allowing for multistage audio driver handling. A particular use-case is that of an ADSP driver. We can feed in audio to it, and capture the processed, and/or mixed, audio at it's output, and direct to another audio path driver, such as the UNICENS audio driver. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-03-01Move sysfs functionality to sysfs.cMark Farrugia1-0/+34
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-01-29Rework setting the AVIRT map, and stream creationMark Farrugia1-2/+7
To ensure that a stream is able to change it's mapping (before card is sealed), we cannot create the stream PCM upon setting the mapping. This had to be reworked to allow multiple setting of the mapping if so required. The PCM ops table for a given stream is now allocated and stored in the snd_avirt_stream struct, to allow retrieval and manipulation upon mapping change. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2019-01-04Create PCM devices as soon as the AVIRT map is setguppy_6.99.4guppy/6.99.46.99.4Mark Farrugia1-0/+2
We no longer need to wait until the card is sealed to create the PCM device. We can create it right away. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-11-13Rework PCM ops callback mechanismMark Farrugia1-1/+1
- Fix issues regarding PCM ops callbacks via AVIRT - As PCMs are created, the PCM ops are set according to the Audio Path's needs. A default PCM ops table is applied for all PCMs, which includes callbacks such as open, and hw_free, since AVIRT requires these for intermediate processing, whether or not a given Audio Path may need them. - Separate PCM ops into separate playback and capture ops tables Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-11-02Transform AVIRT into platform driverMark Farrugia1-0/+1
Like aloop, we need to be able to find AVIRT by-path as platform-snd_avirt.0. The 4a-mixer uses this method to find cards. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-11-02Refactor some variables for better readabilityMark Farrugia1-1/+1
avirt_class can become avirt, SND_AVIRTUAL_DRIVER becomes SND_AVIRT_DRIVER Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-11-01Only expose streams mapped to audiopaths on configure() cbMark Farrugia1-0/+18
When the configure() callback occurs for each audiopath, we only want those streams that are mapped to the given audiopath to be exposed to the audiopath. E.g. only streams mapped to loopback should be propagated to loopback via configure() callback, rather than all streams. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-31Remove coreinfo, absorb version info into coreMark Farrugia1-0/+1
Since coreinfo only has version info, and this is not being used at all, we can absorb the version info into the private avirt_core structure. We could in future implement a function to retrieve the version, when, and if, it is required. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Refactor all avirt_ symbols to have have snd prefix, as per Linux soundMark Farrugia1-15/+18
This will aid the eventual migration the the upstream mainline Linux kernel Fix some checkpatch warnings, and other compiler warnings Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Refactor core_internal.h to core.hMark Farrugia1-0/+67
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Move system-leavel header to sound directoryMark Farrugia1-123/+0
Change include guards to reflect Linux sound driver format Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Refactor avirt_card_register, move PCM creation to it.Mark Farrugia1-1/+2
When creating the PCMs we need information regarding the stream's mapping. For the loopback, we need to add both playback and capture substreams. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Add card to the configure callbackMark Farrugia1-1/+2
The loopback audio path might need to add it's own controls. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Refactor to use new DINFO macrosMark Farrugia1-0/+11
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Remove blocksize from audiopathMark Farrugia1-11/+10
This is no longer needed in AVIRT, since it is only actually used for the ADSP Audio Path. Clean up white space, add function documentation, remove out of place debug prints Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Add configfs interface, revamp stream groupingMark Farrugia1-33/+43
Add additional callbacks for audio path configuring, after card has been sealed. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Refactor top-level AVIRT API to be avirt_<subject>_<action>Mark Farrugia1-6/+6
This makes for a more organized function/variable naming convention Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Create avirt_stream structure in place of old config structuresMark Farrugia1-10/+12
Remove unnecessary extra memory allocation with the old config structures. We can store the snd_pcm pointer, which contains lots of info already. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Add 'uid' field to AP, store AP in PCM private data, fix helper macrosMark Farrugia1-8/+19
We want to use a UID when registering APs, that must start with "ap_", and acts as a unique identifier for each AP. To move forward with the adoption of routing PCMs to differing APs, we now store the AP in the PCM private data - set at pcm_open. A fix to the helper macros now allows additional args to be passed in for inclusion to the debug string Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Fix warnings generated by checkpatch.plMark Farrugia1-5/+5
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Move ALSA info into coreinfo, for export to Audio PathsMark Farrugia1-12/+26
Remove the avirt_alsa_driver Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Remove test 'value' parameter from avirt_audiopathMark Farrugia1-1/+0
This is not required any longer Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Loopback progressJames O'Shannessy1-8/+8
Loopback currently reads from dma_area but the initial copy from playback to capture has not been implemented. Signed-off-by: James O'Shannessy <james.oshannessy@fiberdyne.com.au>
2018-10-26Current state of loopback.James O'Shannessy1-0/+11
Committing debug changes and loopback changes Signed-off-by: James O'Shannessy <james.oshannessy@fiberdyne.com.au>
2018-10-26Update licensingMark Farrugia1-1/+1
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
2018-10-26Public push of AVIRT.James O'Shannessy1-0/+64
Follow readme for building in/out of tree for Ubuntu/AGL/etc. Signed-off-by: James O'Shannessy <james.oshannessy@fiberdyne.com.au>