oandrew / ipod-gadget

iPod usb gadget for audio playback. Client app: https://github.com/oandrew/ipod
MIT License
205 stars 33 forks source link

All looks good, but can't stream sound #19

Closed LazyCloner closed 4 years ago

LazyCloner commented 4 years ago

Hello there,

I was able to install everything well, the client launch correctly, I can connect it to my car and I have Attached iPod Device on my car screen. But when I tried to run a sound test I have :

pi@raspberrypi:~ $ speaker-test -D plughw:CARD=iPodUSB,DEV=0 -c 2 -r 44100 ... Playback device is plughw:CARD=iPodUSB,DEV=0 ... Write error: -5,Input/output error xrun_recovery failed: -5,Input/output error Transfer failed: Input/output error

I'm working on a raspi zero W (raspian 5.4.51). And the sound card show up with aplay -l . The trace file only have the 2 following lines :

< 08 00 55 0E 00 13 00 00 04 11 00 00 00 02 00 00 02 00 C6 00 00 > 01 00 55 04 00 02 00 13 E7 00 00 00 00

And thank you for your code oandrew !

oandrew commented 4 years ago

Hi, @LazyCloner

Current master (https://github.com/oandrew/ipod) might fix the issue for you. Audio should be working once you see type=audio.TrackNewAudioAttributes message in the log

LazyCloner commented 4 years ago

Hi, thank you for your help !

It seem like it works better now but after type=audio.TrackNewAudioAttributes the audio device is still closed.

pi@raspi:~ $ sudo speaker-test -D plughw:CARD=iPodUSB,DEV.... ... Write error: -5, Input/output error pi@raspi:~ $ cat /proc/asound/iPodUSB/pcm0p/sub0/status closed

But the communication doesn't stuck anymore after GetDevAuthentificationInfo.

I'll upload the trace in 1h. (And I'll try to set the PlayState to 1)

PS : I tried with kernel 4.19 and golang versions 1.13 and 1.15

EDIT : I tried to set PlayState to 1 but it didn't do the trick. Here is the trace file ipod.trace

oandrew commented 4 years ago

@LazyCloner Try current master when you have a chance

LazyCloner commented 4 years ago

Hi @oandrew ! Thank you for your time. But unfortunately nothing changed. The audio device is still closed and the trace file is exactly same as the previous one.

Have a good day !

oandrew commented 4 years ago

@LazyCloner hmm.. trace file can't be the same because I fixed a bug in the most recent commit.

https://github.com/oandrew/ipod/commit/05257f6644a7bdc025d71284705df31489d6ac8d

LazyCloner commented 4 years ago

Ok, I'll double check if I clone it well

LazyCloner commented 4 years ago

So with the current master, I can now open the sound device but I could only ear like a white noise sound. And the program seem to be in a loop. There is the trace file. ipod.trace

In second, on my car screen, it's writen "PAUSED" Is the trace file look like normal ?

oandrew commented 4 years ago

@LazyCloner This is great! White noise is what you are supposed to hear - https://linux.die.net/man/1/speaker-test. It means everything is working.

LazyCloner commented 4 years ago

Oh nice ! Thank you so much Andrew ! I will do 2 more try before closing the issue. Thanks for your time, Is there a place to give some little donation ?

pavelkrotkov commented 4 years ago

Similar problem here - install went well, but no sound coming out in the speaker test. Compiled using go 1.15 on the latest RPi OS with kernel 5.4.72+. ipod trace prints this error message inline, full file attached.

ERRO[0411.607895] << CMD error=ipod.Command unmarshal: unknown cmd 0x00,0x0d id=0x00,0x0d trx= type=ipod.UnknownPayload

ipod.trace.txt