summaryrefslogtreecommitdiffstats
path: root/drivers/sound
Commit message (Collapse)AuthorAgeFilesLines
* sound: add gpio-beeper supportAhmad Fatoum2021-02-083-0/+84
| | | | | | | | | | | Add support for simple gpio-beepers. Note that unlike with PWM buzzers, GPIO buzzers can't be controlled in frequency and thus it doesn't make much sense to use the multiple argument version of beep with them. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sound: add PWM beeper supportAhmad Fatoum2021-02-083-0/+131
| | | | | | | This driver can be used to drive a piezo-buzzer attached to a PWM. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sound: add SDL 2.0 sound driverAhmad Fatoum2021-02-083-0/+93
| | | | | | | | | SDL 2.0.4 features SDL_QueueAudio, which we could use to just queue buffers for audio playback. Use it to implement the new sound API for the sandbox architecture. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sound: add basic synthesizers for PCM beeper useAhmad Fatoum2021-02-083-1/+57
| | | | | | | | | | | | | | | For beeping on PCM sound cards, barebox will need to synthesize samples. Add basic sine and square wave synthesizers to achieve this. Client code can either call __synth_F to explicitly select synth F or synth_F, which depending on CONFIG_SYNTH_SQUARES may expand to either __synth_F or a gain-adjusted __synth_generate_square. The latter is mainly useful for slow systems that can't synthesize enough sine samples in a poller without impacting boot performance. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: add sound card driver supportAhmad Fatoum2021-02-083-0/+131
Add driver core boilerplate for sound support in barebox. Using the provided API in <sound.h>, consumers can play beeps for a fixed duration of time. Playing beeps is not blocking and new beeps can be enqueued while one is already playing. They will be played in succession by a poller, which will also turn off the sound card when the beep tune is over. API is also available for blocking until all beeps are played and for cancelling an underway beep tune. The API could be later extended for arbitrary PCM audio, should the need arise. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>