Code Monkey home page Code Monkey logo

Comments (17)

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024 1

You are not the first to have a different Alsa configuration, I will add a parameter to change the default value (pcm.default)

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024 1

I have reproduced the issue on debian 10 and if I simply remove the retrieval of periods, I have a nice sound :) I will provide a patch

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

I'm actually not getting any output at all on a freshly loaded test machine running Debian.

This works perfect though:
speaker-test -D pcm.default -c 2 -f 44100 -F S16_LE

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024

Do you have any error while starting the program ? I use my program on a Raspberry 1 with Raspbian. Any logs ?

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

I uncommented setLog() so it would output to a file but there are no errors in there. I also changed pcm.default to gibberish and it still doesn't produce any errors.

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024

there should be some logs at startup :

goplay2 -i en0
2021/07/07 20:55:08 Device Pi: be3a23ed-3159-4336-8282-1c543ff13fc9, guid: a41f6742-7fbb-4c42-b983-6094836b5a12, Psi: 94865c70-52b3-4b05-ad72-f26d10184f57

Another example if you are running without sudo on a linux (port below 1024 are usually restricted):

pi@raspberrypi:~/goplay2$ ./goplay2
2021/07/07 19:57:29 Device Pi: 583c51cb-1408-4998-a36e-8194908a8be9, guid: df903751-a6d1-4621-9518-443fbf48528f, Psi: 62b7ea64-4082-4de6-9fea-01ca856dffab
2021/07/07 19:57:30 Error while listening port 320 listen udp :320: bind: permission denied

If you do not have a similar line, there is an error in the build. If PCM.default ist not found, an error should be logged. On ArchLinux i've got an error anyway

I need to update the documentation for Raspberry Pi

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024

You need to pair (iPhone in my case) and try to play to music to have the error like this one :

2021/07/07 20:06:33 request received : SETUP rtsp://192.168.0.164/6934733998229897469 body 271 at 1482251614713274
2021/07/07 20:06:33 response sent : body 145 at 1482251625107943
2021/07/07 20:06:33 request received : POST /audioMode body 64 at 1482251651437105
2021/07/07 20:06:33 map[audioMode:default]
2021/07/07 20:06:33 response sent : body 0 at 1482251657656907
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM gibberish
2021/07/07 20:06:33 Audio Stream init error: could not open ALSA device gibberish

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

I did a git reset --hard (because I did a lot of dicking around) and then rebuilt and now I am getting errors:

