Namio Posted June 4, 2018 Posted June 4, 2018 Hello, I am having trouble outputting sound on Linux using SSM2603. The SSM2603 device driver loads normally. It is also registered in ALSA sound card list. However, "input / output error" is raised in "alsactl init". ("amixer" is also the same.) It plays when I play wave file with "aplay" but it does not output to "R/LOUT pin" of SSM2603. Regards, Namio
Namio Posted June 11, 2018 Author Posted June 11, 2018 Hi, @sbobrowicz, Thank you for your reply. I found the cause of the problem and solved it. The ssm2603 driver was the cause. I found the link below with Google search. https://www.spinics.net/lists/alsa-devel/msg75416.html If you have a problem like me, try applying the patch above. (I am using Petalinux 2017.2 and Zybo-Z7-10. Linux version 4.9.0-xilinx) Thanks, Namio
JColvin Posted June 5, 2018 Posted June 5, 2018 Hi @Namio, I would recommend taking a look at this thread, https://forum.digilentinc.com/topic/1398-problems-with-audio-driver-in-petalinux/?sortby=date, where they were able to get that audio module working some on the Zybo. Thanks, JColvin
Namio Posted June 7, 2018 Author Posted June 7, 2018 Hi, @JColvin, Thank you for your reply. The link you provided has already been reviewed. But let's take a closer look. Please let me know if you find something else. Thanks, Namio
sbobrowicz Posted June 9, 2018 Posted June 9, 2018 @Namio I'm afraid the Zybo Z7-10 Petalinux Project doesn't include working audio support. It may be added in a future release. I included drivers in the kernel config and device tree that worked with the SSM2603 in an earlier version of the kernel, but I ran into the same error you are reporting this time around. I left the drivers in and documented the broken audio as a known issue so that the it could be more easily debugged and resolved in a later release. Unfortunately, I'm expecting this issue to require a "deep dive" into the audio drivers, and I don't have time to address it immediately I could help bounce some ideas around for debugging if you are interested in taking a crack at it. A bare-metal example of using the SSM2603 is available here: https://reference.digilentinc.com/learn/programmable-logic/tutorials/zybo-z7-dma-audio-demo/start
AndyCap Posted February 21, 2019 Posted February 21, 2019 On 6/9/2018 at 6:59 AM, sbobrowicz said: I could help bounce some ideas around for debugging if you are interested in taking a crack at it. The above mentioned patch fixes it up and it all seems to run ok.
jpeyron Posted February 21, 2019 Posted February 21, 2019 Hi @AndyCap, Glad to here the patch fixes the issue and your project is up and running! cheers, Jon
AndyCap Posted March 5, 2019 Posted March 5, 2019 Hi Guys, Ok, I spoke too soon! There is a bit of a problem where the Zybo audio device doesn't recover from an underrun, after recovery the play buffer is never drained and it hangs when full on write to the device. I have checked that the issue is not a general alsa issue by setting up a gadget usb audio device to send over USB, this doesn't have the same issue. Has anyone got any ideas of where to start looking? Many thanks Andy
Ciprian Posted March 8, 2019 Posted March 8, 2019 Hi @AndyCap, Unfortunately I don't have the time to look in to this but judging by what you said Quote I have checked that the issue is not a general alsa issue by setting up a gadget usb audio device to send over USB, this doesn't have the same issue. I would look in to the IP driver of the audio system <kernel>/sound/soc/adi/axi-i2s.c (as far as I remember), how the buffers are handled in regards to the DMA transfer. The issue might be that full and the empty flags are nor properly handled in the driver or in the HDL IP. Sorry for not being able to help more. -Ciprian
AndyCap Posted March 8, 2019 Posted March 8, 2019 Hi @Ciprian, Thanks very much for the answer and the info, I will start looking there. Cheers Andy
AndyCap Posted March 10, 2019 Posted March 10, 2019 Hi @Ciprian, I have had a poke around in the debugger and the issue is probably related to the DMA as you say. I found that placing a breakpoint at: static int pl330_terminate_all(struct dma_chan *chan) "cured" the issue when the debugger was continued. So I looked for updates to this function and there was a patch for the pl330 lock code, unfortunately this doesn't fix the problem. Adding a 1000us delay before the lock in the code also "cures" the problem and everything then works for the under-run recovery. I tried smaller delays but 1000us is needed to make things work, this is obviously not a solution to the issue and wondered if you may have any more pointers or ideas why this delay fixes the issue? Cheers Andy
AndyCap Posted March 10, 2019 Posted March 10, 2019 Ok, looks like the issue is fixed in the more recent version of pl330.c: https://github.com/Xilinx/linux-xlnx/blob/master/drivers/dma/pl330.c Maybe other changes were needed for the locking stuff. I will get-together the patch files and cfg files needed to get it all working from a 2017.4 build and post it somewhere...
AndyCap Posted March 11, 2019 Posted March 11, 2019 Here you go: https://github.com/AndrewCapon/ZyboZ7Audio/blob/master/README.md
Question
Namio
Hello,
I am having trouble outputting sound on Linux using SSM2603.
The SSM2603 device driver loads normally.
It is also registered in ALSA sound card list.
However, "input / output error" is raised in "alsactl init". ("amixer" is also the same.)
It plays when I play wave file with "aplay" but it does not output to "R/LOUT pin" of SSM2603.
Regards,
Namio
12 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.