Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb0430c2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: audio: Always write fixed buff_size data to Audio"

parents fc76b7fd 3f8bcdf4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -518,6 +518,9 @@ static void f_audio_playback_work(struct work_struct *data)
	struct f_audio *audio = container_of(data, struct f_audio,
					playback_work);
	struct f_audio_buf *play_buf;
	struct f_uac1_opts *opts = container_of(audio->card.func.fi,
						struct f_uac1_opts, func_inst);
	int audio_playback_buf_size = opts->audio_playback_buf_size;
	unsigned long flags;
	int res = 0;

@@ -548,7 +551,8 @@ static void f_audio_playback_work(struct work_struct *data)

	pr_debug("play_buf->actual = %d", play_buf->actual);

	res = u_audio_playback(&audio->card, play_buf->buf, play_buf->actual);
	res = u_audio_playback(&audio->card, play_buf->buf,
					audio_playback_buf_size);
	if (res)
		pr_err("copying failed");

+5 −5
Original line number Diff line number Diff line
@@ -23,16 +23,16 @@

#include "gadget_chips.h"

#define FILE_PCM_PLAYBACK	"/dev/snd/pcmC0D0p"
#define FILE_PCM_CAPTURE	"/dev/snd/pcmC0D0c"
#define FILE_PCM_PLAYBACK	"/dev/snd/pcmC0D5p"
#define FILE_PCM_CAPTURE	"/dev/snd/pcmC0D6c"
#define FILE_CONTROL		"/dev/snd/controlC0"

#define UAC1_IN_EP_MAX_PACKET_SIZE	32
#define UAC1_OUT_EP_MAX_PACKET_SIZE	32
#define UAC1_OUT_REQ_COUNT		48
#define UAC1_IN_REQ_COUNT		 4
#define UAC1_AUDIO_PLAYBACK_BUF_SIZE	(64 * UAC1_OUT_EP_MAX_PACKET_SIZE)
#define UAC1_AUDIO_CAPTURE_BUF_SIZE	(64 * UAC1_IN_EP_MAX_PACKET_SIZE)
#define UAC1_AUDIO_PLAYBACK_BUF_SIZE   256	/* Matches with Audio driver */
#define UAC1_AUDIO_CAPTURE_BUF_SIZE    256	/* Matches with Audio driver */
#define UAC1_SAMPLE_RATE	     16000

/*