2021/07/07 15:10:10 Device Pi: bebf7835-08cc-43d6-bc12-bd1af42abd21, guid: 4078901e-103f-4123-9548-7b41aba8878a, Psi: 3e20f0da-c9de-484b-aafa-3410b19e8af0
2021/07/07 15:10:21 conn opened
2021/07/07 15:10:21 request received : GET /info body 70 at 10579095608
2021/07/07 15:10:21 response sent : body 415 at 10579342067
2021/07/07 15:10:21 request received : POST /pair-setup body 6 at 10594878241
2021/07/07 15:10:21 response sent : body 409 at 10607979608
2021/07/07 15:10:21 request received : POST /pair-setup body 457 at 10689348925
2021/07/07 15:10:21 response sent : body 69 at 10701876825
2021/07/07 15:10:21 request received : POST /pair-setup body 159 at 10716363992
2021/07/07 15:10:21 response sent : body 143 at 10717740767
2021/07/07 15:10:21 request received : POST /pair-verify body 37 at 10807084562
2021/07/07 15:10:21 response sent : body 140 at 10807602704
2021/07/07 15:10:21 request received : POST /pair-verify body 125 at 10816730575
2021/07/07 15:10:21 response sent : body 3 at 10817329029
2021/07/07 15:10:21 request received : POST /fp-setup body 16 at 10821924150
2021/07/07 15:10:21 response sent : body 142 at 10821961393
2021/07/07 15:10:21 request received : POST /fp-setup body 164 at 10827285868
2021/07/07 15:10:21 response sent : body 32 at 10827322998
2021/07/07 15:10:21 request received : SETUP rtsp://10.1.0.94/6148076841563931421 body 893 at 10832567870
2021/07/07 15:10:21 response sent : body 76 at 10837702333
2021/07/07 15:10:21 request received : GET /info body 0 at 10952307016
2021/07/07 15:10:21 response sent : body 415 at 10952459930
2021/07/07 15:10:21 request received : GET_PARAMETER rtsp://10.1.0.94/6148076841563931421 body 8 at 10958829234
2021/07/07 15:10:21 response sent : body 14 at 10958873814
2021/07/07 15:10:21 request received : RECORD rtsp://10.1.0.94/6148076841563931421 body 0 at 10964105659
2021/07/07 15:10:21 response sent : body 0 at 10964142384
2021/07/07 15:10:21 request received : SETPEERS rtsp://10.1.0.94/6148076841563931421 body 84 at 10968565823
2021/07/07 15:10:21 response sent : body 0 at 10968603149
2021/07/07 15:10:21 request received : POST /command body 7074 at 10972830802
2021/07/07 15:10:21 response sent : body 0 at 10973258053
2021/07/07 15:10:21 request received : SET_PARAMETER rtsp://10.1.0.94/6148076841563931421 body 20 at 318247303394551
2021/07/07 15:10:21 response sent : body 0 at 318247303438439
2021/07/07 15:10:23 request received : POST /feedback body 0 at 318249326262274
2021/07/07 15:10:23 response sent : body 0 at 318249326300201
2021/07/07 15:10:23 request received : SETUP rtsp://10.1.0.94/6148076841563931421 body 271 at 318249451292454
2021/07/07 15:10:23 response sent : body 145 at 318249451494689
2021/07/07 15:10:23 request received : POST /audioMode body 64 at 318249467149047
2021/07/07 15:10:23 map[audioMode:default]
2021/07/07 15:10:23 response sent : body 0 at 318249467242942
2021/07/07 15:10:23 Audio Stream init error: could not get periods: Invalid argument

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

It also terminates after the "could not get periods" error.

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

BTW, I am not using an RPi.. this is a full sized Intel powered machine I had laying around.

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024

I need to look at what "could not get periods" error means from alsa perspective. I have merge some change anyway, you can pass "-alsa pcm.default" to change the alsa port (README.MD is updated)

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

Nice, thanks for that cmd line arg! As for the periods error. When I searched the code I see that message is hardcoded in the goalsa package. It's not an error coming directly from ALSA so searching on that error isn't getting me very far.

https://github.com/AlbanSeurat/goalsa/blob/master/alsa.go#L142

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

I found this documentation:
https://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___h_w___params.html#ga7242d7045ae23a9ae736c191030c25e8

It says it returns a negative value if the configuration space does not contain a single value. So I think something is just messed up with this default alsa.conf that Debian 10 created. If I run goplay with --alsa pcm.front I get audio although it's breaking up I've made progress. I wouldn't spend anymore time on this. I will test tonight on my server at the house with a working alsa config.

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024

From my research it seems indeed that this is a missing configuration. However, I am pretty sure goplay2 does not need this parameters anyway. I am just building goplay on a debian VM to check the issues...

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

Part of my confusion was that this project only supports BUFFERED and not REALTIME. I was initially testing with Spotify which is why it wasn't giving me any audio but also not returning any errors in stdout.

Thanks for your help and sorry to waste your time.

from goplay2.

AlbanSeurat avatar AlbanSeurat commented on July 20, 2024

Realtime will have some issue on RTP/UDP part. This is not supported for now. I use apple music on my side.
I might try to implement REALTIME one day but for now I focus on Buffered + Apple Music.

from goplay2.

noelhibbard avatar noelhibbard commented on July 20, 2024

I can confirm it's working now! Thanks again!

from goplay2.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.